mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-06-08 15:30:23 +00:00
30 lines
1.4 KiB
CMake
30 lines
1.4 KiB
CMake
option(USE_HIPRTC_FOR_CODEGEN_TESTS "Whether to enable hipRTC for codegen tests." ON)
|
|
|
|
if(USE_HIPRTC_FOR_CODEGEN_TESTS)
|
|
add_compile_definitions(HIPRTC_FOR_CODEGEN_TESTS)
|
|
message("CK compiled with USE_HIPRTC_FOR_CODEGEN_TESTS set to ${USE_HIPRTC_FOR_CODEGEN_TESTS}")
|
|
endif()
|
|
|
|
list(APPEND CMAKE_PREFIX_PATH /opt/rocm)
|
|
add_subdirectory(rtc)
|
|
file(GLOB TEST_SRCS CONFIGURE_DEPENDS *.cpp)
|
|
if(NOT INSTANCES_ONLY)
|
|
foreach(TEST_SRC ${TEST_SRCS})
|
|
set_source_files_properties(${TEST_SRC} PROPERTIES LANGUAGE HIP)
|
|
get_filename_component(BASE_NAME ${TEST_SRC} NAME_WE)
|
|
add_executable(codegen_test_${BASE_NAME} ${TEST_SRC})
|
|
if(CK_USE_ALTERNATIVE_PYTHON)
|
|
target_link_options(codegen_test_${BASE_NAME} PRIVATE -lstdc++fs)
|
|
endif()
|
|
add_dependencies(codegen codegen_test_${BASE_NAME})
|
|
add_dependencies(tests codegen_test_${BASE_NAME})
|
|
add_dependencies(check codegen_test_${BASE_NAME})
|
|
add_test(NAME codegen_test_${BASE_NAME} COMMAND codegen_test_${BASE_NAME})
|
|
message("adding test codegen_test_${BASE_NAME}")
|
|
target_link_libraries(codegen_test_${BASE_NAME} ck_rtc ck_host)
|
|
target_include_directories(codegen_test_${BASE_NAME} PUBLIC ${CK_ROOT}/codegen/test/include)
|
|
target_include_directories(codegen_test_${BASE_NAME} PUBLIC ${CK_ROOT}/include)
|
|
target_include_directories(codegen_test_${BASE_NAME} PUBLIC ${CK_ROOT}/library/include)
|
|
endforeach()
|
|
endif()
|