Skip to content

Commit

Permalink
Merge pull request #556 from mmuetzel/spqr
Browse files Browse the repository at this point in the history
Absorb SPQR_CUDA module into libspqr library
  • Loading branch information
DrTimothyAldenDavis authored Dec 1, 2023
2 parents 7777e42 + 46bcb02 commit 833495e
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 348 deletions.
21 changes: 10 additions & 11 deletions SPQR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ if ( SUITESPARSE_CUDA )
# with CUDA
add_subdirectory ( GPURuntime )
add_subdirectory ( GPUQREngine )
add_subdirectory ( SPQRGPU )
endif ( )

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -220,15 +219,15 @@ endif ( )

if ( SUITESPARSE_CUDA )
# CUDA
add_subdirectory ( SPQRGPU )

if ( BUILD_SHARED_LIBS )
target_link_libraries ( SPQR PRIVATE
SPQR_CUDA GPUQREngine GPURuntime )
target_link_libraries ( SPQR PRIVATE GPUQREngine GPURuntime )
target_compile_definitions ( SPQR PUBLIC "SUITESPARSE_CUDA" )
endif ( )
set ( SPQR_CFLAGS "-DSUITESPARSE_CUDA" )
if ( BUILD_STATIC_LIBS )
target_link_libraries ( SPQR_static PUBLIC
SPQR_CUDA_static GPUQREngine_static GPURuntime_static )
target_link_libraries ( SPQR_static PUBLIC GPUQREngine_static GPURuntime_static )
target_compile_definitions ( SPQR_static PUBLIC "SUITESPARSE_CUDA" )
endif ( )
endif ( )
Expand Down Expand Up @@ -409,13 +408,13 @@ if ( DEMO )

if ( SUITESPARSE_CUDA )
if ( BUILD_SHARED_LIBS )
target_link_libraries ( qrdemo_gpu PUBLIC SPQR SPQR_CUDA )
target_link_libraries ( qrdemo_gpu2 PUBLIC SPQR SPQR_CUDA )
target_link_libraries ( qrdemo_gpu3 PUBLIC SPQR SPQR_CUDA )
target_link_libraries ( qrdemo_gpu PUBLIC SPQR )
target_link_libraries ( qrdemo_gpu2 PUBLIC SPQR )
target_link_libraries ( qrdemo_gpu3 PUBLIC SPQR )
else ( )
target_link_libraries ( qrdemo_gpu PUBLIC SPQR_static SPQR_CUDA_static )
target_link_libraries ( qrdemo_gpu2 PUBLIC SPQR_static SPQR_CUDA_static )
target_link_libraries ( qrdemo_gpu3 PUBLIC SPQR_static SPQR_CUDA_static )
target_link_libraries ( qrdemo_gpu PUBLIC SPQR_static )
target_link_libraries ( qrdemo_gpu2 PUBLIC SPQR_static )
target_link_libraries ( qrdemo_gpu3 PUBLIC SPQR_static )
endif ( )
target_link_libraries ( qrdemo_gpu
PUBLIC SuiteSparse::CHOLMOD SuiteSparse::SuiteSparseConfig )
Expand Down
28 changes: 14 additions & 14 deletions SPQR/Config/SPQRConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ include ( CMakeFindDependencyMacro )

set ( _dependencies_found ON )

# 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 ( SPQR_FOUND OFF )
return ( )
endif ( )

# Look for SuiteSparse_config and CHOLMOD targets
if ( @SUITESPARSE_IN_BUILD_TREE@ )
if ( NOT TARGET SuiteSparse::SuiteSparseConfig )
Expand Down Expand Up @@ -98,28 +111,15 @@ if ( @SUITESPARSE_CUDA@ )
find_dependency ( GPUQREngine @SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@ )
endif ( )
endif ( )

if ( NOT SPQR_CUDA_FOUND )
# First check in a common build tree
find_dependency ( SPQR_CUDA ${SPQR_VERSION}
PATHS ${CMAKE_SOURCE_DIR}/../SPQR/build NO_DEFAULT_PATH )
# Then, check in the currently active CMAKE_MODULE_PATH
if ( NOT SPQR_CUDA_FOUND )
find_dependency ( SPQR_CUDA ${SPQR_VERSION} )
endif ( )
endif ( )
else ( )
if ( NOT SuiteSparse_GPURuntime_FOUND )
find_dependency ( SuiteSparse_GPURuntime @SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@ )
endif ( )
if ( NOT GPUQREngine_FOUND )
find_dependency ( GPUQREngine @SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@ )
endif ( )
if ( NOT SPQR_CUDA_FOUND )
find_dependency ( SPQR_CUDA ${SPQR_VERSION} )
endif ( )
endif ( )
if ( NOT SuiteSparse_GPURuntime_FOUND OR NOT GPUQREngine_FOUND OR NOT SPQR_CUDA_FOUND )
if ( NOT SuiteSparse_GPURuntime_FOUND OR NOT GPUQREngine_FOUND )
set ( _dependencies_found OFF )
endif ( )
endif ( )
Expand Down
19 changes: 0 additions & 19 deletions SPQR/Config/SPQR_CUDA.pc.in

This file was deleted.

163 changes: 0 additions & 163 deletions SPQR/Config/SPQR_CUDAConfig.cmake.in

This file was deleted.

Loading

0 comments on commit 833495e

Please sign in to comment.