summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-06-18 12:48:59 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2020-06-18 12:52:58 (GMT)
commitb284a3c76484c2ffba087bff2d307e58fdabebac (patch)
tree9ad5d1ec090ca2cc19fb51d67714d4ebe250ced5 /Tests/CudaOnly
parente66fe75792a2fbe9f3ffe237c748008906ae7116 (diff)
downloadCMake-b284a3c76484c2ffba087bff2d307e58fdabebac.zip
CMake-b284a3c76484c2ffba087bff2d307e58fdabebac.tar.gz
CMake-b284a3c76484c2ffba087bff2d307e58fdabebac.tar.bz2
CudaToolkit: Update for new/removed libraries in CUDA 11
Diffstat (limited to 'Tests/CudaOnly')
-rw-r--r--Tests/CudaOnly/Toolkit/CMakeLists.txt17
1 files changed, 15 insertions, 2 deletions
diff --git a/Tests/CudaOnly/Toolkit/CMakeLists.txt b/Tests/CudaOnly/Toolkit/CMakeLists.txt
index 0d5d574..bb06ba8 100644
--- a/Tests/CudaOnly/Toolkit/CMakeLists.txt
+++ b/Tests/CudaOnly/Toolkit/CMakeLists.txt
@@ -11,8 +11,17 @@ message(STATUS "CUDAToolkit_INCLUDE_DIRS: ${CUDAToolkit_INCLUDE_DIRS}")
message(STATUS "CUDAToolkit_LIBRARY_DIR: ${CUDAToolkit_LIBRARY_DIR}")
message(STATUS "CUDAToolkit_NVCC_EXECUTABLE ${CUDAToolkit_NVCC_EXECUTABLE}")
+
+set(cuda_libs cudart cuda_driver cublas cufft cufftw curand cusolver cusparse)
+if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.1)
+ list(APPEND cuda_libs cublasLt)
+endif()
+if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 11)
+ list(APPEND cuda_libs nvgraph)
+endif()
+
# Verify that all the CUDA:: targets and variables exist
-foreach (cuda_lib cudart cuda_driver cublas cufft cufftw curand cusolver cusparse nvgraph)
+foreach (cuda_lib IN LISTS cuda_libs)
if(NOT CUDA_${cuda_lib}_LIBRARY)
message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found")
endif()
@@ -21,7 +30,11 @@ foreach (cuda_lib cudart cuda_driver cublas cufft cufftw curand cusolver cuspars
endif()
endforeach()
-foreach (cuda_lib nppc nppial nppicc nppidei nppif nppig nppim nppist nppitc npps nppicom nppisu)
+set(npp_libs nppc nppial nppicc nppidei nppif nppig nppim nppist nppitc npps nppisu)
+if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 11)
+ list(APPEND npp_libs nppicom)
+endif()
+foreach (cuda_lib )
if(NOT CUDA_${cuda_lib}_LIBRARY)
message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found")
endif()