diff options
author | Brad King <brad.king@kitware.com> | 2022-09-07 13:37:52 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-09-07 13:38:00 (GMT) |
commit | 6a2fd8439abd5fc83d50f645a09484a1a208fdd4 (patch) | |
tree | 72dfbb1eb3563bec89068f8db7537bdcdbd397b7 /Modules | |
parent | aa4da6944e10467f6a19fcb7985831e5676cab7f (diff) | |
parent | f0918fe505fd54f5072410254f11110e8af1bb58 (diff) | |
download | CMake-6a2fd8439abd5fc83d50f645a09484a1a208fdd4.zip CMake-6a2fd8439abd5fc83d50f645a09484a1a208fdd4.tar.gz CMake-6a2fd8439abd5fc83d50f645a09484a1a208fdd4.tar.bz2 |
Merge topic 'findCUDAToolkit_declare_deps_for_targets_once' into release-3.24
f0918fe505 FindCUDAToolkit: Correctly state cusolver and cublas dependencies
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7633
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index edad44a..5f83ccc 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -927,7 +927,7 @@ if(CUDAToolkit_FOUND) endif() _CUDAToolkit_find_and_add_import_lib(culibos) # it's a static library - foreach (cuda_lib cublasLt cublas cufft curand cusparse nppc nvjpeg) + foreach (cuda_lib cublasLt 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() @@ -935,8 +935,11 @@ if(CUDAToolkit_FOUND) if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.0.0) # cublas depends on cublasLt # https://docs.nvidia.com/cuda/archive/11.0/cublas/index.html#static-library - _CUDAToolkit_find_and_add_import_lib(cublas DEPS cublasLt) - _CUDAToolkit_find_and_add_import_lib(cublas_static DEPS cublasLt_static) + _CUDAToolkit_find_and_add_import_lib(cublas DEPS cublasLt culibos) + _CUDAToolkit_find_and_add_import_lib(cublas_static DEPS cublasLt_static culibos) + else() + _CUDAToolkit_find_and_add_import_lib(cublas DEPS culibos) + _CUDAToolkit_find_and_add_import_lib(cublas_static DEPS culibos) endif() # cuFFTW depends on cuFFT @@ -947,25 +950,25 @@ if(CUDAToolkit_FOUND) endif() # cuSOLVER depends on cuBLAS, and cuSPARSE - _CUDAToolkit_find_and_add_import_lib(cusolver DEPS cublas cusparse) - _CUDAToolkit_find_and_add_import_lib(cusolver_static DEPS cublas_static cusparse_static culibos) - - - if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.1.2) - # cusolver depends on liblapack_static.a starting with CUDA 10.1 update 2, - # https://docs.nvidia.com/cuda/archive/11.5.0/cusolver/index.html#static-link-lapack - _CUDAToolkit_find_and_add_import_lib(cusolver_lapack_static ALT lapack_static) # implementation detail static lib - _CUDAToolkit_find_and_add_import_lib(cusolver_static DEPS cusolver_lapack_static) - endif() - + set(cusolver_deps cublas cusparse) + set(cusolver_static_deps cublas_static cusparse_static culibos) if(CUDAToolkit_VERSION VERSION_GREATER 11.2.1) # cusolver depends on libcusolver_metis and cublasLt # https://docs.nvidia.com/cuda/archive/11.2.2/cusolver/index.html#link-dependency - _CUDAToolkit_find_and_add_import_lib(cusolver DEPS cublasLt) - + list(APPEND cusolver_deps cublasLt) _CUDAToolkit_find_and_add_import_lib(cusolver_metis_static ALT metis_static) # implementation detail static lib - _CUDAToolkit_find_and_add_import_lib(cusolver_static DEPS cusolver_metis_static cublasLt_static) + list(APPEND cusolver_static_deps cusolver_metis_static cublasLt_static) + endif() + if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.1.2) + # cusolver depends on liblapack_static.a starting with CUDA 10.1 update 2, + # https://docs.nvidia.com/cuda/archive/11.5.0/cusolver/index.html#static-link-lapack + _CUDAToolkit_find_and_add_import_lib(cusolver_lapack_static ALT lapack_static) # implementation detail static lib + list(APPEND cusolver_static_deps cusolver_lapack_static) endif() + _CUDAToolkit_find_and_add_import_lib(cusolver DEPS ${cusolver_deps}) + _CUDAToolkit_find_and_add_import_lib(cusolver_static DEPS ${cusolver_static_deps}) + unset(cusolver_deps) + unset(cusolver_static_deps) # nvGRAPH depends on cuRAND, and cuSOLVER. _CUDAToolkit_find_and_add_import_lib(nvgraph DEPS curand cusolver) |