diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2022-12-12 18:28:50 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2022-12-12 18:28:50 (GMT) |
commit | d37d9c098c28beafcc5ea49795f471deafe034ad (patch) | |
tree | 020b088c3602ad3b1e80d365fee7a457d8ec02ad | |
parent | 07fe1c9eb84f38f15e182158c1ab9ab842181079 (diff) | |
download | CMake-d37d9c098c28beafcc5ea49795f471deafe034ad.zip CMake-d37d9c098c28beafcc5ea49795f471deafe034ad.tar.gz CMake-d37d9c098c28beafcc5ea49795f471deafe034ad.tar.bz2 |
FindCUDAToolkit: Support the new `nvJitLink` library in CUDA 12
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 17 | ||||
-rw-r--r-- | Tests/Cuda/Toolkit/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/CudaOnly/Toolkit/CMakeLists.txt | 4 |
3 files changed, 24 insertions, 0 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index 5df31da..f104bfc 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -380,6 +380,18 @@ Targets Created: - ``CUDA::nvrtc`` +.. _`cuda_toolkit_nvjitlink`: + +nvJitLink +""""""""" + +The `nvJItLink <https://docs.nvidia.com/cuda/>`_ (Runtime LTO Linking) library. + +Targets Created: + +- ``CUDA::nvJitLink`` starting in CUDA 12.0 +- ``CUDA::nvJitLink_static`` starting in CUDA 12.0 + .. _`cuda_toolkit_nvml`: nvidia-ML @@ -1094,6 +1106,11 @@ if(CUDAToolkit_FOUND) endif() endif() + if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 12.0.0) + _CUDAToolkit_find_and_add_import_lib(nvJitLink DEPS cuda_driver) + _CUDAToolkit_find_and_add_import_lib(nvJitLink_static DEPS cuda_driver) + endif() + _CUDAToolkit_find_and_add_import_lib(nvml ALT nvidia-ml nvml) if(WIN32) diff --git a/Tests/Cuda/Toolkit/CMakeLists.txt b/Tests/Cuda/Toolkit/CMakeLists.txt index e6b298d..b67aa32 100644 --- a/Tests/Cuda/Toolkit/CMakeLists.txt +++ b/Tests/Cuda/Toolkit/CMakeLists.txt @@ -22,6 +22,9 @@ 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_GREATER 11) + list(APPEND cuda_libs nvJitLink) +endif() if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 11) list(APPEND cuda_libs nvgraph) endif() diff --git a/Tests/CudaOnly/Toolkit/CMakeLists.txt b/Tests/CudaOnly/Toolkit/CMakeLists.txt index ddf940b..e0801a3 100644 --- a/Tests/CudaOnly/Toolkit/CMakeLists.txt +++ b/Tests/CudaOnly/Toolkit/CMakeLists.txt @@ -20,10 +20,14 @@ 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_GREATER 11) + list(APPEND cuda_libs nvJitLink) +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 IN LISTS cuda_libs) if(NOT CUDA_${cuda_lib}_LIBRARY) |