summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCUDACompiler.cmake.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-04 18:51:49 (GMT)
committerBrad King <brad.king@kitware.com>2022-03-10 14:27:29 (GMT)
commitd1b48bfabd6157309b3056967e6e30cc0ce07983 (patch)
tree3ce109b078bf5da4d866f6e2994bbce8246e4df1 /Modules/CMakeCUDACompiler.cmake.in
parent632752d62e8de2730796f509dbb10551351309c2 (diff)
downloadCMake-d1b48bfabd6157309b3056967e6e30cc0ce07983.zip
CMake-d1b48bfabd6157309b3056967e6e30cc0ce07983.tar.gz
CMake-d1b48bfabd6157309b3056967e6e30cc0ce07983.tar.bz2
CUDA: Add support for CUDA_ARCHITECTURES=native
CUDA 11.6 added the `nvcc -arch=native` flag to automatically compile for the host GPUs' architectures. Add support for specifying this special `native` value in `CMAKE_CUDA_ARCHITECTURES` and `CUDA_ARCHITECTURES`. During the compiler ABI detection step, detect the native architectures so we can pass them explicitly when using Clang or older versions of nvcc. Fixes: #22375
Diffstat (limited to 'Modules/CMakeCUDACompiler.cmake.in')
-rw-r--r--Modules/CMakeCUDACompiler.cmake.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/CMakeCUDACompiler.cmake.in b/Modules/CMakeCUDACompiler.cmake.in
index 9f2e213..57d595a 100644
--- a/Modules/CMakeCUDACompiler.cmake.in
+++ b/Modules/CMakeCUDACompiler.cmake.in
@@ -55,6 +55,7 @@ set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "@CMAKE_CUDA_COMPILER_LIBRARY_ROOT@")
set(CMAKE_CUDA_ARCHITECTURES_ALL "@CMAKE_CUDA_ARCHITECTURES_ALL@")
set(CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR "@CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR@")
+set(CMAKE_CUDA_ARCHITECTURES_NATIVE "@CMAKE_CUDA_ARCHITECTURES_NATIVE@")
set(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES "@CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES@")