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
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 12 additions & 7 deletions rapids-cmake/cuda/patch_toolkit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ 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)

target_link_libraries(CUDA::cublas_static INTERFACE CUDA::cublasLt_static)
target_link_libraries(CUDA::cusolver_static INTERFACE CUDA::cusolver_lapack_static)
target_link_libraries(CUDA::cusparse_static INTERFACE CUDA::cublas_static)
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()
endfunction()
2 changes: 0 additions & 2 deletions testing/cuda/patch_toolkit-nested/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ add_subdirectory(subdir)

if(TARGET CUDA::cublas_static)
verify_links_to(CUDA::cublas CUDA::cublasLt)
verify_links_to(CUDA::cusparse CUDA::cublas)
verify_links_to(CUDA::cublas_static CUDA::cublasLt_static)
verify_links_to(CUDA::cusparse_static CUDA::cublas_static)
verify_links_to(CUDA::cusolver_static CUDA::cusolver_lapack_static)
endif()
2 changes: 0 additions & 2 deletions testing/cuda/patch_toolkit-nested/subdir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ rapids_cuda_patch_toolkit()

if(TARGET CUDA::cublas_static)
verify_links_to(CUDA::cublas CUDA::cublasLt)
verify_links_to(CUDA::cusparse CUDA::cublas)
verify_links_to(CUDA::cublas_static CUDA::cublasLt_static)
verify_links_to(CUDA::cusparse_static CUDA::cublas_static)
verify_links_to(CUDA::cusolver_static CUDA::cusolver_lapack_static)
endif()
2 changes: 0 additions & 2 deletions testing/cuda/patch_toolkit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ rapids_cuda_patch_toolkit()

if(TARGET CUDA::cublas_static)
verify_links_to(CUDA::cublas CUDA::cublasLt)
verify_links_to(CUDA::cusparse CUDA::cublas)
verify_links_to(CUDA::cublas_static CUDA::cublasLt_static)
verify_links_to(CUDA::cusparse_static CUDA::cublas_static)
verify_links_to(CUDA::cusolver_static CUDA::cusolver_lapack_static)
endif()
2 changes: 0 additions & 2 deletions testing/find/find_package-cudatoolkit-patching.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ rapids_find_package(CUDAToolkit)

if(TARGET CUDA::cublas_static)
verify_links_to(CUDA::cublas CUDA::cublasLt)
verify_links_to(CUDA::cusparse CUDA::cublas)
verify_links_to(CUDA::cublas_static CUDA::cublasLt_static)
verify_links_to(CUDA::cusparse_static CUDA::cublas_static)
verify_links_to(CUDA::cusolver_static CUDA::cusolver_lapack_static)
endif()