From 5b120289fccd17659dd4a11a98a6077f5479b640 Mon Sep 17 00:00:00 2001 From: Lauren Wrubleski Date: Tue, 29 Oct 2024 14:44:12 -0600 Subject: [PATCH] Change CMake to respect GPU_TARGETS variable --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b488443..59402c81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,7 +148,10 @@ else() set(AMDGPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "List of specific machine types for library to target") endif() - message(STATUS "AMDGPU_TARGETS: ${AMDGPU_TARGETS}") + # 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") + + message(STATUS "GPU_TARGETS: ${GPU_TARGETS}") if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) find_package( hip REQUIRED CONFIG PATHS ${HIP_DIR} ${ROCM_PATH} /opt/rocm ) @@ -158,7 +161,7 @@ else() if( BUILD_WITH_TENSILE ) # we will have expanded "all" for tensile to ensure consistency as we have local rules - set( Tensile_ARCHITECTURE "${AMDGPU_TARGETS}" CACHE STRING "Tensile to use which architecture?" FORCE) + set( Tensile_ARCHITECTURE "${GPU_TARGETS}" CACHE STRING "Tensile to use which architecture?" FORCE) set( Tensile_LOGIC "asm_full" CACHE STRING "Tensile to use which logic?") set( Tensile_CODE_OBJECT_VERSION "default" CACHE STRING "Tensile code_object_version")