Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release exported headers to include/aiebu #76

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ endif()
target_include_directories(${AIEBU_COPY_EXE}
PRIVATE
${AIEBU_AIE_RT_HEADER_DIR}
${AIEBU_SOURCE_DIR}/src/cpp/aiebu/src/include
${AIEBU_SOURCE_DIR}/src/cpp/include
)

target_link_libraries(${AIEBU_COPY_EXE} xaiengine aiebu_static)
Expand Down
12 changes: 6 additions & 6 deletions lib/src/gen-copy.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2024 Advanced Micro Devices, Inc.
// Copyright (C) 2024-2025 Advanced Micro Devices, Inc.

/**
* This file generates transaction commands for data copy from L3 -> L2 and from L2 -> L3.
Expand All @@ -14,18 +14,18 @@
* 3. Patch the col index of MemTile.
**/

#include "gen-common.h"

#include <cassert>
#include <iostream>
#include <fstream>
#include "aiebu/aiebu_assembler.h"

// AIE Driver headers
#include "xaiengine.h"
#include "xaiengine/xaiegbl_params.h"

#include "aiebu_assembler.h"
#include <cassert>
#include <fstream>
#include <iostream>

#include "gen-common.h"

#define XAIE_NUM_ROWS 6
#define XAIE_NUM_COLS 4
Expand Down
22 changes: 18 additions & 4 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ add_library(aiebu_library_objects OBJECT

target_include_directories(aiebu_library_objects
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${AIEBU_SOURCE_DIR}
${AIEBU_AIE_RT_HEADER_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${Boost_INCLUDE_DIRS}
${AIEBU_BINARY_DIR}/lib
${AIEBU_SOURCE_DIR}/src/cpp/ELFIO
${Boost_INCLUDE_DIRS}

# The following should be spelled out in code
${CMAKE_CURRENT_SOURCE_DIR}/include/aiebu
${CMAKE_CURRENT_SOURCE_DIR}/ELFIO
${CMAKE_CURRENT_SOURCE_DIR}/preprocessor
${CMAKE_CURRENT_SOURCE_DIR}/preprocessor/aie2
${CMAKE_CURRENT_SOURCE_DIR}/encoder
Expand All @@ -42,6 +42,11 @@ target_include_directories(aiebu_library_objects
${AIEBU_BINARY_DIR}/lib/gen
)

target_compile_definitions(aiebu_library_objects
PRIVATE
-DAIEBU_EXPORTS
)

set_target_properties(aiebu_library_objects PROPERTIES
CXX_VISIBILITY_PRESET hidden
POSITION_INDEPENDENT_CODE ON
Expand Down Expand Up @@ -80,6 +85,15 @@ install(FILES
include/aiebu/aiebu.h
include/aiebu/aiebu_assembler.h
include/aiebu/aiebu_error.h
DESTINATION ${AIEBU_INSTALL_INCLUDE_DIR}/aiebu
CONFIGURATIONS Debug Release COMPONENT Runtime
)

# Deprecated include path, redirects to aiebu/*.h with warning
install(FILES
include/deprecated/aiebu.h
include/deprecated/aiebu_assembler.h
include/deprecated/aiebu_error.h
DESTINATION ${AIEBU_INSTALL_INCLUDE_DIR}
CONFIGURATIONS Debug Release COMPONENT Runtime
)
2 changes: 1 addition & 1 deletion src/cpp/aiebu/src/include/aiebu.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
#pragma message("please replace src/cpp/aiebu/src/include/aiebu.h with src/cpp/include/aiebu/aiebu.h")
#pragma message("Please replace inclusion of include/aiebu.h with include/aiebu/aiebu.h")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: Please replace inclusion of include/aiebu.h with include/aiebu/aiebu.h [clang-diagnostic-#pragma-messages]

#pragma message("Please replace inclusion of include/aiebu.h with include/aiebu/aiebu.h")
        ^

#include "../../../include/aiebu/aiebu.h"
2 changes: 1 addition & 1 deletion src/cpp/aiebu/src/include/aiebu_assembler.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
#pragma message("please replace src/cpp/aiebu/src/include/aiebu_assembler.h with src/cpp/include/aiebu/aiebu_assembler.h")
#pragma message("Please replace inclusion of include/aiebu_assembler.h with include/aiebu/aiebu_assembler.h")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: Please replace inclusion of include/aiebu_assembler.h with include/aiebu/aiebu_assembler.h [clang-diagnostic-#pragma-messages]

#pragma message("Please replace inclusion of include/aiebu_assembler.h with include/aiebu/aiebu_assembler.h")
        ^

#include "../../../include/aiebu/aiebu_assembler.h"
2 changes: 1 addition & 1 deletion src/cpp/aiebu/src/include/aiebu_error.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
#pragma message("please replace src/cpp/aiebu/src/include/aiebu_error.h with src/cpp/include/aiebu/aiebu_error.h")
#pragma message("Please replace inclusion of include/aiebu_error.h with include/aiebu/aiebu_error.h")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: Please replace inclusion of include/aiebu_error.h with include/aiebu/aiebu_error.h [clang-diagnostic-#pragma-messages]

#pragma message("Please replace inclusion of include/aiebu_error.h with include/aiebu/aiebu_error.h")
        ^

#include "../../../include/aiebu/aiebu_error.h"
8 changes: 3 additions & 5 deletions src/cpp/analyzer/reporter.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.

// Copyright (C) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.
#include "reporter.h"
#include "aiebu_error.h"

#include "transaction.hpp"

#include "aiebu/aiebu_error.h"

#include <boost/interprocess/streams/bufferstream.hpp>
#include <elfio/elfio_dump.hpp>

namespace aiebu {

reporter::reporter(aiebu::aiebu_assembler::buffer_type /*type*/, const std::vector<char>& elf_data)
Expand Down
9 changes: 4 additions & 5 deletions src/cpp/analyzer/reporter.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (C) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.
#ifndef AIEBU_REPORTER_H_
#define AIEBU_REPORTER_H_

#ifndef _AIEBU_REPORTER_H_
#define _AIEBU_REPORTER_H_

#include "aiebu_assembler.h"
#include "aiebu/aiebu_assembler.h"

#include <elfio/elfio_dump.hpp>

Expand Down
16 changes: 8 additions & 8 deletions src/cpp/assembler/aiebu_assembler.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.

#include "assembler.h"
#include "aiebu_assembler.h"
#include "aiebu.h"
#include "aiebu_error.h"
#include "symbol.h"
#include "utils.h"
#include "preprocessor.h"
#include "encoder.h"
#include "elfwriter.h"
#include "encoder.h"
#include "preprocessor.h"
#include "preprocessor_input.h"
#include "reporter.h"
#include "symbol.h"
#include "utils.h"

#include "aiebu/aiebu.h"
#include "aiebu/aiebu_assembler.h"
#include "aiebu/aiebu_error.h"

#include <map>
#include <string>
Expand Down
21 changes: 10 additions & 11 deletions src/cpp/assembler/assembler.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.

// Copyright (C) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.
#include "assembler.h"
#include "aie2_blob_preprocessor.h"

#include "aie2_asm_preprocessor.h"
#include "aie2_blob_encoder.h"
#include "aie2_blob_elfwriter.h"
#include "aie2ps_preprocessor.h"
#include "aie2ps_encoder.h"
#include "aie2_blob_encoder.h"
#include "aie2_blob_preprocessor.h"
#include "aie2ps_elfwriter.h"

#include "aiebu_error.h"

#include "preprocessor.h"
#include "encoder.h"
#include "aie2ps_encoder.h"
#include "aie2ps_preprocessor.h"
#include "elfwriter.h"
#include "encoder.h"
#include "preprocessor.h"

#include "aiebu/aiebu_error.h"

namespace aiebu {

Expand Down
5 changes: 3 additions & 2 deletions src/cpp/common/aiebu_error.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (C) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.

#include "aiebu/aiebu_error.h"
#include <string>
#include "aiebu_error.h"

namespace aiebu {

error::
Expand Down
10 changes: 6 additions & 4 deletions src/cpp/common/assembler_state.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.

// Copyright (C) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.
#include "assembler_state.h"
#include "aiebu_error.h"

#include "utils.h"
#include <unordered_map>

#include "aiebu/aiebu_error.h"

#include <functional>
#include <unordered_map>

namespace aiebu {

Expand Down
18 changes: 8 additions & 10 deletions src/cpp/common/utils.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.
#ifndef AIEBU_COMMOM_UTILS_H_
#define AIEBU_COMMOM_UTILS_H_
#include "aiebu/aiebu_error.h"

#ifndef _AIEBU_COMMOM_UTILS_H_
#define _AIEBU_COMMOM_UTILS_H_

#include <fstream>
#include <filesystem>
#include <iostream>
#include <cassert>
#include <cstdint>
#include <filesystem>
#include <fstream>
#include <regex>
#include <sstream>
#include <string>
#include <string_view>
#include <sstream>
#include <vector>
#include <regex>
#include "aiebu_error.h"

#define BYTE_MASK 0xFF
#define FIRST_BYTE_SHIFT 0
Expand Down Expand Up @@ -190,4 +188,4 @@ to_uinteger(const std::string& token) {
}

}
#endif // _AIEBU_COMMOM_UTILS_H_
#endif // AIEBU_COMMOM_UTILS_H_
7 changes: 4 additions & 3 deletions src/cpp/common/writer.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (C) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.

#include "writer.h"
#include "aiebu_error.h"
#include "utils.h"
#include "writer.h"

#include "aiebu/aiebu_error.h"

namespace aiebu {

Expand Down
7 changes: 4 additions & 3 deletions src/cpp/encoder/aie2ps/aie2ps_encoder.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.

// Copyright (C) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.
#include "aie2ps_encoder.h"
#include "aiebu_error.h"

#include "aiebu/aiebu_error.h"

#include <cassert>

namespace aiebu {
Expand Down
3 changes: 2 additions & 1 deletion src/cpp/include/aiebu/aiebu_assembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ namespace aiebu {

// Assembler Class

class aiebu_assembler {
class aiebu_assembler
{
std::vector<char> elf_data;

public:
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/include/aiebu/aiebu_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (C) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.
#ifndef AIEBU_ERROR_H_
#define AIEBU_ERROR_H_
#include "aiebu.h"
#include "aiebu/aiebu.h"

#include <string>
#include <system_error>
Expand Down
29 changes: 29 additions & 0 deletions src/cpp/include/aiebu/detail/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
#ifndef AIEBU_DETAIL_CONFIG_H
#define AIEBU_DETAIL_CONFIG_H

//------------------Enable dynamic linking on windows-------------------------//

#ifdef _WIN32
# ifndef AIEBU_STATIC_BUILD
# ifdef AIEBU_API_SOURCE
# define AIEBU_API_EXPORT __declspec(dllexport)
# else
# define AIEBU_API_EXPORT __declspec(dllimport)
# endif
# endif
#endif
#ifdef __linux__
# ifdef AIEBU_API_SOURCE
# define AIEBU_API_EXPORT __attribute__ ((visibility("default")))
# else
# define AIEBU_API_EXPORT
# endif
#endif

#ifndef AIEBU_API_EXPORT
# define AIEBU_API_EXPORT
#endif

#endif
4 changes: 4 additions & 0 deletions src/cpp/include/deprecated/aiebu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
#pragma message("Please replace inclusion of aiebu.h with aiebu/aiebu.h")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: Please replace inclusion of aiebu.h with aiebu/aiebu.h [clang-diagnostic-#pragma-messages]

#pragma message("Please replace inclusion of aiebu.h with aiebu/aiebu.h")
        ^

#include "aiebu/aiebu.h"
4 changes: 4 additions & 0 deletions src/cpp/include/deprecated/aiebu_assembler.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
#pragma message("Please replace inclusion of aiebu_assembler.h with aiebu/aiebu_assembler.h")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: Please replace inclusion of aiebu_assembler.h with aiebu/aiebu_assembler.h [clang-diagnostic-#pragma-messages]

#pragma message("Please replace inclusion of aiebu_assembler.h with aiebu/aiebu_assembler.h")
        ^

#include "aiebu/aiebu_assembler.h"
4 changes: 4 additions & 0 deletions src/cpp/include/deprecated/aiebu_error.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
#pragma message("Please replace inclusion of aiebu_error.h with aiebu/aiebu_error.h")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: Please replace inclusion of aiebu_error.h with aiebu/aiebu_error.h [clang-diagnostic-#pragma-messages]

#pragma message("Please replace inclusion of aiebu_error.h with aiebu/aiebu_error.h")
        ^

#include "aiebu/aiebu_error.h"
8 changes: 5 additions & 3 deletions src/cpp/ops/ops.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.

// Copyright (C) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.
#include "ops.h"
#include "aiebu_error.h"

#include "aiebu/aiebu_error.h"

#include <string>

namespace aiebu {

offset_type
Expand Down
8 changes: 5 additions & 3 deletions src/cpp/preprocessor/asm/asm_parser.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// SPDX-License-Identifier: MIT
// Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (C) 2024-2025, Advanced Micro Devices, Inc. All rights reserved.
#include "asm_parser.h"

#include "asm/asm_parser.h"
#include "aiebu_error.h"
#include "aiebu/aiebu_error.h"

#include <iostream>

namespace aiebu {

Expand Down
Loading