7647f6988f
V1 library will be supported as librocprofiler64.so and V2 will be supported as librocprofiler64v2.so and headers will be rocprofiler.h for V1 and v2/rocprofiler.h for v2
Change-Id: Ibe5bdbf2f79f0175342c648e917ae77918186604
[ROCm/rocprofiler commit: 9e62e066fe]
54 líneas
2.4 KiB
CMake
54 líneas
2.4 KiB
CMake
# ############################################################################################################################################
|
|
# ROCMTOOL Tool
|
|
# ############################################################################################################################################
|
|
# Setting Default Binary output directory
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
|
|
|
# Getting Source files for ROCProfiler Tool
|
|
file(GLOB ROCPROFILER_TOOL_SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/tool.cpp)
|
|
file(GLOB ROCPROFILER_UTIL_SRC_FILES ${PROJECT_SOURCE_DIR}/src/utils/helper.cpp)
|
|
|
|
# Compiling/Installing ROCProfiler API
|
|
add_library(rocprofiler_tool SHARED ${ROCPROFILER_TOOL_SRC_FILES} ${ROCPROFILER_UTIL_SRC_FILES})
|
|
|
|
set_target_properties(rocprofiler_tool PROPERTIES
|
|
CXX_VISIBILITY_PRESET hidden
|
|
LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/exportmap)
|
|
|
|
target_include_directories(rocprofiler_tool
|
|
PRIVATE
|
|
${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
|
|
${PROJECT_SOURCE_DIR}/src)
|
|
|
|
target_compile_definitions(rocprofiler_tool
|
|
PRIVATE HIP_PROF_HIP_API_STRING=1 __HIP_PLATFORM_HCC__=1)
|
|
|
|
if(ASAN)
|
|
target_compile_options(rocprofiler_tool PRIVATE -fsanitize=address)
|
|
target_link_libraries(rocprofiler_tool rocprofiler-v2 hsa-runtime64::hsa-runtime64 Threads::Threads atomic asan dl rt stdc++fs amd_comgr)
|
|
target_link_options(rocprofiler_tool PRIVATE -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exportmap -Wl,--no-undefined,-fsanitize=address)
|
|
else()
|
|
target_link_libraries(rocprofiler_tool rocprofiler-v2 hsa-runtime64::hsa-runtime64 Threads::Threads atomic dl rt stdc++fs amd_comgr)
|
|
target_link_options(rocprofiler_tool PRIVATE -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exportmap -Wl,--no-undefined)
|
|
endif()
|
|
|
|
install(TARGETS rocprofiler_tool LIBRARY
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
COMPONENT runtime)
|
|
install(TARGETS rocprofiler_tool LIBRARY
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
COMPONENT asan)
|
|
|
|
add_subdirectory(amdsys)
|
|
add_subdirectory(rocprofv2)
|
|
|
|
add_executable(ctrl ctrl.cpp)
|
|
target_link_options(rocprofiler_tool PRIVATE -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exportmap -Wl,--no-undefined)
|
|
target_link_libraries(ctrl PRIVATE rocprofiler-v2 hsa-runtime64::hsa-runtime64)
|
|
install(TARGETS ctrl RUNTIME
|
|
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/rocprofiler
|
|
COMPONENT runtime)
|
|
|
|
|
|
# ############################################################################################################################################
|