hsa: check for clang -target hsail64
@@ -32,8 +32,17 @@ else()
if(RESULT)
message(FATAL_ERROR "LLVM support for amdgcn--amdhsa target is required")
endif()
+ # test that Clang supports the hsail64 target
+ message(CHECK_START "Check if Clang accepts -target hsail64")
+ custom_try_compile_clangxx("" "return 0;" RESULT "-target" "hsail64" "-emit-llvm" "-S")
+ if(RESULT)
+ message(CHECK_FAIL "no")
+ set(HSAIL_ENABLED 0)
+ else()
+ message(CHECK_PASS "yes")
set(HSAIL_ENABLED 1)
endif()
+endif()
if (NOT DEFINED AMD_HSA)
set(AMD_HSA 1)
