diff options
author | Raul Tambre <raul@tambre.ee> | 2020-11-24 17:21:36 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2020-11-30 15:57:11 (GMT) |
commit | c4ae9384ff4d355f51c06180984dd4d053f074cc (patch) | |
tree | 521f3e008bf3dee883e08d2605774d14cbefeb21 /Help | |
parent | 8187bd2f4bc54c9003cb0034b21530e3bfd24e8d (diff) | |
download | CMake-c4ae9384ff4d355f51c06180984dd4d053f074cc.zip CMake-c4ae9384ff4d355f51c06180984dd4d053f074cc.tar.gz CMake-c4ae9384ff4d355f51c06180984dd4d053f074cc.tar.bz2 |
CUDA: Initialize CMAKE_CUDA_ARCHITECTURES using $ENV{CUDAARCHS}
NVCC's default architecture may be newer than the one supported by the
machine's GPU.
In such cases it's useful to have an environment variable for initializing
CMAKE_CUDA_ARCHITECTURES to avoid specifying it for every invocation.
Diffstat (limited to 'Help')
-rw-r--r-- | Help/envvar/CUDAARCHS.rst | 13 | ||||
-rw-r--r-- | Help/manual/cmake-env-variables.7.rst | 1 | ||||
-rw-r--r-- | Help/release/dev/cuda-archs-env.rst | 6 | ||||
-rw-r--r-- | Help/variable/CMAKE_CUDA_ARCHITECTURES.rst | 3 |
4 files changed, 22 insertions, 1 deletions
diff --git a/Help/envvar/CUDAARCHS.rst b/Help/envvar/CUDAARCHS.rst new file mode 100644 index 0000000..82369cd --- /dev/null +++ b/Help/envvar/CUDAARCHS.rst @@ -0,0 +1,13 @@ +CUDAARCHS +--------- + +.. versionadded:: 3.20 + +.. include:: ENV_VAR.txt + +Value used to initialize :variable:`CMAKE_CUDA_ARCHITECTURES` on the first +configuration if it's not already defined. Subsequent runs will use the value +stored in the cache. + +This is a semicolon-separated list of architectures as described in +:prop_tgt:`CUDA_ARCHITECTURES`. diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst index 13e0d39..26e0c48 100644 --- a/Help/manual/cmake-env-variables.7.rst +++ b/Help/manual/cmake-env-variables.7.rst @@ -56,6 +56,7 @@ Environment Variables for Languages /envvar/CC /envvar/CFLAGS /envvar/CSFLAGS + /envvar/CUDAARCHS /envvar/CUDACXX /envvar/CUDAFLAGS /envvar/CUDAHOSTCXX diff --git a/Help/release/dev/cuda-archs-env.rst b/Help/release/dev/cuda-archs-env.rst new file mode 100644 index 0000000..a2afcbe --- /dev/null +++ b/Help/release/dev/cuda-archs-env.rst @@ -0,0 +1,6 @@ +cuda-archs-env +-------------- + +* The :envvar:`CUDAARCHS` environment variable was added for initializing + :variable:`CMAKE_CUDA_ARCHITECTURES`. Useful in cases where the compiler + default is unsuitable for the machine's GPU. diff --git a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst index 985040d..7f7e679 100644 --- a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst +++ b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst @@ -5,7 +5,8 @@ CMAKE_CUDA_ARCHITECTURES Default value for :prop_tgt:`CUDA_ARCHITECTURES` property of targets. -This is initialized as follows depending on :variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>`: +Initialized by the :envvar:`CUDAARCHS` environment variable if set. +Otherwise as follows depending on :variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>`: - For ``Clang``: the oldest architecture that works. |