Files
rocm-systems/samples/code_object_isa_decode/CMakeLists.txt
T

54 строки
1.8 KiB
CMake
Исходник Обычный вид История

2024-04-08 16:43:02 -03:00
#
#
#
cmake_minimum_required(VERSION 3.21.0 FATAL_ERROR)
if(NOT CMAKE_HIP_COMPILER)
find_program(
amdclangpp_EXECUTABLE
NAMES amdclang++
HINTS ${ROCM_PATH} ENV ROCM_PATH /opt/rocm
PATHS ${ROCM_PATH} ENV ROCM_PATH /opt/rocm
PATH_SUFFIXES bin llvm/bin NO_CACHE)
mark_as_advanced(amdclangpp_EXECUTABLE)
if(amdclangpp_EXECUTABLE)
set(CMAKE_HIP_COMPILER "${amdclangpp_EXECUTABLE}")
endif()
endif()
project(rocprofiler-sdk-samples-code-object-isa-decode LANGUAGES CXX HIP)
foreach(_TYPE DEBUG MINSIZEREL RELEASE RELWITHDEBINFO)
if("${CMAKE_HIP_FLAGS_${_TYPE}}" STREQUAL "")
set(CMAKE_HIP_FLAGS_${_TYPE} "${CMAKE_CXX_FLAGS_${_TYPE}}")
endif()
endforeach()
find_package(rocprofiler-sdk REQUIRED)
2024-05-03 18:45:47 -03:00
find_package(amd_comgr REQUIRED)
2024-04-08 16:43:02 -03:00
2024-05-03 18:45:47 -03:00
add_library(code-object-isa-decode-client SHARED)
target_sources(code-object-isa-decode-client PRIVATE client.cpp)
2024-04-08 16:43:02 -03:00
set_source_files_properties(main.cpp PROPERTIES LANGUAGE HIP)
set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS "-g")
target_link_libraries(
2024-05-03 18:45:47 -03:00
code-object-isa-decode-client
PRIVATE rocprofiler::samples-common-library rocprofiler-sdk-codeobj
rocprofiler::rocprofiler amd_comgr dw)
rocprofiler_samples_get_preload_env(PRELOAD_ENV code-object-isa-decode-client)
add_executable(code-object-isa-decode)
target_sources(code-object-isa-decode PRIVATE main.cpp)
target_link_libraries(code-object-isa-decode PRIVATE code-object-isa-decode-client
rocprofiler::samples-build-flags)
2024-04-08 16:43:02 -03:00
add_test(NAME code-object-isa-decode COMMAND $<TARGET_FILE:code-object-isa-decode>)
set_tests_properties(
code-object-isa-decode
2024-05-03 18:45:47 -03:00
PROPERTIES TIMEOUT 45 LABELS "samples" ENVIRONMENT "${PRELOAD_ENV}"
FAIL_REGULAR_EXPRESSION "threw an exception")