diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2022-12-09 17:20:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-12-13 15:18:15 (GMT) |
commit | 0aeeb8160c8ef68a07f84de908578167d46c0935 (patch) | |
tree | 9caf9d1cbd41783ecaece070cf924d69a60b0ef3 /Modules/Compiler | |
parent | 6db3519c41e8d58401607be1020a9d4aab645c39 (diff) | |
download | CMake-0aeeb8160c8ef68a07f84de908578167d46c0935.zip CMake-0aeeb8160c8ef68a07f84de908578167d46c0935.tar.gz CMake-0aeeb8160c8ef68a07f84de908578167d46c0935.tar.bz2 |
CUDA: Add support for cuda_std_20 for nvcc 12.0+
CUDA 12.0 has been released with support for `-std=c++20`.
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/NVIDIA-CUDA.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index c8dcd2a..670e0ca 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") |