diff options
author | Raul Tambre <raul@tambre.ee> | 2020-06-12 16:59:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-06-15 13:13:32 (GMT) |
commit | 877a92e968bfa24d86f4b9685b5c27d4c9e6c1be (patch) | |
tree | 3c410caeece84452eff2f1ef27eb01b5b1b54f1f /Help/policy | |
parent | 594fda9c234915669dbfe61bec7c59250e747b4a (diff) | |
download | CMake-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/policy')
-rw-r--r-- | Help/policy/CMP0104.rst | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Help/policy/CMP0104.rst b/Help/policy/CMP0104.rst index ca2c571..8516716 100644 --- a/Help/policy/CMP0104.rst +++ b/Help/policy/CMP0104.rst @@ -23,9 +23,34 @@ The ``NEW`` behavior of this policy is to initialize :variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` is ``NVIDIA`` and raise an error if :prop_tgt:`CUDA_ARCHITECTURES` is empty during generation. +If :prop_tgt:`CUDA_ARCHITECTURES` is set to a false value no architectures +flags are passed to the compiler. This is intended to support packagers and +the rare cases where full control over the passed flags is required. + This policy was introduced in CMake version 3.18. CMake version |release| warns when the policy is not set and uses ``OLD`` behavior. Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. .. include:: DEPRECATED.txt + +Examples +^^^^^^^^ + +.. code-block:: cmake + + set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES 35 50 72) + +Generates code for real and virtual architectures ``30``, ``50`` and ``72``. + +.. code-block:: cmake + + 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. |