Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rapids_cuda_patch_toolkit: Better handle non-standard toolkits #324

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions rapids-cmake/cuda/patch_toolkit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ of cublas and cusolver targets are incorrect. This module must be called
from the same CMakeLists.txt as the first `find_project(CUDAToolkit)` to
patch the targets.

For all version of Cmake the dependencies of cusparse are incorrect.
robertmaynard marked this conversation as resolved.
Show resolved Hide resolved
.. note::
:cmake:command:`rapids_cpm_find` will automatically call this module
when asked to find the CUDAToolkit.
Expand All @@ -41,12 +42,24 @@ function(rapids_cuda_patch_toolkit)
list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cuda.patch_toolkit")

get_directory_property(itargets IMPORTED_TARGETS)
if(CUDA::cublas_static IN_LIST itargets)
target_link_libraries(CUDA::cublas INTERFACE CUDA::cublasLt)
target_link_libraries(CUDA::cusparse INTERFACE CUDA::cublas)
if(CMAKE_VERSION VERSION_LESS 3.24.2)
if(CUDA::cublas IN_LIST itargets)
target_link_libraries(CUDA::cublas INTERFACE CUDA::cublasLt)
endif()

if(CUDA::cublas_static IN_LIST itargets)
target_link_libraries(CUDA::cublas_static INTERFACE CUDA::cublasLt_static)
endif()

if(CUDA::cusolver_static IN_LIST itargets)
target_link_libraries(CUDA::cusolver_static INTERFACE CUDA::cusolver_lapack_static)
endif()
endif()

target_link_libraries(CUDA::cublas_static INTERFACE CUDA::cublasLt_static)
target_link_libraries(CUDA::cusolver_static INTERFACE CUDA::cusolver_lapack_static)
if(CUDA::cusparse IN_LIST itargets)
target_link_libraries(CUDA::cusparse INTERFACE CUDA::cublas)
endif()
if(CUDA::cusparse_static IN_LIST itargets)
target_link_libraries(CUDA::cusparse_static INTERFACE CUDA::cublas_static)
endif()
endfunction()