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 | 92d21eae653e8c3e86ecd9079d55bb395349037e (patch) | |
tree | 77e2b84dfa0ea6ab2112c1eb53f7ca2c33e8e71f /Modules | |
parent | 20bb6f24d1e2a86783c87af35c580d4c890084cb (diff) | |
parent | 046e454fdd7bf624608f867e032bc88919b86d88 (diff) | |
download | CMake-92d21eae653e8c3e86ecd9079d55bb395349037e.zip CMake-92d21eae653e8c3e86ecd9079d55bb395349037e.tar.gz CMake-92d21eae653e8c3e86ecd9079d55bb395349037e.tar.bz2 |
Merge topic 'cuda_11' into release-3.19
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
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCUDACompiler.cmake | 10 |
1 files changed, 6 insertions, 4 deletions
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. |