summaryrefslogtreecommitdiffstats
path: root/Help/prop_tgt
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-06-12 16:59:32 (GMT)
committerBrad King <brad.king@kitware.com>2020-06-15 13:13:32 (GMT)
commit877a92e968bfa24d86f4b9685b5c27d4c9e6c1be (patch)
tree3c410caeece84452eff2f1ef27eb01b5b1b54f1f /Help/prop_tgt
parent594fda9c234915669dbfe61bec7c59250e747b4a (diff)
downloadCMake-877a92e968bfa24d86f4b9685b5c27d4c9e6c1be.zip
CMake-877a92e968bfa24d86f4b9685b5c27d4c9e6c1be.tar.gz
CMake-877a92e968bfa24d86f4b9685b5c27d4c9e6c1be.tar.bz2
CUDA: Add support for disabling CUDA_ARCHITECTURES
The ability to disable adding architectures completely for packaging purposes and cases requiring passing the architectures flags explicitly has been requested. Support a false value for CUDA_ARCHITECTURES and CMAKE_CUDA_ARCHITECTURES for this purpose. Implements #20821.
Diffstat (limited to 'Help/prop_tgt')
-rw-r--r--Help/prop_tgt/CUDA_ARCHITECTURES.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/Help/prop_tgt/CUDA_ARCHITECTURES.rst b/Help/prop_tgt/CUDA_ARCHITECTURES.rst
index 328f40b..bae3c6f 100644
--- a/Help/prop_tgt/CUDA_ARCHITECTURES.rst
+++ b/Help/prop_tgt/CUDA_ARCHITECTURES.rst
@@ -8,6 +8,10 @@ the kind of architecture to generate code for.
If no suffix is given then code is generated for both real and virtual
architectures.
+A non-empty false value (e.g. ``OFF``) disables adding architectures.
+This is intended to support packagers and rare cases where full control
+over the passed flags is required.
+
This property is initialized by the value of the :variable:`CMAKE_CUDA_ARCHITECTURES`
variable if it is set when a target is created.
@@ -28,3 +32,9 @@ Generates code for real and virtual architectures ``30``, ``50`` and ``72``.
set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES 70-real 72-virtual)
Generates code for real architecture ``70`` and virtual architecture ``72``.
+
+.. code-block:: cmake
+
+ set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES OFF)
+
+CMake will not pass any architecture flags to the compiler.