diff options
author | Brad King <brad.king@kitware.com> | 2020-06-19 12:13:02 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-06-19 12:13:08 (GMT) |
commit | 21d0961bc222dcdfac194354203e144e305959ea (patch) | |
tree | b446910dbb07359799ac102cef22985aa3c21d24 /Tests/Cuda/Toolkit/CMakeLists.txt | |
parent | c7561c0fcc22e6b2ea59e302d519c5389c27c95c (diff) | |
parent | b284a3c76484c2ffba087bff2d307e58fdabebac (diff) | |
download | CMake-21d0961bc222dcdfac194354203e144e305959ea.zip CMake-21d0961bc222dcdfac194354203e144e305959ea.tar.gz CMake-21d0961bc222dcdfac194354203e144e305959ea.tar.bz2 |
Merge topic 'CUDAToolkit-cuda-11' into release-3.18
b284a3c764 CudaToolkit: Update for new/removed libraries in CUDA 11
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4917
Diffstat (limited to 'Tests/Cuda/Toolkit/CMakeLists.txt')
-rw-r--r-- | Tests/Cuda/Toolkit/CMakeLists.txt | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Tests/Cuda/Toolkit/CMakeLists.txt b/Tests/Cuda/Toolkit/CMakeLists.txt index 86b4652..00125e3 100644 --- a/Tests/Cuda/Toolkit/CMakeLists.txt +++ b/Tests/Cuda/Toolkit/CMakeLists.txt @@ -14,15 +14,29 @@ message(STATUS "CUDAToolkit_INCLUDE_DIRS: ${CUDAToolkit_INCLUDE_DIRS}") message(STATUS "CUDAToolkit_LIBRARY_DIR: ${CUDAToolkit_LIBRARY_DIR}") message(STATUS "CUDAToolkit_NVCC_EXECUTABLE ${CUDAToolkit_NVCC_EXECUTABLE}") -# Verify that all the CUDA:: targets exist even when the CUDA language isn't enabled +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() -foreach (cuda_lib cudart cuda_driver cublas cufft cufftw curand cusolver cusparse nvgraph) +# Verify that all the CUDA:: targets exist even when the CUDA language isn't enabled +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() if(NOT TARGET CUDA::${cuda_lib}) - message(FATAL_ERROR "The CUDA::${cuda_lib} target was expected but couldn't be found") + message(FATAL_ERROR "expected CUDAToolkit target CUDA::${cuda_lib} not found") 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 IN LISTS npp_libs) if(NOT TARGET CUDA::${cuda_lib}) message(FATAL_ERROR "The CUDA::${cuda_lib} target was expected but couldn't be found") endif() |