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/policy | |
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/policy')
-rw-r--r-- | Help/policy/CMP0104.rst | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Help/policy/CMP0104.rst b/Help/policy/CMP0104.rst new file mode 100644 index 0000000..ca2c571 --- /dev/null +++ b/Help/policy/CMP0104.rst @@ -0,0 +1,31 @@ +CMP0104 +------- + +Initialize :variable:`CMAKE_CUDA_ARCHITECTURES` when +:variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` is ``NVIDIA``. +Raise an error if :prop_tgt:`CUDA_ARCHITECTURES` is empty. + +:variable:`CMAKE_CUDA_ARCHITECTURES` introduced in CMake 3.18 is used to +initialize :prop_tgt:`CUDA_ARCHITECTURES`, which passes correct code generation +flags to the CUDA compiler. + +Previous to this users had to manually specify the code generation flags. This +policy is for backwards compatibility with manually specifying code generation +flags. + +The ``OLD`` behavior for this policy is to not initialize +:variable:`CMAKE_CUDA_ARCHITECTURES` when +:variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` is ``NVIDIA``. +Empty :prop_tgt:`CUDA_ARCHITECTURES` is allowed. + +The ``NEW`` behavior of this policy is to initialize +:variable:`CMAKE_CUDA_ARCHITECTURES` when +:variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` is ``NVIDIA`` +and raise an error if :prop_tgt:`CUDA_ARCHITECTURES` is empty during generation. + +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 |