2023-08-22 13:29:11 -05:00
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#
|
2023-09-21 14:35:20 -05:00
|
|
|
rocprofiler_activate_clang_tidy()
|
|
|
|
|
|
2023-11-13 22:30:15 -06:00
|
|
|
set(ROCPROFILER_LIB_HEADERS agent.hpp allocator.hpp buffer.hpp external_correlation.hpp
|
2023-11-02 19:10:10 -05:00
|
|
|
intercept_table.hpp internal_threading.hpp registration.hpp)
|
2023-09-20 19:32:02 -05:00
|
|
|
set(ROCPROFILER_LIB_SOURCES
|
2023-09-22 13:51:21 -05:00
|
|
|
agent.cpp
|
2023-11-13 22:30:15 -06:00
|
|
|
allocator.cpp
|
2023-09-22 13:51:21 -05:00
|
|
|
buffer.cpp
|
|
|
|
|
buffer_tracing.cpp
|
|
|
|
|
callback_tracing.cpp
|
|
|
|
|
context.cpp
|
2023-10-16 13:41:40 -07:00
|
|
|
counters.cpp
|
|
|
|
|
dispatch_profile.cpp
|
2023-10-18 13:59:41 -05:00
|
|
|
external_correlation.cpp
|
2023-11-02 19:10:10 -05:00
|
|
|
intercept_table.cpp
|
2023-09-22 13:51:21 -05:00
|
|
|
internal_threading.cpp
|
|
|
|
|
pc_sampling.cpp
|
2023-10-16 13:41:40 -07:00
|
|
|
profile_config.cpp
|
2023-09-22 13:51:21 -05:00
|
|
|
rocprofiler.cpp
|
|
|
|
|
registration.cpp)
|
2023-08-08 18:39:01 -05:00
|
|
|
|
2023-09-21 18:01:20 -05:00
|
|
|
# ----------------------------------------------------------------------------------------#
|
|
|
|
|
#
|
|
|
|
|
# object library allows us to compile rocprofiler code once and generate both a shared and
|
|
|
|
|
# static library
|
|
|
|
|
#
|
|
|
|
|
# ----------------------------------------------------------------------------------------#
|
2023-08-08 18:39:01 -05:00
|
|
|
|
2023-09-21 18:01:20 -05:00
|
|
|
add_library(rocprofiler-object-library OBJECT)
|
|
|
|
|
add_library(rocprofiler::rocprofiler-object-library ALIAS rocprofiler-object-library)
|
|
|
|
|
|
|
|
|
|
target_sources(rocprofiler-object-library PRIVATE ${ROCPROFILER_LIB_SOURCES}
|
|
|
|
|
${ROCPROFILER_LIB_HEADERS})
|
2023-08-08 18:39:01 -05:00
|
|
|
|
|
|
|
|
add_subdirectory(hsa)
|
2023-09-20 19:32:02 -05:00
|
|
|
add_subdirectory(context)
|
2023-09-26 11:50:57 -07:00
|
|
|
add_subdirectory(counters)
|
2023-10-16 13:41:40 -07:00
|
|
|
add_subdirectory(aql)
|
2023-10-26 12:14:02 -03:00
|
|
|
add_subdirectory(pc_sampling)
|
2023-08-08 18:39:01 -05:00
|
|
|
|
|
|
|
|
target_link_libraries(
|
2023-09-21 18:01:20 -05:00
|
|
|
rocprofiler-object-library
|
2023-08-22 13:29:11 -05:00
|
|
|
PUBLIC rocprofiler::rocprofiler-headers rocprofiler::rocprofiler-hsa-runtime
|
|
|
|
|
rocprofiler::rocprofiler-hip
|
2023-11-28 10:04:37 -06:00
|
|
|
PRIVATE rocprofiler::rocprofiler-build-flags
|
|
|
|
|
rocprofiler::rocprofiler-memcheck
|
|
|
|
|
rocprofiler::rocprofiler-common-library
|
|
|
|
|
rocprofiler::rocprofiler-cxx-filesystem
|
|
|
|
|
rocprofiler::rocprofiler-dl
|
|
|
|
|
rocprofiler::rocprofiler-amd-comgr)
|
2023-08-22 13:29:11 -05:00
|
|
|
|
2023-09-21 18:01:20 -05:00
|
|
|
target_compile_definitions(rocprofiler-object-library PRIVATE rocprofiler_EXPORTS=1)
|
|
|
|
|
|
|
|
|
|
set_target_properties(rocprofiler-object-library PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------------#
|
|
|
|
|
#
|
|
|
|
|
# shared library
|
|
|
|
|
#
|
|
|
|
|
# ----------------------------------------------------------------------------------------#
|
|
|
|
|
|
|
|
|
|
add_library(rocprofiler-shared-library SHARED)
|
|
|
|
|
add_library(rocprofiler::rocprofiler-shared-library ALIAS rocprofiler-shared-library)
|
|
|
|
|
|
|
|
|
|
target_sources(rocprofiler-shared-library
|
|
|
|
|
PRIVATE $<TARGET_OBJECTS:rocprofiler::rocprofiler-object-library>)
|
|
|
|
|
target_link_libraries(
|
|
|
|
|
rocprofiler-shared-library
|
|
|
|
|
INTERFACE rocprofiler::rocprofiler-headers rocprofiler::rocprofiler-hsa-runtime
|
|
|
|
|
rocprofiler::rocprofiler-hip
|
2023-10-16 13:41:40 -07:00
|
|
|
PRIVATE rocprofiler::rocprofiler-build-flags
|
|
|
|
|
rocprofiler::rocprofiler-memcheck
|
|
|
|
|
rocprofiler::rocprofiler-common-library
|
2023-11-28 10:04:37 -06:00
|
|
|
rocprofiler::rocprofiler-cxx-filesystem
|
2023-10-16 13:41:40 -07:00
|
|
|
rocprofiler::rocprofiler-dl
|
|
|
|
|
rocprofiler::rocprofiler-amd-comgr
|
|
|
|
|
rocprofiler::rocprofiler-object-library)
|
2023-09-21 18:01:20 -05:00
|
|
|
|
2023-08-08 18:39:01 -05:00
|
|
|
set_target_properties(
|
2023-09-21 18:01:20 -05:00
|
|
|
rocprofiler-shared-library
|
2023-11-29 20:43:18 -06:00
|
|
|
PROPERTIES OUTPUT_NAME rocprofiler-sdk
|
2023-08-08 18:39:01 -05:00
|
|
|
SOVERSION ${PROJECT_VERSION_MAJOR}
|
2023-08-24 15:39:56 -07:00
|
|
|
VERSION ${PROJECT_VERSION}
|
2023-09-21 18:01:20 -05:00
|
|
|
SKIP_BUILD_RPATH OFF
|
|
|
|
|
BUILD_RPATH "\$ORIGIN"
|
2023-09-21 10:07:07 -05:00
|
|
|
INSTALL_RPATH "\$ORIGIN"
|
2023-08-24 15:39:56 -07:00
|
|
|
DEFINE_SYMBOL rocprofiler_EXPORTS)
|
2023-09-21 10:07:07 -05:00
|
|
|
|
2023-09-21 18:01:20 -05:00
|
|
|
add_library(rocprofiler::rocprofiler-library ALIAS rocprofiler-shared-library)
|
|
|
|
|
|
2023-09-21 10:07:07 -05:00
|
|
|
install(
|
2023-09-21 18:01:20 -05:00
|
|
|
TARGETS rocprofiler-shared-library
|
2023-09-21 10:07:07 -05:00
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
|
COMPONENT core
|
2023-11-29 20:43:18 -06:00
|
|
|
EXPORT rocprofiler-sdk-library-targets)
|
2023-09-21 18:01:20 -05:00
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------------#
|
|
|
|
|
#
|
|
|
|
|
# static library (only built if another target links to it)
|
|
|
|
|
#
|
|
|
|
|
# ----------------------------------------------------------------------------------------#
|
|
|
|
|
|
|
|
|
|
add_library(rocprofiler-static-library EXCLUDE_FROM_ALL STATIC)
|
|
|
|
|
add_library(rocprofiler::rocprofiler-static-library ALIAS rocprofiler-static-library)
|
|
|
|
|
|
|
|
|
|
target_sources(rocprofiler-static-library
|
|
|
|
|
PRIVATE $<TARGET_OBJECTS:rocprofiler::rocprofiler-object-library>)
|
|
|
|
|
target_link_libraries(
|
|
|
|
|
rocprofiler-static-library
|
|
|
|
|
PUBLIC rocprofiler::rocprofiler-headers rocprofiler::rocprofiler-hsa-runtime
|
|
|
|
|
rocprofiler::rocprofiler-hip
|
2023-10-16 13:41:40 -07:00
|
|
|
PRIVATE rocprofiler::rocprofiler-common-library
|
|
|
|
|
rocprofiler::rocprofiler-object-library)
|
2023-09-21 18:01:20 -05:00
|
|
|
|
|
|
|
|
set_target_properties(
|
2023-11-29 20:43:18 -06:00
|
|
|
rocprofiler-static-library PROPERTIES OUTPUT_NAME rocprofiler-sdk DEFINE_SYMBOL
|
|
|
|
|
rocprofiler_EXPORTS)
|
2023-09-26 19:21:31 -05:00
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------------#
|
|
|
|
|
#
|
|
|
|
|
# testing
|
|
|
|
|
#
|
|
|
|
|
# ----------------------------------------------------------------------------------------#
|
|
|
|
|
|
|
|
|
|
if(ROCPROFILER_BUILD_TESTS)
|
|
|
|
|
add_subdirectory(tests)
|
|
|
|
|
endif()
|