mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
In commit8514ee9b31(HIP: analyze output of `hipcc` to determine default GPU architecture, 2021-05-27, v3.21.0-rc1~66^2) we dropped these from most tests, but missed `HIP.TryCompile`. Since commit735f41fc2d(HIP: Use 'rocm_agent_enumerator' to determine CMAKE_HIP_ARCHITECTURES, 2021-09-15, v3.21.3~1^2~3) we automatically select architectures anyway.
15 lines
525 B
CMake
15 lines
525 B
CMake
cmake_minimum_required(VERSION 3.18)
|
|
project (TryCompile HIP)
|
|
|
|
#Goal for this example:
|
|
# Verify try_compile with HIP language works
|
|
set(CMAKE_HIP_STANDARD 14)
|
|
|
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
|
try_compile(result "${CMAKE_CURRENT_BINARY_DIR}"
|
|
SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/device_function.hip"
|
|
COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/device_function.o")
|
|
|
|
add_executable(HIPOnlyTryCompile main.hip)
|
|
target_link_libraries(HIPOnlyTryCompile "${CMAKE_CURRENT_BINARY_DIR}/device_function.o")
|