diff options
author | Raul Tambre <raul@tambre.ee> | 2020-03-12 11:31:47 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2020-04-15 14:55:41 (GMT) |
commit | e98588aabad578a9b33aae05e77f6ec5b3ff2e46 (patch) | |
tree | 34c2ee6ab9b11721b5287a6a9a2b01afb04a5943 /Help/prop_tgt | |
parent | 71a06093795efc55c4ef3575b5c4177d38894870 (diff) | |
download | CMake-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/prop_tgt')
-rw-r--r-- | Help/prop_tgt/CUDA_ARCHITECTURES.rst | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Help/prop_tgt/CUDA_ARCHITECTURES.rst b/Help/prop_tgt/CUDA_ARCHITECTURES.rst new file mode 100644 index 0000000..328f40b --- /dev/null +++ b/Help/prop_tgt/CUDA_ARCHITECTURES.rst @@ -0,0 +1,30 @@ +CUDA_ARCHITECTURES +------------------ + +List of architectures to generate device code for. + +An architecture can be suffixed by either ``-real`` or ``-virtual`` to specify +the kind of architecture to generate code for. +If no suffix is given then code is generated for both real and virtual +architectures. + +This property is initialized by the value of the :variable:`CMAKE_CUDA_ARCHITECTURES` +variable if it is set when a target is created. + +The ``CUDA_ARCHITECTURES`` target property must be set to a non-empty value on targets +that compile CUDA sources, or it is an error. See policy :policy:`CMP0104`. + +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``. |