1CUDA_ARCHITECTURES 2------------------ 3 4.. versionadded:: 3.18 5 6List of architectures to generate device code for. 7 8An architecture can be suffixed by either ``-real`` or ``-virtual`` to specify 9the kind of architecture to generate code for. 10If no suffix is given then code is generated for both real and virtual 11architectures. 12 13A non-empty false value (e.g. ``OFF``) disables adding architectures. 14This is intended to support packagers and rare cases where full control 15over the passed flags is required. 16 17This property is initialized by the value of the :variable:`CMAKE_CUDA_ARCHITECTURES` 18variable if it is set when a target is created. 19 20The ``CUDA_ARCHITECTURES`` target property must be set to a non-empty value on targets 21that compile CUDA sources, or it is an error. See policy :policy:`CMP0104`. 22 23Examples 24^^^^^^^^ 25 26.. code-block:: cmake 27 28 set_target_properties(tgt PROPERTIES CUDA_ARCHITECTURES "35;50;72") 29 30Generates code for real and virtual architectures ``30``, ``50`` and ``72``. 31 32.. code-block:: cmake 33 34 set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES 70-real 72-virtual) 35 36Generates code for real architecture ``70`` and virtual architecture ``72``. 37 38.. code-block:: cmake 39 40 set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES OFF) 41 42CMake will not pass any architecture flags to the compiler. 43