Skip to content

Commit

Permalink
Merge pull request #550 from DrTimothyAldenDavis/dev2
Browse files Browse the repository at this point in the history
LAGraph: looking for GraphBLAS; CHOLMOD: merge cuda, vertcat/horzcat; ParU: enable_cuda; GraphBLAS testing
  • Loading branch information
DrTimothyAldenDavis authored Nov 30, 2023
2 parents 2895129 + 8a74874 commit 0b41a3e
Show file tree
Hide file tree
Showing 40 changed files with 602 additions and 468 deletions.
75 changes: 12 additions & 63 deletions CHOLMOD/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,6 @@ endif ( )
include ( SuiteSparseLAPACK ) # requires cmake 3.22
endif ( )

#-------------------------------------------------------------------------------
# find CUDA
#-------------------------------------------------------------------------------

if ( SUITESPARSE_CUDA )
# with CUDA
add_subdirectory ( GPU )
message ( STATUS "CUDA libraries: " ${CUDA_LIBRARIES} )
include_directories ( GPU ${CUDAToolkit_INCLUDE_DIRS} )
link_directories ( "GPU" "${CUDA_LIBRARIES}" "/usr/local/cuda/lib64/stubs" "/usr/local/cuda/lib64" )
endif ( )

#-------------------------------------------------------------------------------
# configure files
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -493,13 +481,10 @@ endif ( )
# CHOLMOD_CUDA
if ( SUITESPARSE_CUDA )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( CHOLMOD PRIVATE CHOLMOD_CUDA ${CUDA_LIBRARIES} )
target_compile_definitions ( CHOLMOD PUBLIC "SUITESPARSE_CUDA" )
endif ( )
set ( CHOLMOD_STATIC_MODULES "${CHOLMOD_STATIC_MODULES} CHOLMOD_CUDA" )
set ( CHOLMOD_CFLAGS "${CHOLMOD_CFLAGS} -DSUITESPARSE_CUDA" )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( CHOLMOD_static PUBLIC CHOLMOD_CUDA_static ${CUDA_LIBRARIES} )
target_compile_definitions ( CHOLMOD_static PUBLIC "SUITESPARSE_CUDA" )
endif ( )
if ( BUILD_SHARED_LIBS )
Expand Down Expand Up @@ -529,6 +514,18 @@ if ( SUITESPARSE_CUDA )

endif ( )

#-------------------------------------------------------------------------------
# find CUDA
#-------------------------------------------------------------------------------

if ( SUITESPARSE_CUDA )
# with CUDA
add_subdirectory ( GPU )
message ( STATUS "CUDA libraries: " ${CUDA_LIBRARIES} )
include_directories ( GPU ${CUDAToolkit_INCLUDE_DIRS} )
link_directories ( "GPU" "${CUDA_LIBRARIES}" "/usr/local/cuda/lib64/stubs" "/usr/local/cuda/lib64" )
endif ( )

#-------------------------------------------------------------------------------
# CHOLMOD installation location
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -662,41 +659,17 @@ if ( DEMO )

# link the demos with shared libraries
target_link_libraries ( cholmod_di_simple PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_di_simple PUBLIC CHOLMOD_CUDA )
endif ( )
target_link_libraries ( cholmod_si_simple PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_si_simple PUBLIC CHOLMOD_CUDA )
endif ( )
target_link_libraries ( cholmod_dl_simple PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_dl_simple PUBLIC CHOLMOD_CUDA )
endif ( )
target_link_libraries ( cholmod_sl_simple PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_sl_simple PUBLIC CHOLMOD_CUDA )
endif ( )

else ( )

# link the demos with static libraries
target_link_libraries ( cholmod_di_simple PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_di_simple PUBLIC CHOLMOD_CUDA_static )
endif ( )
target_link_libraries ( cholmod_si_simple PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_si_simple PUBLIC CHOLMOD_CUDA_static )
endif ( )
target_link_libraries ( cholmod_dl_simple PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_dl_simple PUBLIC CHOLMOD_CUDA_static )
endif ( )
target_link_libraries ( cholmod_sl_simple PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_sl_simple PUBLIC CHOLMOD_CUDA_static )
endif ( )

endif ( )

Expand All @@ -718,41 +691,17 @@ if ( BUILD_SHARED_LIBS )

# link the tests with shared libraries
target_link_libraries ( cholmod_di_demo PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_di_demo PUBLIC CHOLMOD_CUDA )
endif ( )
target_link_libraries ( cholmod_si_demo PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_si_demo PUBLIC CHOLMOD_CUDA )
endif ( )
target_link_libraries ( cholmod_dl_demo PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_dl_demo PUBLIC CHOLMOD_CUDA )
endif ( )
target_link_libraries ( cholmod_sl_demo PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_sl_demo PUBLIC CHOLMOD_CUDA )
endif ( )

else ( )

# link the tests with static libraries
target_link_libraries ( cholmod_di_demo PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_di_demo PUBLIC CHOLMOD_CUDA_static )
endif ( )
target_link_libraries ( cholmod_si_demo PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_si_demo PUBLIC CHOLMOD_CUDA_static )
endif ( )
target_link_libraries ( cholmod_dl_demo PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_dl_demo PUBLIC CHOLMOD_CUDA_static )
endif ( )
target_link_libraries ( cholmod_sl_demo PUBLIC CHOLMOD_static SuiteSparse::SuiteSparseConfig )
if ( SUITESPARSE_CUDA )
target_link_libraries ( cholmod_sl_demo PUBLIC CHOLMOD_CUDA_static )
endif ( )

endif ( )

Expand Down
26 changes: 9 additions & 17 deletions CHOLMOD/Config/CHOLMODConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,19 @@ set ( CHOLMOD_VERSION "@CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_
include ( CMakeFindDependencyMacro )
set ( _dependencies_found ON )

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

if ( NOT CHOLMOD_CUDA_FOUND )
if ( @SUITESPARSE_IN_BUILD_TREE@ )
# First check in a common build tree
find_dependency ( CHOLMOD_CUDA @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@
PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH )
# Then, check in the currently active CMAKE_MODULE_PATH
if ( NOT CHOLMOD_CUDA_FOUND )
find_dependency ( CHOLMOD_CUDA @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ )
endif ( )
else ( )
find_dependency ( CHOLMOD_CUDA @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ )
endif ( )
endif ( )
if ( NOT CHOLMOD_CUDA_FOUND )
# Look for NVIDIA CUDA toolkit
if ( @SUITESPARSE_CUDA@ AND NOT CUDAToolkit_FOUND )
find_dependency ( CUDAToolkit @CUDAToolkit_VERSION_MAJOR@ )
if ( NOT CUDAToolkit_FOUND )
set ( _dependencies_found OFF )
endif ( )
endif ( )

if ( NOT _dependencies_found )
set ( CHOLMOD_FOUND OFF )
return ( )
endif ( )

# Look for SuiteSparse_config, COLAMD, and AMD targets
if ( @SUITESPARSE_IN_BUILD_TREE@ )
if ( NOT TARGET SuiteSparse::SuiteSparseConfig )
Expand Down
17 changes: 0 additions & 17 deletions CHOLMOD/Config/CHOLMOD_CUDA.pc.in

This file was deleted.

141 changes: 0 additions & 141 deletions CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in

This file was deleted.

Loading

0 comments on commit 0b41a3e

Please sign in to comment.