diff options
author | Brad King <brad.king@kitware.com> | 2023-09-25 20:16:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-09-25 20:21:55 (GMT) |
commit | 8c8b3f1bfaf055910c2764fa710da583a247338a (patch) | |
tree | dbd045e4b0b602044cb3e381948537f5f72db29c | |
parent | b3e92775ab5defa49783b5ff46627c3d3662ab2b (diff) | |
download | CMake-8c8b3f1bfaf055910c2764fa710da583a247338a.zip CMake-8c8b3f1bfaf055910c2764fa710da583a247338a.tar.gz CMake-8c8b3f1bfaf055910c2764fa710da583a247338a.tar.bz2 |
HIP: Fix support for -DCMAKE_HIP_ARCHITECTURES=native with NVCC
-rw-r--r-- | Modules/CMakeDetermineCompilerABI.cmake | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index 13bfeec..7d8fa19 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -26,13 +26,13 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) if(DEFINED CMAKE_${lang}_VERBOSE_COMPILE_FLAG) set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_COMPILE_FLAG}") endif() - if(lang STREQUAL "CUDA") - if(CMAKE_CUDA_ARCHITECTURES STREQUAL "native") + if(lang MATCHES "^(CUDA|HIP)$") + if(CMAKE_${lang}_ARCHITECTURES STREQUAL "native") # We are about to detect the native architectures, so we do # not yet know them. Use all architectures during detection. - set(CMAKE_CUDA_ARCHITECTURES "all") + set(CMAKE_${lang}_ARCHITECTURES "all") endif() - set(CMAKE_CUDA_RUNTIME_LIBRARY "Static") + set(CMAKE_${lang}_RUNTIME_LIBRARY "Static") endif() if(NOT "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xMSVC") # Avoid adding our own platform standard libraries for compilers |