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

Automatically look for CUDA targets when importing GraphBLAS #399

Merged
merged 1 commit into from
Sep 13, 2023
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
3 changes: 3 additions & 0 deletions GraphBLAS/CUDA/Config/GraphBLAS_CUDAConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ set ( GRAPHBLAS_CUDA_VERSION_MINOR @GraphBLAS_VERSION_MINOR@ )
set ( GRAPHBLAS_CUDA_VERSION_PATCH @GraphBLAS_VERSION_SUB@ )
set ( GRAPHBLAS_CUDA_VERSION "@GraphBLAS_VERSION_MAJOR@.@GraphBLAS_VERSION_MINOR@.@GraphBLAS_VERSION_SUB@" )

# Look for NVIDIA CUDA toolkit
find_package ( CUDAToolkit @CUDAToolkit_VERSION_MAJOR@ REQUIRED )

include ( ${CMAKE_CURRENT_LIST_DIR}/GraphBLAS_CUDATargets.cmake )

# The following is only for backward compatibility with FindGraphBLAS_CUDA.
Expand Down
16 changes: 16 additions & 0 deletions GraphBLAS/Config/GraphBLASConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ set ( GRAPHBLAS_VERSION_MINOR @GraphBLAS_VERSION_MINOR@ )
set ( GRAPHBLAS_VERSION_PATCH @GraphBLAS_VERSION_SUB@ )
set ( GRAPHBLAS_VERSION "@GraphBLAS_VERSION_MAJOR@.@GraphBLAS_VERSION_MINOR@.@GraphBLAS_VERSION_SUB@" )

if ( @SUITESPARSE_CUDA@ )
# Look for imported targets of additional dependency if GraphBLAS was built with CUDA

if ( @SUITESPARSE_IN_BUILD_TREE@ )
# First check in a common build tree
find_package ( GraphBLAS_CUDA @GraphBLAS_VERSION_MAJOR@.@GraphBLAS_VERSION_MINOR@.@GraphBLAS_VERSION_SUB@
PATHS ${CMAKE_SOURCE_DIR}/../GraphBLAS/build/CUDA NO_DEFAULT_PATH )
# Then, check in the currently active CMAKE_MODULE_PATH
if ( NOT TARGET SuiteSparse::GraphBLAS_CUDA )
find_package ( GraphBLAS_CUDA @GraphBLAS_VERSION_MAJOR@.@GraphBLAS_VERSION_MINOR@.@GraphBLAS_VERSION_SUB@ REQUIRED )
endif ( )
else ( )
find_package ( GraphBLAS_CUDA @GraphBLAS_VERSION_MAJOR@.@GraphBLAS_VERSION_MINOR@.@GraphBLAS_VERSION_SUB@ REQUIRED )
endif ( )
endif ( )

include ( ${CMAKE_CURRENT_LIST_DIR}/GraphBLASTargets.cmake )

# The following is only for backward compatibility with FindGraphBLAS.
Expand Down