CUDA_ARCHITECTURES.rst 1.3 KB

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