diff options
author | Brad King <brad.king@kitware.com> | 2020-11-23 16:19:57 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-11-23 16:23:02 (GMT) |
commit | 8832b695e09c9ba192e7e3e5db7b83028449b3fe (patch) | |
tree | ad9fbd676699b569b0235dc594a592a9e8ce09ef | |
parent | 9ce530eac7110f92b8ffaeecdb22243968ae032b (diff) | |
parent | 046e454fdd7bf624608f867e032bc88919b86d88 (diff) | |
download | CMake-8832b695e09c9ba192e7e3e5db7b83028449b3fe.zip CMake-8832b695e09c9ba192e7e3e5db7b83028449b3fe.tar.gz CMake-8832b695e09c9ba192e7e3e5db7b83028449b3fe.tar.bz2 |
Merge topic 'cuda_11'
046e454fdd CUDA: Error if can't determine toolkit library root
440dc98b07 CUDA: Clang CUDA 11.1 support
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5525
-rw-r--r-- | Help/release/3.19.rst | 2 | ||||
-rw-r--r-- | Modules/CMakeDetermineCUDACompiler.cmake | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/Help/release/3.19.rst b/Help/release/3.19.rst index 961d6c0..a29dc07 100644 --- a/Help/release/3.19.rst +++ b/Help/release/3.19.rst @@ -346,3 +346,5 @@ Changes made since CMake 3.19.0 include the following. it can break projects that were using the property only to cause the specified language's compiler to be used. This has been reverted to restore behavior from CMake 3.18 and below. + +* CUDA 11.1 support for Clang. diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index 9220551..972adef 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -176,13 +176,15 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) # In a non-scattered installation the following are equivalent to CMAKE_CUDA_COMPILER_TOOLKIT_ROOT. # We first check for a non-scattered installation to prefer it over a scattered installation. - # CMAKE_CUDA_COMPILER_LIBRARY_ROOT contains the device library and version file. - if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/version.txt") + # CMAKE_CUDA_COMPILER_LIBRARY_ROOT contains the device library. + if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/nvvm/libdevice") set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}") - elseif(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/version.txt") + elseif(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/nvvm/libdevice") set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_SYSROOT_LINK}/usr/lib/cuda") - elseif(EXISTS "${CMAKE_SYSROOT}/usr/lib/cuda/version.txt") + elseif(EXISTS "${CMAKE_SYSROOT}/usr/lib/cuda/nvvm/libdevice") set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_SYSROOT}/usr/lib/cuda") + else() + message(FATAL_ERROR "Couldn't find CUDA library root.") endif() # CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT contains the linking stubs necessary for device linking and other low-level library files. |