From f7a7997c66c0a9e5312e30d66e0fd5d08705510d Mon Sep 17 00:00:00 2001 From: Cordell Bloor Date: Wed, 15 Mar 2023 18:06:18 -0600 Subject: [PATCH] SWDEV-346940 - Remove default AMDGPU_TARGETS hipcc and clang++ both have logic to detect the installed hardware and to automatically select the appropriate AMDGPU target when it is left unspecified. When the AMDGPU_TARGETS property is initialized with a set of default values, it results in the addition of an explicit set of --offload-arch flags being passed. These explicit architecture flags disable the architecture autodetection in the compiler. The resulting behaviour from setting fixed defaults makes it unpleasant to compile with CMake because they increase the build times for projects unless they are overriden (as most users do not need to build for all five default architectures). The fixed defaults are also troublesome for users with hardware not included in the default set (e.g., gfx1011, gfx1031, gfx1100). A possible alternative might be to detect the architecture within hip-config.cmake rather than running the detection logic on each compiler invocation. However, this approach is simpler. Change-Id: I9495d766b7eed03852eb4dc72b0aabe4100bc32c Signed-off-by: Cordell Bloor [ROCm/clr commit: e1bed6f3548f36b5a9879fcc042750ee9179b685] --- projects/clr/hipamd/hip-config.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/clr/hipamd/hip-config.cmake.in b/projects/clr/hipamd/hip-config.cmake.in index 537a599244..984dd1034c 100755 --- a/projects/clr/hipamd/hip-config.cmake.in +++ b/projects/clr/hipamd/hip-config.cmake.in @@ -158,7 +158,7 @@ if(HIP_COMPILER STREQUAL "clang") if(NOT WIN32) find_dependency(AMDDeviceLibs) endif() - set(AMDGPU_TARGETS "gfx900;gfx906;gfx908;gfx90a;gfx1030" CACHE STRING "AMD GPU targets to compile for") + set(AMDGPU_TARGETS "" CACHE STRING "AMD GPU targets to compile for") set(GPU_TARGETS "${AMDGPU_TARGETS}" CACHE STRING "GPU targets to compile for") endif() # HIP_COMPILER check