From a1a6704f96f47e262e274d4d0c95b44693101c2d Mon Sep 17 00:00:00 2001 From: Andreas Beckmann Date: Tue, 30 Nov 2021 14:15:21 +0100 Subject: [PATCH] [PATCH 106/144] hsa: check for clang -target amdgcn--amdhsa -nogpulib Gbp-Pq: Name 0106-hsa-check-for-clang-target-amdgcn-amdhsa-nogpulib.patch --- cmake/HSA.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmake/HSA.cmake b/cmake/HSA.cmake index 4381461..aba2721 100644 --- a/cmake/HSA.cmake +++ b/cmake/HSA.cmake @@ -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(FATAL_ERROR "LLVM support for amdgcn--amdhsa target is required") + 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") -- 2.30.2