mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
CudaToolkit: Update for new/removed libraries in CUDA 11
This commit is contained in:
@@ -154,6 +154,8 @@ Targets Created:
|
||||
|
||||
- ``CUDA::cublas``
|
||||
- ``CUDA::cublas_static``
|
||||
- ``CUDA::cublasLt`` starting in CUDA 10.1
|
||||
- ``CUDA::cublasLt_static`` starting in CUDA 10.1
|
||||
|
||||
.. _`cuda_toolkit_cuFFT`:
|
||||
|
||||
@@ -240,6 +242,7 @@ Targets Created:
|
||||
- ``CUDA::nppicc_static``
|
||||
|
||||
- `nppicom`: JPEG compression and decompression functions in `nppi_compression_functions.h`
|
||||
Removed starting in CUDA 11.0, use :ref:`nvJPEG<cuda_toolkit_nvJPEG>` instead.
|
||||
|
||||
- ``CUDA::nppicom``
|
||||
- ``CUDA::nppicom_static``
|
||||
@@ -302,6 +305,7 @@ nvGRAPH
|
||||
"""""""
|
||||
|
||||
The `nvGRAPH <https://docs.nvidia.com/cuda/nvgraph/index.html>`_ library.
|
||||
Removed starting in CUDA 11.0
|
||||
|
||||
Targets Created:
|
||||
|
||||
@@ -821,7 +825,7 @@ if(CUDAToolkit_FOUND)
|
||||
endif()
|
||||
|
||||
_CUDAToolkit_find_and_add_import_lib(culibos) # it's a static library
|
||||
foreach (cuda_lib cublas cufft curand cusparse nppc nvjpeg)
|
||||
foreach (cuda_lib cublasLt cublas cufft curand cusparse nppc nvjpeg)
|
||||
_CUDAToolkit_find_and_add_import_lib(${cuda_lib})
|
||||
_CUDAToolkit_find_and_add_import_lib(${cuda_lib}_static DEPS culibos)
|
||||
endforeach()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user