From e8af0eba402b90f8af7b0cc24918b4706d0d02d2 Mon Sep 17 00:00:00 2001 From: Lauren Wrubleski Date: Tue, 29 Oct 2024 14:47:49 -0600 Subject: [PATCH 1/2] Change CMake to respect GPU_TARGETS variable --- CMakeLists.txt | 2 ++ src/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1946c44..6af955c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,8 @@ else() ) endif() set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target") +# Don't force, as users should be able to override GPU_TARGETS at the command line if desired +set(GPU_TARGETS "${AMDGPU_TARGETS}" CACHE STRING "GPU architectures to build for") include(CheckLanguage) include(CMakeDependentOption) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c67b713..1587d9e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -183,7 +183,7 @@ if(SUPPORT_HIP) if((${CMAKE_BUILD_TYPE} MATCHES "Release") OR (${CMAKE_BUILD_TYPE} MATCHES "RelWithDebInfo")) list(APPEND HIP_HIPCC_FLAGS "-DNDEBUG") endif() - foreach(target ${AMDGPU_TARGETS}) + foreach(target ${GPU_TARGETS}) list(APPEND HIP_HIPCC_FLAGS "--offload-arch=${target}") endforeach() From 7b07828eae9715a553f75f591c1db03348265c1e Mon Sep 17 00:00:00 2001 From: Lauren Wrubleski Date: Thu, 16 Jan 2025 14:39:38 -0700 Subject: [PATCH 2/2] Add deprecation message for AMDGPU_TARGETS --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6af955c..e5f0c10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,8 +108,11 @@ else() gfx1201 ) endif() -set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target") -# Don't force, as users should be able to override GPU_TARGETS at the command line if desired +if(AMDGPU_TARGETS AND NOT GPU_TARGETS) + message( DEPRECATION "AMDGPU_TARGETS use is deprecated. Use GPU_TARGETS." ) +endif() +set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "Target default GPUs if AMDGPU_TARGETS is not defined. (Deprecated, prefer GPU_TARGETS)") +# Don't force, users should be able to override GPU_TARGETS at the command line if desired set(GPU_TARGETS "${AMDGPU_TARGETS}" CACHE STRING "GPU architectures to build for") include(CheckLanguage)