summaryrefslogtreecommitdiffstats
path: root/Help/variable
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-03-12 11:31:47 (GMT)
committerRaul Tambre <raul@tambre.ee>2020-04-15 14:55:41 (GMT)
commite98588aabad578a9b33aae05e77f6ec5b3ff2e46 (patch)
tree34c2ee6ab9b11721b5287a6a9a2b01afb04a5943 /Help/variable
parent71a06093795efc55c4ef3575b5c4177d38894870 (diff)
downloadCMake-e98588aabad578a9b33aae05e77f6ec5b3ff2e46.zip
CMake-e98588aabad578a9b33aae05e77f6ec5b3ff2e46.tar.gz
CMake-e98588aabad578a9b33aae05e77f6ec5b3ff2e46.tar.bz2
CUDA: Add CUDA_ARCHITECTURES target property
Simplifies CUDA target architecture handling. Required for Clang support as Clang doesn't automatically select a supported architecture. We detect a supported architecture during compiler identification and set CMAKE_CUDA_ARCHITECTURES to it. Introduces CMP0104 for backwards compatibility with manually setting code generation flags with NVCC. Implements #17963.
Diffstat (limited to 'Help/variable')
-rw-r--r--Help/variable/CMAKE_CUDA_ARCHITECTURES.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
new file mode 100644
index 0000000..149bffa
--- /dev/null
+++ b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
@@ -0,0 +1,17 @@
+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>`:
+
+- For ``Clang``: the oldest architecture that works.
+
+- For ``NVIDIA``: the default architecture chosen by the compiler.
+ See policy :policy:`CMP0104`.
+
+Users are encouraged to override this, as the default varies across compilers
+and compiler versions.
+
+This variable is used to initialize the :prop_tgt:`CUDA_ARCHITECTURES` property
+on all targets. See the target property for additional information.