hsa: check for clang -target amdgcn--amdhsa -nogpulib
@@ -28,9 +28,20 @@ if (DEFINED ENABLE_HSAIL AND NOT ENABLE_HSAIL)
else()
message(STATUS "Trying HSA support in LLVM")
# test that Clang supports the amdgcn--amdhsa target
+ message(CHECK_START "Check if Clang accepts -target amdgcn--amdhsa")
custom_try_compile_clangxx("" "return 0;" RESULT "-target" "amdgcn--amdhsa" "-emit-llvm" "-S")
if(RESULT)
+ message(CHECK_FAIL "no")
+ message(CHECK_START "Check if Clang accepts -target amdgcn--amdhsa -nogpulib")
+ custom_try_compile_clangxx("" "return 0;" RESULT "-target" "amdgcn--amdhsa" "-nogpulib" "-emit-llvm" "-S")
+ if(RESULT)
+ message(CHECK_FAIL "no")
message(FATAL_ERROR "LLVM support for amdgcn--amdhsa target is required")
+ else()
+ message(CHECK_PASS "yes")
+ endif()
+ else()
+ message(CHECK_PASS "yes")
endif()
# test that Clang supports the hsail64 target
message(CHECK_START "Check if Clang accepts -target hsail64")
