summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCUDACompiler.cmake
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-11-22 09:03:00 (GMT)
committerRaul Tambre <raul@tambre.ee>2020-11-22 09:30:01 (GMT)
commit440dc98b07d89d3c45c19a9c4ddfbf264081600b (patch)
tree6e59d2b08d631c071f126fedf6e28e15c489e386 /Modules/CMakeDetermineCUDACompiler.cmake
parent4549027a09756d7421651bc8312e4619707f076d (diff)
downloadCMake-440dc98b07d89d3c45c19a9c4ddfbf264081600b.zip
CMake-440dc98b07d89d3c45c19a9c4ddfbf264081600b.tar.gz
CMake-440dc98b07d89d3c45c19a9c4ddfbf264081600b.tar.bz2
CUDA: Clang CUDA 11.1 support
version.txt is gone from CUDA 11.1 installations, but the rest is the same. Instead of looking for version.txt look for <CUDA path>/nvvm/libdevice, which is the main thing that Clang requires (though it also checks for the existence of bin and include). Fixes #21353.
Diffstat (limited to 'Modules/CMakeDetermineCUDACompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 9220551..781c590 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -176,12 +176,12 @@ 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")
endif()