Skip to content

Commit

Permalink
ENH: Add "Autoscoper-CUDA" external project and build it if CUDA Tool…
Browse files Browse the repository at this point in the history
…kit is found

If SlicerAutoscoperM_CUDA_PATH env. variable is set, it is used to set the
CUDA_PATH env. variable itself used by "find_package(CUDA)" to initialize
the variable CUDA_TOOLKIT_ROOT_DIR passed to the "Autoscoper-CUDA" project.

List of Autoscoper changes:

$ git shortlog d476e2cbb..644473784 --no-merges
Jean-Christophe Fillion-Robin (2):
      COMP: Update cutil headers to fix build against SDK without cufft library
      COMP: Ensure Autoscoper inner-build is built with expected CUDA toolkit
  • Loading branch information
jcfr committed Dec 17, 2023
1 parent 566a540 commit 619546b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions SuperBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ set(${proj}_DEPENDS
Autoscoper-OpenCL
)

if(DEFINED ENV{SlicerAutoscoperM_CUDA_PATH})
set(ENV{CUDA_PATH} $ENV{SlicerAutoscoperM_CUDA_PATH})
endif()

find_package(CUDA)
if(CUDA_FOUND)
# Variable expected by find_package(CUDA) also used in Autoscoper
mark_as_superbuild(VARS CUDA_TOOLKIT_ROOT_DIR PROJECTS Autoscoper-CUDA)
list(APPEND ${proj}_DEPENDS
Autoscoper-CUDA
)
endif()

ExternalProject_Include_Dependencies(${proj}
PROJECT_VAR proj
SUPERBUILD_VAR ${EXTENSION_NAME}_SUPERBUILD
Expand Down
3 changes: 3 additions & 0 deletions SuperBuild/External_Autoscoper-CUDA.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(proj Autoscoper-CUDA)
set(${proj}_RENDERING_BACKEND CUDA)
include(${CMAKE_CURRENT_LIST_DIR}/External_Autoscoper.cmake)
2 changes: 1 addition & 1 deletion SuperBuild/External_Autoscoper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if(NOT DEFINED ${proj}_DIR AND NOT ${SUPERBUILD_TOPLEVEL_PROJECT}_USE_SYSTEM_${p

ExternalProject_SetIfNotDefined(
Slicer_${proj}_GIT_TAG
"d476e2cbb4fc72a4dea5f4d467676bf9b978d8ce"
"644473784dd0018f5bf8518c5e5322092e4da07d"
QUIET
)

Expand Down

0 comments on commit 619546b

Please sign in to comment.