Skip to content

Commit

Permalink
Absorb CHOLMOD_CUDA module into CHOLMOD library
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Nov 29, 2023
1 parent ea2d215 commit c53fafb
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 378 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
21 changes: 0 additions & 21 deletions CHOLMOD/Config/CHOLMODConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,6 @@ 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 )
set ( _dependencies_found OFF )
endif ( )
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 c53fafb

Please sign in to comment.