diff options
-rw-r--r-- | Help/release/3.25.rst | 6 | ||||
-rw-r--r-- | Modules/Compiler/NVIDIA-CUDA.cmake | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/Help/release/3.25.rst b/Help/release/3.25.rst index fdf8a94..e76a308 100644 --- a/Help/release/3.25.rst +++ b/Help/release/3.25.rst @@ -246,3 +246,9 @@ Changes made since CMake 3.25.0 include the following. command no longer accepts ``.a`` file names. This behavior was added in CMake 3.25.0, but has been reverted due finding GNU-ABI libraries in cases we did not previously. + +3.25.2 +------ + +* CUDA language level 20 (corresponding to C++20) is now supported with + NVCC 12.0 and above. diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index 34dd09a..0823954 100644 --- a/Modules/Compiler/NVIDIA-CUDA.cmake +++ b/Modules/Compiler/NVIDIA-CUDA.cmake @@ -119,6 +119,13 @@ if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC") endif() endif() + if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 12.0) + if(CMAKE_CUDA_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.11.25505) + set(CMAKE_CUDA20_STANDARD_COMPILE_OPTION "-std=c++20") + set(CMAKE_CUDA20_EXTENSION_COMPILE_OPTION "-std=c++20") + endif() + endif() + else() set(CMAKE_CUDA03_STANDARD_COMPILE_OPTION "") set(CMAKE_CUDA03_EXTENSION_COMPILE_OPTION "") @@ -138,6 +145,11 @@ else() set(CMAKE_CUDA17_EXTENSION_COMPILE_OPTION "-std=c++17") endif() + if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 12.0) + set(CMAKE_CUDA20_STANDARD_COMPILE_OPTION "-std=c++20") + set(CMAKE_CUDA20_EXTENSION_COMPILE_OPTION "-std=c++20") + endif() + endif() if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0") |