Skip to content
Draft
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
10 changes: 7 additions & 3 deletions projects/rocprofiler-sdk/cmake/Templates/unit-test.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ set_tests_properties(
SKIP_REGULAR_EXPRESSION
"${_SKIP_REGEX}"
ENVIRONMENT
"${_ENVIRONMENT}"
DISABLED
"${_DISABLED}")
"${_ENVIRONMENT}")

if(_DISABLED)
set_tests_properties(
${@RAUT_TARGET@_TESTS}
PROPERTIES DISABLED "${_DISABLED}")
endif()

# Disable specific tests
set(_DISABLE_TESTS "@RAUT_DISABLE_TESTS@")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ target_include_directories(
rocprofiler-sdk-headers
INTERFACE $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/source/include>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source/include>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/source>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

Expand Down Expand Up @@ -223,13 +224,18 @@ target_link_libraries(rocprofiler-sdk-dw INTERFACE libdw::libdw)
#
# ----------------------------------------------------------------------------------------#

find_library(
hsa-amd-aqlprofile64_library
NAMES hsa-amd-aqlprofile64 hsa-amd-aqlprofile
HINTS ${rocm_version_DIR} ${ROCM_PATH}
PATHS ${rocm_version_DIR} ${ROCM_PATH})

target_link_libraries(rocprofiler-sdk-hsa-aql INTERFACE ${hsa-amd-aqlprofile64_library})
if(NOT ROCPROFILER_BUILD_AQLPROFILE)
find_library(
hsa-amd-aqlprofile64_library
NAMES hsa-amd-aqlprofile64 hsa-amd-aqlprofile REQUIRED
HINTS ${rocm_version_DIR} ${ROCM_PATH}
PATHS ${rocm_version_DIR} ${ROCM_PATH})

target_compile_definitions(rocprofiler-sdk-aqlprofile-external
INTERFACE ROCPROFILER_EXTERNAL_AQLPROFILE=1)
target_link_libraries(rocprofiler-sdk-aqlprofile-external
INTERFACE ${hsa-amd-aqlprofile64_library})
endif()

# ----------------------------------------------------------------------------------------#
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ rocprofiler_add_interface_library(rocprofiler-sdk-hip "HIP library" INTERNAL)
rocprofiler_add_interface_library(rocprofiler-sdk-hsa-runtime "HSA runtime library"
INTERNAL)
rocprofiler_add_interface_library(rocprofiler-sdk-amd-comgr "AMD comgr library" INTERNAL)
rocprofiler_add_interface_library(rocprofiler-sdk-hsa-aql "AQL library" INTERNAL)
rocprofiler_add_interface_library(rocprofiler-sdk-aqlprofile-external
"(External) AQL library" INTERNAL)
rocprofiler_add_interface_library(rocprofiler-sdk-hsakmt
"HSAKMT library for AMD KFD support" INTERNAL)
rocprofiler_add_interface_library(rocprofiler-sdk-drm "drm (amdgpu) library" INTERNAL)
Expand Down
3 changes: 3 additions & 0 deletions projects/rocprofiler-sdk/cmake/rocprofiler_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ rocprofiler_add_option(
ADVANCED)
rocprofiler_add_option(ROCPROFILER_BUILD_DEPRECATED_WARNINGS
"Enable warnings for use of deprecated features" OFF ADVANCED)
rocprofiler_add_option(
ROCPROFILER_BUILD_AQLPROFILE
"Enable building with internal AQLProfile library (recommended)" ON ADVANCED)

# In the future, we will do this even with clang-tidy enabled
foreach(_OPT ROCPROFILER_BUILD_WERROR)
Expand Down
17 changes: 14 additions & 3 deletions projects/rocprofiler-sdk/cmake/rocprofiler_utilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,15 @@ function(rocprofiler_add_unit_test)
set_arg_if_empty(RAUT_DISABLED "OFF")
set_arg_if_empty(RAUT_TEST_PREFIX "unit.")

# Ensure test prefix starts with 'unit.' and ends with '.'
if(NOT RAUT_TEST_PREFIX MATCHES "^unit\\.")
set(RAUT_TEST_PREFIX "unit.${RAUT_TEST_PREFIX}")
endif()

if(NOT RAUT_TEST_PREFIX MATCHES "\\.$")
set(RAUT_TEST_PREFIX "${RAUT_TEST_PREFIX}.")
endif()

set(_DISABLE_TESTS_SOURCE "")
if(RAUT_DISABLE_TESTS)
foreach(_TEST ${RAUT_DISABLE_TESTS})
Expand Down Expand Up @@ -1110,9 +1119,11 @@ function(rocprofiler_add_unit_test)
SKIP_REGULAR_EXPRESSION
"${RAUT_SKIP_REGULAR_EXPRESSION}"
ENVIRONMENT
"${RAUT_ENVIRONMENT}"
DISABLED
${RAUT_DISABLED})
"${RAUT_ENVIRONMENT}")

if(${RAUT_DISABLED})
set_tests_properties(${${RAUT_TEST_LIST}} PROPERTIES DISABLED ${RAUT_DISABLED})
endif()

if(_DISABLE_TESTS_SOURCE)
set_tests_properties(${_DISABLE_TESTS_SOURCE} PROPERTIES DISABLED ON)
Expand Down
6 changes: 4 additions & 2 deletions projects/rocprofiler-sdk/external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if(ROCPROFILER_BUILD_TESTS)
REPO_URL https://github.com/google/googletest.git
REPO_BRANCH "main")

set(BUILD_GMOCK OFF)
set(BUILD_GMOCK ON)
set(INSTALL_GTEST OFF)
add_subdirectory(googletest EXCLUDE_FROM_ALL)

Expand All @@ -58,7 +58,8 @@ if(ROCPROFILER_BUILD_TESTS)
target_link_libraries(rocprofiler-sdk-gtest INTERFACE GTest::gtest)
target_include_directories(
rocprofiler-sdk-gtest SYSTEM
INTERFACE ${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/include)
INTERFACE ${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/include
${CMAKE_CURRENT_LIST_DIR}/googlemock/googlemock/include)

mark_as_advanced(INSTALL_GTEST)
mark_as_advanced(BUILD_GMOCK)
Expand Down Expand Up @@ -104,6 +105,7 @@ if(ROCPROFILER_BUILD_FMT)
REPO_BRANCH "master")

set(FMT_TEST OFF)
set(FMT_DEBUG_POSTFIX "")
add_subdirectory(fmt EXCLUDE_FROM_ALL)

target_link_libraries(rocprofiler-sdk-fmt INTERFACE $<BUILD_INTERFACE:fmt::fmt>)
Expand Down
1 change: 1 addition & 0 deletions projects/rocprofiler-sdk/source/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ rocprofiler_activate_clang_tidy()
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "core")
add_subdirectory(common)
add_subdirectory(output)
add_subdirectory(aqlprofile)
add_subdirectory(rocprofiler-sdk)
add_subdirectory(rocprofiler-sdk-attach)

Expand Down
38 changes: 38 additions & 0 deletions projects/rocprofiler-sdk/source/lib/aqlprofile/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# Build static AQLProfile library
#

if(NOT ROCPROFILER_BUILD_AQLPROFILE)
rocprofiler_add_interface_library(
rocprofiler-sdk-aqlprofile "Interface library to external AQLProfile library"
INTERNAL)
target_link_libraries(
rocprofiler-sdk-aqlprofile
INTERFACE $<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-aqlprofile-external>)
return()
endif()

rocprofiler_deactivate_clang_tidy()

configure_file(${CMAKE_CURRENT_LIST_DIR}/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)

add_library(rocprofiler-sdk-aqlprofile STATIC)
add_library(rocprofiler-sdk::rocprofiler-sdk-aqlprofile ALIAS rocprofiler-sdk-aqlprofile)
target_link_libraries(
rocprofiler-sdk-aqlprofile
PRIVATE $<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-headers>
# $<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-build-flags>
$<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-threading>
$<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-memcheck>
$<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-cxx-filesystem>
$<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-glog>
$<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-fmt>
$<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-dl>
$<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-atomic>
$<BUILD_INTERFACE:rocprofiler-sdk::rocprofiler-sdk-hsa-runtime-nolink>)
set_target_properties(rocprofiler-sdk-aqlprofile PROPERTIES POSITION_INDEPENDENT_CODE ON)

add_subdirectory(core)
add_subdirectory(util)
add_subdirectory(pm4)
Loading
Loading