Skip to content

Commit

Permalink
Example: Check if CUDA targets have been imported instead of configur…
Browse files Browse the repository at this point in the history
…ation flag
  • Loading branch information
mmuetzel committed Aug 29, 2023
1 parent 159fce6 commit 895f802
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,13 @@ cmake_policy ( SET CMP0048 NEW ) # VERSION variable policy
cmake_policy ( SET CMP0054 NEW ) # if ( expression ) handling policy
cmake_policy ( SET CMP0104 NEW ) # initialize CUDA architectures

option ( ENABLE_CUDA "Enable CUDA acceleration" on )

if ( WIN32 )
set ( CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS true )
endif ( )

set ( CMAKE_MACOSX_RPATH TRUE )
enable_language ( C CXX )
include ( GNUInstallDirs )
if ( ENABLE_CUDA )
enable_language ( CUDA )
endif ( )

# set the module path for all Find*.cmake files.
set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
Expand Down Expand Up @@ -84,7 +79,8 @@ find_package ( SPEX 2.2.0 REQUIRED )
find_package ( SPQR 4.2.0 REQUIRED )
find_package ( UMFPACK 6.2.0 REQUIRED )

if ( ENABLE_CUDA )
if ( TARGET CUDA::nvrtc )
# CHOLMOD has been compiled with CUDA enabled.
find_package ( CHOLMOD_CUDA 4.2.0 REQUIRED )
find_package ( SPQR_CUDA 4.2.0 REQUIRED )
find_package ( SuiteSparse_GPURuntime 3.2.0 REQUIRED )
Expand Down

0 comments on commit 895f802

Please sign in to comment.