Build system (libdw), correlation ID, and shebang fixes (#354)
* Fix compilation for output library - link to targets for ATT (amd-comgr, dw, elf) * Relax correlation ID retirement log failures - only fail for correlation ID retirement underflow when building in CI mode * Fix shebang for several files - license was inserted before shebang in several places * Update code coverage exclude folders for samples * Tweak to agent tests - test to make sure hsa agent is not the old value instead of testing that it is the new value * Fix libdw include/link --------- Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
This commit is contained in:
committed by
GitHub
vanhempi
06005c7f6b
commit
3580478426
@@ -30,13 +30,24 @@ if(PkgConfig_FOUND)
|
||||
|
||||
if(DW_FOUND
|
||||
AND DW_INCLUDE_DIRS
|
||||
AND DW_LIBRARIES)
|
||||
AND DW_LINK_LIBRARIES)
|
||||
set(libdw_INCLUDE_DIR
|
||||
"${DW_INCLUDE_DIRS}"
|
||||
CACHE FILEPATH "libdw include directory")
|
||||
set(libdw_LIBRARY
|
||||
"${DW_LIBRARIES}"
|
||||
"${DW_LINK_LIBRARIES}"
|
||||
CACHE FILEPATH "libdw libraries")
|
||||
if(DW_PREFIX)
|
||||
set(libdw_ROOT_DIR
|
||||
"${DW_PREFIX}"
|
||||
CACHE FILEPATH "libdw root directory")
|
||||
endif()
|
||||
|
||||
if(DW_VERSION)
|
||||
set(libdw_VERSION
|
||||
"${DW_VERSION}"
|
||||
CACHE FILEPATH "libdw version")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -70,13 +81,13 @@ find_package_handle_standard_args(libdw DEFAULT_MSG libdw_LIBRARY libdw_INCLUDE_
|
||||
if(libdw_FOUND)
|
||||
if(NOT TARGET libdw::libdw)
|
||||
add_library(libdw::libdw INTERFACE IMPORTED)
|
||||
endif()
|
||||
|
||||
if(TARGET PkgConfig::DW AND DW_FOUND)
|
||||
target_link_libraries(libdw::libdw INTERFACE PkgConfig::DW)
|
||||
else()
|
||||
target_link_libraries(libdw::libdw INTERFACE ${libdw_LIBRARY})
|
||||
target_include_directories(libdw::libdw SYSTEM INTERFACE ${libdw_INCLUDE_DIR})
|
||||
if(TARGET PkgConfig::DW AND DW_FOUND)
|
||||
target_link_libraries(libdw::libdw INTERFACE PkgConfig::DW)
|
||||
else()
|
||||
target_link_libraries(libdw::libdw INTERFACE ${libdw_LIBRARY})
|
||||
target_include_directories(libdw::libdw SYSTEM INTERFACE ${libdw_INCLUDE_DIR})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -129,6 +129,17 @@ else()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(EXISTS ${@PACKAGE_NAME@_CMAKE_DIR}/Modules)
|
||||
list(INSERT CMAKE_MODULE_PATH 0 ${@PACKAGE_NAME@_CMAKE_DIR}/Modules)
|
||||
find_package(libdw)
|
||||
list(REMOVE_AT CMAKE_MODULE_PATH 0)
|
||||
endif()
|
||||
|
||||
if(libdw_FOUND AND TARGET libdw::libdw)
|
||||
rocprofiler_config_nolink_target(@PACKAGE_NAME@::@PACKAGE_NAME@-external-nolink
|
||||
libdw::libdw)
|
||||
endif()
|
||||
|
||||
target_link_libraries(@PACKAGE_NAME@::@PACKAGE_NAME@
|
||||
INTERFACE @PACKAGE_NAME@::@PACKAGE_NAME@-external-nolink)
|
||||
endif()
|
||||
@@ -136,7 +147,8 @@ endif()
|
||||
add_executable(@PACKAGE_NAME@::rocprofv3 IMPORTED)
|
||||
set_property(
|
||||
TARGET @PACKAGE_NAME@::rocprofv3
|
||||
PROPERTY IMPORTED_LOCATION ${@PACKAGE_NAME@_ROOT_DIR}/@CMAKE_INSTALL_BINDIR@/rocprofv3)
|
||||
PROPERTY IMPORTED_LOCATION
|
||||
${@PACKAGE_NAME@_ROOT_DIR}/@CMAKE_INSTALL_BINDIR@/rocprofv3)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
@@ -155,4 +167,7 @@ endif()
|
||||
add_executable(@PACKAGE_NAME@::convert-counters-collection-format IMPORTED)
|
||||
set_property(
|
||||
TARGET @PACKAGE_NAME@::convert-counters-collection-format
|
||||
PROPERTY IMPORTED_LOCATION ${@PACKAGE_NAME@_ROOT_DIR}/share/@PACKAGE_NAME@/convert-counters-collection-format.py)
|
||||
PROPERTY
|
||||
IMPORTED_LOCATION
|
||||
${@PACKAGE_NAME@_ROOT_DIR}/share/@PACKAGE_NAME@/convert-counters-collection-format.py
|
||||
)
|
||||
|
||||
@@ -46,7 +46,8 @@ install(
|
||||
|
||||
install(
|
||||
FILES ${PROJECT_SOURCE_DIR}/cmake/Modules/rocprofiler-sdk-custom-compilation.cmake
|
||||
FILES ${PROJECT_SOURCE_DIR}/cmake/Modules/rocprofiler-sdk-utilities.cmake
|
||||
${PROJECT_SOURCE_DIR}/cmake/Modules/rocprofiler-sdk-utilities.cmake
|
||||
${PROJECT_SOURCE_DIR}/cmake/Modules/Findlibdw.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PACKAGE_NAME}/Modules
|
||||
COMPONENT development)
|
||||
|
||||
@@ -94,7 +95,8 @@ configure_file(
|
||||
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/${PACKAGE_NAME}/${PACKAGE_NAME}-config-nolink-target.cmake
|
||||
COPYONLY)
|
||||
|
||||
foreach(_FILE rocprofiler-sdk-custom-compilation.cmake rocprofiler-sdk-utilities.cmake)
|
||||
foreach(_FILE rocprofiler-sdk-custom-compilation.cmake rocprofiler-sdk-utilities.cmake
|
||||
Findlibdw.cmake)
|
||||
configure_file(
|
||||
${PROJECT_SOURCE_DIR}/cmake/Modules/${_FILE}
|
||||
${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/${PACKAGE_NAME}/Modules/${_FILE}
|
||||
@@ -118,7 +120,7 @@ set(${PACKAGE_NAME}_BUILD_TREE
|
||||
ON
|
||||
CACHE BOOL "" FORCE)
|
||||
|
||||
set(PROJECT_BUILD_TREE_TARGETS headers shared-library build-flags stack-protector)
|
||||
set(PROJECT_BUILD_TREE_TARGETS headers shared-library build-flags stack-protector dw)
|
||||
|
||||
configure_file(
|
||||
${PROJECT_SOURCE_DIR}/cmake/Templates/${PACKAGE_NAME}/build-config.cmake.in
|
||||
|
||||
@@ -25,63 +25,6 @@ foreach(_TYPE DEBUG MINSIZEREL RELEASE RELWITHDEBINFO)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
if(PkgConfig_FOUND)
|
||||
set(ENV{PKG_CONFIG_SYSTEM_INCLUDE_PATH} "")
|
||||
pkg_check_modules(DW libdw)
|
||||
|
||||
if(DW_FOUND
|
||||
AND DW_INCLUDE_DIRS
|
||||
AND DW_LIBRARIES)
|
||||
set(libdw_INCLUDE_DIR
|
||||
"${DW_INCLUDE_DIRS}"
|
||||
CACHE FILEPATH "libdw include directory")
|
||||
set(libdw_LIBRARY
|
||||
"${DW_LIBRARIES}"
|
||||
CACHE FILEPATH "libdw libraries")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT libdw_INCLUDE_DIR OR NOT libdw_LIBRARY)
|
||||
find_path(
|
||||
libdw_ROOT_DIR
|
||||
NAMES include/elfutils/libdw.h
|
||||
HINTS ${libdw_ROOT}
|
||||
PATHS ${libdw_ROOT})
|
||||
|
||||
mark_as_advanced(libdw_ROOT_DIR)
|
||||
|
||||
find_path(
|
||||
libdw_INCLUDE_DIR
|
||||
NAMES elfutils/libdw.h
|
||||
HINTS ${libdw_ROOT}
|
||||
PATHS ${libdw_ROOT}
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(
|
||||
libdw_LIBRARY
|
||||
NAMES dw
|
||||
HINTS ${libdw_ROOT}
|
||||
PATHS ${libdw_ROOT}
|
||||
PATH_SUFFIXES lib lib64)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(libdw DEFAULT_MSG libdw_LIBRARY libdw_INCLUDE_DIR)
|
||||
|
||||
if(libdw_FOUND AND NOT TARGET libdw::libdw)
|
||||
add_library(libdw::libdw INTERFACE IMPORTED)
|
||||
if(TARGET PkgConfig::DW AND DW_FOUND)
|
||||
target_link_libraries(libdw::libdw INTERFACE PkgConfig::DW)
|
||||
else()
|
||||
target_link_libraries(libdw::libdw INTERFACE ${libdw_LIBRARY})
|
||||
target_include_directories(libdw::libdw SYSTEM INTERFACE ${libdw_INCLUDE_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(libdw_INCLUDE_DIR libdw_LIBRARY)
|
||||
|
||||
find_package(rocprofiler-sdk REQUIRED)
|
||||
find_package(
|
||||
amd_comgr
|
||||
@@ -92,9 +35,7 @@ find_package(
|
||||
${ROCM_PATH}
|
||||
PATHS
|
||||
${rocm_version_DIR}
|
||||
${ROCM_PATH}
|
||||
PATH_SUFFIXES
|
||||
lib/cmake/amd_comgr)
|
||||
${ROCM_PATH})
|
||||
|
||||
set_source_files_properties(main.cpp PROPERTIES LANGUAGE HIP)
|
||||
set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS "-g")
|
||||
|
||||
@@ -2,62 +2,10 @@
|
||||
# common utilities for samples
|
||||
#
|
||||
|
||||
find_package(PkgConfig)
|
||||
find_package(rocprofiler-sdk REQUIRED)
|
||||
|
||||
if(PkgConfig_FOUND)
|
||||
set(ENV{PKG_CONFIG_SYSTEM_INCLUDE_PATH} "")
|
||||
pkg_check_modules(DW libdw)
|
||||
|
||||
if(DW_FOUND
|
||||
AND DW_INCLUDE_DIRS
|
||||
AND DW_LIBRARIES)
|
||||
set(libdw_INCLUDE_DIR
|
||||
"${DW_INCLUDE_DIRS}"
|
||||
CACHE FILEPATH "libdw include directory")
|
||||
set(libdw_LIBRARY
|
||||
"${DW_LIBRARIES}"
|
||||
CACHE FILEPATH "libdw libraries")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT libdw_INCLUDE_DIR OR NOT libdw_LIBRARY)
|
||||
find_path(
|
||||
libdw_ROOT_DIR
|
||||
NAMES include/elfutils/libdw.h
|
||||
HINTS ${libdw_ROOT}
|
||||
PATHS ${libdw_ROOT})
|
||||
|
||||
mark_as_advanced(libdw_ROOT_DIR)
|
||||
|
||||
find_path(
|
||||
libdw_INCLUDE_DIR
|
||||
NAMES elfutils/libdw.h
|
||||
HINTS ${libdw_ROOT}
|
||||
PATHS ${libdw_ROOT}
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(
|
||||
libdw_LIBRARY
|
||||
NAMES dw
|
||||
HINTS ${libdw_ROOT}
|
||||
PATHS ${libdw_ROOT}
|
||||
PATH_SUFFIXES lib lib64)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(libdw DEFAULT_MSG libdw_LIBRARY libdw_INCLUDE_DIR)
|
||||
|
||||
if(libdw_FOUND AND NOT TARGET libdw::libdw)
|
||||
add_library(libdw::libdw INTERFACE IMPORTED)
|
||||
if(TARGET PkgConfig::DW AND DW_FOUND)
|
||||
target_link_libraries(libdw::libdw INTERFACE PkgConfig::DW)
|
||||
else()
|
||||
target_link_libraries(libdw::libdw INTERFACE ${libdw_LIBRARY})
|
||||
target_include_directories(libdw::libdw SYSTEM INTERFACE ${libdw_INCLUDE_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(libdw_INCLUDE_DIR libdw_LIBRARY)
|
||||
# rocprofiler-sdk provides a Findlibdw.cmake
|
||||
find_package(libdw REQUIRED)
|
||||
|
||||
# default FAIL_REGULAR_EXPRESSION for tests
|
||||
set(ROCPROFILER_DEFAULT_FAIL_REGEX
|
||||
|
||||
@@ -10,7 +10,8 @@ target_link_libraries(
|
||||
att-parser-tool-v3
|
||||
PRIVATE rocprofiler-sdk::rocprofiler-sdk-att-parser
|
||||
rocprofiler-sdk::rocprofiler-sdk-json
|
||||
rocprofiler-sdk::rocprofiler-sdk-common-library)
|
||||
rocprofiler-sdk::rocprofiler-sdk-common-library
|
||||
rocprofiler-sdk::rocprofiler-sdk-dw)
|
||||
|
||||
add_executable(att-decoder-test)
|
||||
target_sources(att-decoder-test PRIVATE att_decoder_test.cpp)
|
||||
@@ -21,6 +22,7 @@ target_link_libraries(
|
||||
rocprofiler-sdk::rocprofiler-sdk-common-library
|
||||
rocprofiler-sdk::rocprofiler-sdk-glog
|
||||
rocprofiler-sdk::rocprofiler-sdk-static-library
|
||||
rocprofiler-sdk::rocprofiler-sdk-dw
|
||||
GTest::gtest
|
||||
GTest::gtest_main)
|
||||
|
||||
|
||||
@@ -61,4 +61,7 @@ target_link_libraries(
|
||||
rocprofiler-sdk::rocprofiler-sdk-common-library
|
||||
rocprofiler-sdk::rocprofiler-sdk-cereal
|
||||
rocprofiler-sdk::rocprofiler-sdk-perfetto
|
||||
rocprofiler-sdk::rocprofiler-sdk-otf2)
|
||||
rocprofiler-sdk::rocprofiler-sdk-otf2
|
||||
rocprofiler-sdk::rocprofiler-sdk-amd-comgr
|
||||
rocprofiler-sdk::rocprofiler-sdk-dw
|
||||
rocprofiler-sdk::rocprofiler-sdk-elf)
|
||||
|
||||
@@ -70,7 +70,8 @@ target_link_libraries(
|
||||
rocprofiler-sdk::rocprofiler-sdk-amd-comgr
|
||||
rocprofiler-sdk::rocprofiler-sdk-hsa-aql
|
||||
rocprofiler-sdk::rocprofiler-sdk-drm
|
||||
rocprofiler-sdk::rocprofiler-sdk-hsakmt-nolink)
|
||||
rocprofiler-sdk::rocprofiler-sdk-hsakmt-nolink
|
||||
rocprofiler-sdk::rocprofiler-sdk-dw)
|
||||
|
||||
target_compile_definitions(rocprofiler-sdk-object-library PRIVATE rocprofiler_EXPORTS=1)
|
||||
|
||||
@@ -140,6 +141,7 @@ target_link_libraries(
|
||||
PUBLIC rocprofiler-sdk::rocprofiler-sdk-headers
|
||||
rocprofiler-sdk::rocprofiler-sdk-hsa-runtime-nolink
|
||||
rocprofiler-sdk::rocprofiler-sdk-hip-nolink
|
||||
$<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-dw>
|
||||
PRIVATE rocprofiler-sdk::rocprofiler-sdk-common-library
|
||||
rocprofiler-sdk::rocprofiler-sdk-object-library)
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "lib/common/utility.hpp"
|
||||
#include "lib/rocprofiler-sdk/buffer.hpp"
|
||||
#include "lib/rocprofiler-sdk/context/context.hpp"
|
||||
#include "lib/rocprofiler-sdk/registration.hpp"
|
||||
|
||||
#include <rocprofiler-sdk/fwd.h>
|
||||
|
||||
@@ -63,7 +64,8 @@ correlation_id::add_ref_count()
|
||||
{
|
||||
auto _ret = m_ref_count.fetch_add(1);
|
||||
|
||||
ROCP_FATAL_IF(_ret == 0) << "correlation id already retired";
|
||||
ROCP_CI_LOG_IF(WARNING, _ret == 0)
|
||||
<< fmt::format("correlation id {} already retired", internal);
|
||||
|
||||
return _ret;
|
||||
}
|
||||
@@ -71,9 +73,19 @@ correlation_id::add_ref_count()
|
||||
uint32_t
|
||||
correlation_id::sub_ref_count()
|
||||
{
|
||||
if(m_ref_count == 0)
|
||||
{
|
||||
ROCP_CI_LOG(WARNING) << fmt::format(
|
||||
"attempt to decrement correlation id {} reference count but reference count is zero",
|
||||
internal);
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto _ret = m_ref_count.fetch_sub(1);
|
||||
|
||||
ROCP_FATAL_IF(_ret == 0) << "correlation id underflow";
|
||||
if(registration::get_fini_status() > 0) return 0;
|
||||
|
||||
ROCP_CI_LOG_IF(WARNING, _ret == 0) << fmt::format("correlation id underflow on {}", internal);
|
||||
|
||||
if(_ret == 1)
|
||||
{
|
||||
@@ -101,7 +113,8 @@ correlation_id::sub_ref_count()
|
||||
ROCPROFILER_BUFFER_TRACING_CORRELATION_ID_RETIREMENT,
|
||||
record);
|
||||
|
||||
ROCP_FATAL_IF(!success) << "failed to emplace correlation id retirement";
|
||||
ROCP_CI_LOG_IF(WARNING, !success)
|
||||
<< fmt::format("failed to emplace correlation id retirement for {}", internal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ TEST(rocprofiler_lib, agent)
|
||||
EXPECT_EQ(agent->workgroup_max_dim.z, hsa_agent->workgroup_max_dim[2]) << msg;
|
||||
EXPECT_EQ(agent->grid_max_size, hsa_agent->grid_max_size) << msg;
|
||||
// Skip the checks for older grid x, y, z dimension values.
|
||||
if(hsa_agent->grid_max_dim.x == std::numeric_limits<int32_t>::max())
|
||||
if(hsa_agent->grid_max_dim.x != std::numeric_limits<uint32_t>::max())
|
||||
{
|
||||
EXPECT_EQ(agent->grid_max_dim.x, hsa_agent->grid_max_dim.x) << msg;
|
||||
EXPECT_EQ(agent->grid_max_dim.y, hsa_agent->grid_max_dim.y) << msg;
|
||||
|
||||
+1
-1
@@ -1,3 +1,4 @@
|
||||
#!/bin/bash -e
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,7 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# This script allows CMAKE_CXX_COMPILER to be a standard
|
||||
# C++ compiler and rocprofiler-sdk sets RULE_LAUNCH_COMPILE and
|
||||
|
||||
@@ -142,7 +142,12 @@ def generate_custom(args, cmake_args, ctest_args):
|
||||
".*/counters/parser/.*",
|
||||
]
|
||||
if args.coverage == "samples":
|
||||
codecov_exclude += [".*/lib/common/.*", ".*/lib/rocprofiler-sdk-tool/.*"]
|
||||
codecov_exclude += [
|
||||
".*/lib/common/.*",
|
||||
".*/lib/output/.*",
|
||||
".*/lib/att-tool/.*",
|
||||
".*/lib/rocprofiler-sdk-tool/.*",
|
||||
]
|
||||
|
||||
COVERAGE_EXCLUDE = ";".join(codecov_exclude)
|
||||
|
||||
|
||||
@@ -77,19 +77,6 @@ target_compile_options(hsa_code_object_testapp PRIVATE -W -Wall -Wextra -Wshadow
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(hsa_code_object_testapp PRIVATE stdc++fs Threads::Threads)
|
||||
|
||||
find_package(
|
||||
amd_comgr
|
||||
REQUIRED
|
||||
CONFIG
|
||||
HINTS
|
||||
${CMAKE_INSTALL_PREFIX}
|
||||
PATHS
|
||||
${ROCM_PATH}
|
||||
PATH_SUFFIXES
|
||||
lib/cmake/amd_comgr)
|
||||
|
||||
target_link_libraries(hsa_code_object_testapp PRIVATE amd_comgr)
|
||||
|
||||
find_package(rocprofiler-sdk REQUIRED)
|
||||
target_link_libraries(
|
||||
hsa_code_object_testapp PRIVATE rocprofiler-sdk::rocprofiler-sdk
|
||||
|
||||
@@ -54,19 +54,6 @@ target_compile_options(multiqueue_testapp PRIVATE -W -Wall -Wextra -Wshadow -Wer
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(multiqueue_testapp PRIVATE stdc++fs Threads::Threads)
|
||||
|
||||
find_package(
|
||||
amd_comgr
|
||||
REQUIRED
|
||||
CONFIG
|
||||
HINTS
|
||||
${CMAKE_INSTALL_PREFIX}
|
||||
PATHS
|
||||
${ROCM_PATH}
|
||||
PATH_SUFFIXES
|
||||
lib/cmake/amd_comgr)
|
||||
|
||||
target_link_libraries(multiqueue_testapp PRIVATE amd_comgr)
|
||||
|
||||
find_package(rocprofiler-sdk REQUIRED)
|
||||
target_link_libraries(multiqueue_testapp PRIVATE rocprofiler-sdk::rocprofiler-sdk
|
||||
rocprofiler-sdk::tests-common-library)
|
||||
|
||||
@@ -42,6 +42,11 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.30)
|
||||
cmake_policy(SET CMP0167 NEW)
|
||||
endif()
|
||||
|
||||
find_package(rocprofiler-sdk REQUIRED)
|
||||
|
||||
# rocprofiler-sdk provides a Findlibdw.cmake
|
||||
find_package(libdw REQUIRED)
|
||||
|
||||
# build flags
|
||||
add_library(rocprofiler-sdk-tests-build-flags INTERFACE)
|
||||
add_library(rocprofiler-sdk::tests-build-flags ALIAS rocprofiler-sdk-tests-build-flags)
|
||||
@@ -138,7 +143,8 @@ add_library(rocprofiler-sdk::tests-common-library ALIAS
|
||||
rocprofiler-sdk-tests-common-library)
|
||||
target_link_libraries(
|
||||
rocprofiler-sdk-tests-common-library
|
||||
INTERFACE rocprofiler-sdk::tests-build-flags rocprofiler-sdk::rocprofiler-sdk-cereal)
|
||||
INTERFACE rocprofiler-sdk::tests-build-flags rocprofiler-sdk::rocprofiler-sdk-cereal
|
||||
libdw::libdw)
|
||||
target_compile_features(rocprofiler-sdk-tests-common-library INTERFACE cxx_std_17)
|
||||
target_include_directories(rocprofiler-sdk-tests-common-library
|
||||
INTERFACE ${COMMON_LIBRARY_INCLUDE_DIR})
|
||||
|
||||
@@ -27,61 +27,6 @@ endforeach()
|
||||
|
||||
find_package(rocprofiler-sdk REQUIRED)
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
if(PkgConfig_FOUND)
|
||||
set(ENV{PKG_CONFIG_SYSTEM_INCLUDE_PATH} "")
|
||||
pkg_check_modules(DW libdw)
|
||||
|
||||
if(DW_FOUND
|
||||
AND DW_INCLUDE_DIRS
|
||||
AND DW_LIBRARIES)
|
||||
set(libdw_INCLUDE_DIR
|
||||
"${DW_INCLUDE_DIRS}"
|
||||
CACHE FILEPATH "libdw include directory")
|
||||
set(libdw_LIBRARY
|
||||
"${DW_LIBRARIES}"
|
||||
CACHE FILEPATH "libdw libraries")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT libdw_INCLUDE_DIR OR NOT libdw_LIBRARY)
|
||||
find_path(
|
||||
libdw_ROOT_DIR
|
||||
NAMES include/elfutils/libdw.h
|
||||
HINTS ${libdw_ROOT}
|
||||
PATHS ${libdw_ROOT})
|
||||
|
||||
mark_as_advanced(libdw_ROOT_DIR)
|
||||
|
||||
find_path(
|
||||
libdw_INCLUDE_DIR
|
||||
NAMES elfutils/libdw.h
|
||||
HINTS ${libdw_ROOT}
|
||||
PATHS ${libdw_ROOT}
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(
|
||||
libdw_LIBRARY
|
||||
NAMES dw
|
||||
HINTS ${libdw_ROOT}
|
||||
PATHS ${libdw_ROOT}
|
||||
PATH_SUFFIXES lib lib64)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(libdw DEFAULT_MSG libdw_LIBRARY libdw_INCLUDE_DIR)
|
||||
|
||||
if(libdw_FOUND AND NOT TARGET libdw::libdw)
|
||||
add_library(libdw::libdw INTERFACE IMPORTED)
|
||||
if(TARGET PkgConfig::DW AND DW_FOUND)
|
||||
target_link_libraries(libdw::libdw INTERFACE PkgConfig::DW)
|
||||
else()
|
||||
target_link_libraries(libdw::libdw INTERFACE ${libdw_LIBRARY})
|
||||
target_include_directories(libdw::libdw SYSTEM INTERFACE ${libdw_INCLUDE_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(pc-sampling-integration-test-client SHARED)
|
||||
target_sources(
|
||||
pc-sampling-integration-test-client
|
||||
@@ -104,7 +49,7 @@ target_sources(
|
||||
target_link_libraries(
|
||||
pc-sampling-integration-test-client
|
||||
PRIVATE rocprofiler-sdk::rocprofiler-sdk rocprofiler-sdk::tests-build-flags
|
||||
rocprofiler-sdk::tests-common-library amd_comgr dw)
|
||||
rocprofiler-sdk::tests-common-library)
|
||||
|
||||
set_source_files_properties(main.cpp PROPERTIES LANGUAGE HIP)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,11 +21,8 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import itertools
|
||||
import sys
|
||||
import pytest
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,8 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import json
|
||||
import os
|
||||
import pytest
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,8 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,8 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import csv
|
||||
import pytest
|
||||
import json
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,7 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import pytest
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,7 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import csv
|
||||
import json
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,7 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import pytest
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,7 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import json
|
||||
import os
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,7 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import pytest
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,7 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import json
|
||||
import os
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,7 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import itertools
|
||||
import sys
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,7 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import csv
|
||||
import json
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
|
||||
@@ -20,7 +21,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import pytest
|
||||
|
||||
@@ -22,74 +22,7 @@ project(
|
||||
LANGUAGES CXX HIP
|
||||
VERSION 0.0.0)
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
if(PkgConfig_FOUND)
|
||||
set(ENV{PKG_CONFIG_SYSTEM_INCLUDE_PATH} "")
|
||||
pkg_check_modules(DW libdw)
|
||||
|
||||
if(DW_FOUND
|
||||
AND DW_INCLUDE_DIRS
|
||||
AND DW_LIBRARIES)
|
||||
set(libdw_INCLUDE_DIR
|
||||
"${DW_INCLUDE_DIRS}"
|
||||
CACHE FILEPATH "libdw include directory")
|
||||
set(libdw_LIBRARY
|
||||
"${DW_LIBRARIES}"
|
||||
CACHE FILEPATH "libdw libraries")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT libdw_INCLUDE_DIR OR NOT libdw_LIBRARY)
|
||||
find_path(
|
||||
libdw_ROOT_DIR
|
||||
NAMES include/elfutils/libdw.h
|
||||
HINTS ${libdw_ROOT}
|
||||
PATHS ${libdw_ROOT})
|
||||
|
||||
mark_as_advanced(libdw_ROOT_DIR)
|
||||
|
||||
find_path(
|
||||
libdw_INCLUDE_DIR
|
||||
NAMES elfutils/libdw.h
|
||||
HINTS ${libdw_ROOT}
|
||||
PATHS ${libdw_ROOT}
|
||||
PATH_SUFFIXES include)
|
||||
|
||||
find_library(
|
||||
libdw_LIBRARY
|
||||
NAMES dw
|
||||
HINTS ${libdw_ROOT}
|
||||
PATHS ${libdw_ROOT}
|
||||
PATH_SUFFIXES lib lib64)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(libdw DEFAULT_MSG libdw_LIBRARY libdw_INCLUDE_DIR)
|
||||
|
||||
if(libdw_FOUND AND NOT TARGET libdw::libdw)
|
||||
add_library(libdw::libdw INTERFACE IMPORTED)
|
||||
if(TARGET PkgConfig::DW AND DW_FOUND)
|
||||
target_link_libraries(libdw::libdw INTERFACE PkgConfig::DW)
|
||||
else()
|
||||
target_link_libraries(libdw::libdw INTERFACE ${libdw_LIBRARY})
|
||||
target_include_directories(libdw::libdw SYSTEM INTERFACE ${libdw_INCLUDE_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(rocprofiler-sdk REQUIRED)
|
||||
find_package(
|
||||
amd_comgr
|
||||
REQUIRED
|
||||
CONFIG
|
||||
HINTS
|
||||
${rocm_version_DIR}
|
||||
${ROCM_PATH}
|
||||
PATHS
|
||||
${rocm_version_DIR}
|
||||
${ROCM_PATH}
|
||||
PATH_SUFFIXES
|
||||
lib/cmake/amd_comgr)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
@@ -104,10 +37,9 @@ foreach(_TYPE DEBUG MINSIZEREL RELEASE RELWITHDEBINFO)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set_source_files_properties(kernel_branch.cpp PROPERTIES COMPILE_FLAGS "-g -O2")
|
||||
set_source_files_properties(kernel_branch.cpp PROPERTIES LANGUAGE HIP)
|
||||
set_source_files_properties(kernel_lds.cpp PROPERTIES COMPILE_FLAGS "-g -O2")
|
||||
set_source_files_properties(kernel_lds.cpp PROPERTIES LANGUAGE HIP)
|
||||
set_source_files_properties(
|
||||
kernel_branch.cpp kernel_lds.cpp
|
||||
PROPERTIES LANGUAGE HIP COMPILE_FLAGS "${CMAKE_HIP_FLAGS_RELWITHDEBINFO}")
|
||||
set_source_files_properties(main.cpp PROPERTIES LANGUAGE HIP)
|
||||
|
||||
# Single dispatch test
|
||||
@@ -115,8 +47,10 @@ add_executable(thread-trace-api-single-test)
|
||||
target_sources(
|
||||
thread-trace-api-single-test PRIVATE main.cpp trace_callbacks.cpp single_dispatch.cpp
|
||||
kernel_branch.cpp kernel_lds.cpp)
|
||||
target_link_libraries(thread-trace-api-single-test
|
||||
PRIVATE rocprofiler-sdk::rocprofiler-sdk)
|
||||
target_link_libraries(
|
||||
thread-trace-api-single-test
|
||||
PRIVATE rocprofiler-sdk::rocprofiler-sdk rocprofiler-sdk::tests-build-flags
|
||||
rocprofiler-sdk::tests-common-library)
|
||||
|
||||
add_test(NAME thread-trace-api-single-test
|
||||
COMMAND $<TARGET_FILE:thread-trace-api-single-test>)
|
||||
@@ -132,8 +66,10 @@ add_executable(thread-trace-api-multi-test)
|
||||
target_sources(
|
||||
thread-trace-api-multi-test PRIVATE main.cpp trace_callbacks.cpp multi_dispatch.cpp
|
||||
kernel_branch.cpp kernel_lds.cpp)
|
||||
target_link_libraries(thread-trace-api-multi-test
|
||||
PRIVATE rocprofiler-sdk::rocprofiler-sdk)
|
||||
target_link_libraries(
|
||||
thread-trace-api-multi-test
|
||||
PRIVATE rocprofiler-sdk::rocprofiler-sdk rocprofiler-sdk::tests-build-flags
|
||||
rocprofiler-sdk::tests-common-library)
|
||||
|
||||
add_test(NAME thread-trace-api-multi-test
|
||||
COMMAND $<TARGET_FILE:thread-trace-api-multi-test>)
|
||||
@@ -148,8 +84,10 @@ set_tests_properties(
|
||||
add_executable(thread-trace-api-agent-test)
|
||||
target_sources(thread-trace-api-agent-test PRIVATE main.cpp trace_callbacks.cpp agent.cpp
|
||||
kernel_branch.cpp kernel_lds.cpp)
|
||||
target_link_libraries(thread-trace-api-agent-test
|
||||
PRIVATE rocprofiler-sdk::rocprofiler-sdk)
|
||||
target_link_libraries(
|
||||
thread-trace-api-agent-test
|
||||
PRIVATE rocprofiler-sdk::rocprofiler-sdk rocprofiler-sdk::tests-build-flags
|
||||
rocprofiler-sdk::tests-common-library)
|
||||
|
||||
add_test(NAME thread-trace-api-agent-test
|
||||
COMMAND $<TARGET_FILE:thread-trace-api-agent-test>)
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
};
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
main(int /*argc*/, char** /*argv*/)
|
||||
{
|
||||
hipMemory src1(DATA_SIZE);
|
||||
hipMemory src2(DATA_SIZE);
|
||||
|
||||
Viittaa uudesa ongelmassa
Block a user