From f204754437b66f61f09298d82245364451136d2d Mon Sep 17 00:00:00 2001 From: John Stairs Date: Tue, 21 Dec 2021 18:41:06 -0500 Subject: [PATCH] Compile all GPU code in toolboxes into a single library (#8) * Building * Remove duplicate link libraries * Add WIN32 defines * Revert "Added (temporary) workaround for thrust problem. Should be replaced with permanent fix" This reverts commit f20e58e5fbc60813c0b3ca01243959a71070526b. * Add comment * Revert user permissions workaround --- .../gpu/deblurring/2d/CMakeLists.txt | 6 +- .../gpu/deblurring/3d/CMakeLists.txt | 6 +- .../gpu/denoising/2d/CMakeLists.txt | 5 +- .../standalone/gpu/mri/nfft/2d/CMakeLists.txt | 8 +- .../gpu/mri/nfft/ms2d/CMakeLists.txt | 6 +- .../gpu/mri/sense/noncartesian/CMakeLists.txt | 2 +- .../radial/2d_golden_ratio/CMakeLists.txt | 8 +- .../radial/2d_golden_ratio_gui/CMakeLists.txt | 4 +- .../radial/2d_golden_ratio_kt/CMakeLists.txt | 2 +- .../gpu/registration/2d/CMakeLists.txt | 15 +- .../gpu/registration/3d/CMakeLists.txt | 5 +- gadgets/gpu/CMakeLists.txt | 2 +- gadgets/grappa/CMakeLists.txt | 5 +- gadgets/hyper/CMakeLists.txt | 10 +- gadgets/moco/CMakeLists.txt | 5 +- gadgets/mri_noncartesian/CMakeLists.txt | 5 +- gadgets/pmri/CMakeLists.txt | 7 +- gadgets/radial/CMakeLists.txt | 5 +- gadgets/spiral/CMakeLists.txt | 6 +- test/CMakeLists.txt | 4 +- toolboxes/CMakeLists.txt | 257 +++++++++++++++++- toolboxes/core/CMakeLists.txt | 4 - toolboxes/core/gpu/CMakeLists.txt | 91 ------- toolboxes/deblur/CMakeLists.txt | 4 +- toolboxes/dwt/CMakeLists.txt | 4 - toolboxes/dwt/gpu/CMakeLists.txt | 45 --- toolboxes/dwt/gpu/cuNDDWT.h | 2 +- toolboxes/fft/CMakeLists.txt | 6 - toolboxes/fft/gpu/CMakeLists.txt | 47 ---- toolboxes/fft/gpu/gpufft_export.h | 2 +- toolboxes/mri/CMakeLists.txt | 3 - toolboxes/mri/hyper/CMakeLists.txt | 39 --- .../hyper/gadgetron_toolbox_hyper_export.h | 2 +- toolboxes/mri/pmri/CMakeLists.txt | 4 - toolboxes/mri/pmri/gpu/CMakeLists.txt | 87 ------ toolboxes/mri/pmri/gpu/gpupmri_export.h | 2 +- toolboxes/mri/sdc/CMakeLists.txt | 3 - toolboxes/mri/sdc/gpu/CMakeLists.txt | 37 --- toolboxes/nfft/CMakeLists.txt | 4 - toolboxes/nfft/gpu/CMakeLists.txt | 48 ---- toolboxes/nfft/gpu/cuGriddingConvolution.cu | 44 ++- toolboxes/operators/CMakeLists.txt | 4 - toolboxes/operators/gpu/CMakeLists.txt | 70 ----- toolboxes/operators/gpu/gpuoperators_export.h | 2 +- .../registration/optical_flow/CMakeLists.txt | 5 - .../optical_flow/gpu/CMakeLists.txt | 47 ---- .../optical_flow/gpu/gpureg_export.h | 2 +- toolboxes/solvers/CMakeLists.txt | 4 - toolboxes/solvers/gpu/CMakeLists.txt | 53 ---- toolboxes/solvers/gpu/gpusolvers_export.h | 2 +- 50 files changed, 320 insertions(+), 720 deletions(-) delete mode 100644 toolboxes/core/gpu/CMakeLists.txt delete mode 100644 toolboxes/dwt/gpu/CMakeLists.txt delete mode 100644 toolboxes/fft/gpu/CMakeLists.txt delete mode 100644 toolboxes/mri/hyper/CMakeLists.txt delete mode 100644 toolboxes/mri/pmri/gpu/CMakeLists.txt delete mode 100644 toolboxes/mri/sdc/gpu/CMakeLists.txt delete mode 100644 toolboxes/nfft/gpu/CMakeLists.txt delete mode 100644 toolboxes/operators/gpu/CMakeLists.txt delete mode 100644 toolboxes/registration/optical_flow/gpu/CMakeLists.txt delete mode 100644 toolboxes/solvers/gpu/CMakeLists.txt diff --git a/apps/standalone/gpu/deblurring/2d/CMakeLists.txt b/apps/standalone/gpu/deblurring/2d/CMakeLists.txt index c429758cb..bc5d13918 100644 --- a/apps/standalone/gpu/deblurring/2d/CMakeLists.txt +++ b/apps/standalone/gpu/deblurring/2d/CMakeLists.txt @@ -6,9 +6,9 @@ add_executable(blur_2d blur_2d.cpp) add_executable(deblur_2d_cg deblur_2d_cg.cpp) add_executable(deblur_2d_sb deblur_2d_sb.cpp) -target_link_libraries(deblur_2d_cg gadgetron_toolbox_gpucore gadgetron_toolbox_hostutils gadgetron_toolbox_gpuoperators gadgetron_toolbox_gpusolvers ${CUDA_LIBRARIES}) -target_link_libraries(deblur_2d_sb gadgetron_toolbox_gpucore gadgetron_toolbox_hostutils gadgetron_toolbox_gpuoperators gadgetron_toolbox_gpusolvers ${CUDA_LIBRARIES}) -target_link_libraries(blur_2d gadgetron_toolbox_gpucore gadgetron_toolbox_hostutils gadgetron_toolbox_gpuoperators gadgetron_toolbox_gpusolvers ${CUDA_LIBRARIES}) +target_link_libraries(deblur_2d_cg gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(deblur_2d_sb gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(blur_2d gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) install(TARGETS blur_2d deblur_2d_cg deblur_2d_sb DESTINATION bin COMPONENT main) diff --git a/apps/standalone/gpu/deblurring/3d/CMakeLists.txt b/apps/standalone/gpu/deblurring/3d/CMakeLists.txt index 725bebae6..544e8b944 100644 --- a/apps/standalone/gpu/deblurring/3d/CMakeLists.txt +++ b/apps/standalone/gpu/deblurring/3d/CMakeLists.txt @@ -6,8 +6,8 @@ add_executable(blur_3d blur_3d.cpp) add_executable(deblur_3d_cg deblur_3d_cg.cpp) add_executable(deblur_3d_sb deblur_3d_sb.cpp) -target_link_libraries(deblur_3d_cg gadgetron_toolbox_gpucore gadgetron_toolbox_hostutils gadgetron_toolbox_gpuoperators gadgetron_toolbox_gpusolvers gadgetron_toolbox_gpunfft ${CUDA_LIBRARIES}) -target_link_libraries(deblur_3d_sb gadgetron_toolbox_gpucore gadgetron_toolbox_hostutils gadgetron_toolbox_gpuoperators gadgetron_toolbox_gpusolvers gadgetron_toolbox_gpunfft ${CUDA_LIBRARIES}) -target_link_libraries(blur_3d gadgetron_toolbox_gpucore gadgetron_toolbox_hostutils gadgetron_toolbox_gpuoperators gadgetron_toolbox_gpusolvers gadgetron_toolbox_gpunfft ${CUDA_LIBRARIES}) +target_link_libraries(deblur_3d_cg gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(deblur_3d_sb gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(blur_3d gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) install(TARGETS blur_3d deblur_3d_cg deblur_3d_sb DESTINATION bin COMPONENT main) diff --git a/apps/standalone/gpu/denoising/2d/CMakeLists.txt b/apps/standalone/gpu/denoising/2d/CMakeLists.txt index 99ca3dcdf..416f14d8b 100644 --- a/apps/standalone/gpu/denoising/2d/CMakeLists.txt +++ b/apps/standalone/gpu/denoising/2d/CMakeLists.txt @@ -6,11 +6,8 @@ include_directories(${CMAKE_SOURCE_DIR}/toolboxes/dwt/gpu) add_executable(denoise_TV denoise_TV.cpp) target_link_libraries(denoise_TV - gadgetron_toolbox_gpudwt - gadgetron_toolbox_gpucore + gadgetron_toolbox_gpu gadgetron_toolbox_hostutils - gadgetron_toolbox_gpusolvers - gadgetron_toolbox_gpuoperators ${CUDA_LIBRARIES}) install(TARGETS denoise_TV DESTINATION bin COMPONENT main) diff --git a/apps/standalone/gpu/mri/nfft/2d/CMakeLists.txt b/apps/standalone/gpu/mri/nfft/2d/CMakeLists.txt index 36fd0a505..1f987fc4a 100644 --- a/apps/standalone/gpu/mri/nfft/2d/CMakeLists.txt +++ b/apps/standalone/gpu/mri/nfft/2d/CMakeLists.txt @@ -8,10 +8,10 @@ add_executable(nffth_2d_radial main_nffth.cpp) add_executable(nffth_cg_2d_radial main_cg.cpp) add_executable(nffth_sb_2d_radial main_sb.cpp) -target_link_libraries(nfft_2d_radial gadgetron_toolbox_gpucore gadgetron_toolbox_gpuoperators gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) -target_link_libraries(nffth_2d_radial gadgetron_toolbox_gpucore gadgetron_toolbox_gpuoperators gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(nfft_2d_radial gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(nffth_2d_radial gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) #target_link_libraries(moco gpusolvers gpureg gpucore gpuparallelmri gpuoperators gpunfft hostutils ${CUDA_LIBRARIES}) -target_link_libraries(nffth_cg_2d_radial gadgetron_toolbox_gpusolvers gadgetron_toolbox_gpuoperators gadgetron_toolbox_gpucore gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) -target_link_libraries(nffth_sb_2d_radial gadgetron_toolbox_gpusolvers gadgetron_toolbox_gpuoperators gadgetron_toolbox_gpucore gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(nffth_cg_2d_radial gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(nffth_sb_2d_radial gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) install(TARGETS nfft_2d_radial nffth_2d_radial nffth_cg_2d_radial nffth_sb_2d_radial DESTINATION bin COMPONENT main) diff --git a/apps/standalone/gpu/mri/nfft/ms2d/CMakeLists.txt b/apps/standalone/gpu/mri/nfft/ms2d/CMakeLists.txt index a2600e820..7d7f2ed8f 100644 --- a/apps/standalone/gpu/mri/nfft/ms2d/CMakeLists.txt +++ b/apps/standalone/gpu/mri/nfft/ms2d/CMakeLists.txt @@ -2,8 +2,8 @@ add_executable(nfft_2d_ms_radial nfft_main.cpp) add_executable(nffth_2d_ms_radial nffth_main.cpp) add_executable(nffth_2d_ms_generic nffth_generic.cpp) -target_link_libraries(nfft_2d_ms_radial gadgetron_toolbox_gpucore gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) -target_link_libraries(nffth_2d_ms_radial gadgetron_toolbox_gpucore gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) -target_link_libraries(nffth_2d_ms_generic gadgetron_toolbox_gpucore gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(nfft_2d_ms_radial gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(nffth_2d_ms_radial gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(nffth_2d_ms_generic gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) install(TARGETS nfft_2d_ms_radial nffth_2d_ms_radial nffth_2d_ms_generic DESTINATION bin COMPONENT main) diff --git a/apps/standalone/gpu/mri/sense/noncartesian/CMakeLists.txt b/apps/standalone/gpu/mri/sense/noncartesian/CMakeLists.txt index c319e2b69..ddcb91bd3 100644 --- a/apps/standalone/gpu/mri/sense/noncartesian/CMakeLists.txt +++ b/apps/standalone/gpu/mri/sense/noncartesian/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories( add_executable(sense_cg_generic_2d generic_cg.cpp) -target_link_libraries(sense_cg_generic_2d gadgetron_toolbox_gpuoperators gadgetron_toolbox_cpucore gadgetron_toolbox_gpucore gadgetron_toolbox_gpuparallelmri gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils gadgetron_toolbox_gpusolvers ${CUDA_LIBRARIES}) +target_link_libraries(sense_cg_generic_2d gadgetron_toolbox_gpu gadgetron_toolbox_cpucore gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) install(TARGETS sense_cg_generic_2d DESTINATION bin COMPONENT main) diff --git a/apps/standalone/gpu/mri/sense/noncartesian/radial/2d_golden_ratio/CMakeLists.txt b/apps/standalone/gpu/mri/sense/noncartesian/radial/2d_golden_ratio/CMakeLists.txt index 0b5b049d1..b262d7188 100644 --- a/apps/standalone/gpu/mri/sense/noncartesian/radial/2d_golden_ratio/CMakeLists.txt +++ b/apps/standalone/gpu/mri/sense/noncartesian/radial/2d_golden_ratio/CMakeLists.txt @@ -3,9 +3,9 @@ add_executable(sense_sbc_radial_2d main_sbc.cpp) add_executable(sense_gpbb_radial_2d main_gpbb.cpp) add_executable(sense_nlcg_radial_2d main_nlcg.cpp) -target_link_libraries(sense_cg_radial_2d gadgetron_toolbox_gpuoperators gadgetron_toolbox_cpucore gadgetron_toolbox_gpucore gadgetron_toolbox_gpuparallelmri gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils gadgetron_toolbox_gpusolvers ${CUDA_LIBRARIES}) -target_link_libraries(sense_sbc_radial_2d gadgetron_toolbox_gpuoperators gadgetron_toolbox_cpucore gadgetron_toolbox_gpucore gadgetron_toolbox_gpuparallelmri gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils gadgetron_toolbox_gpusolvers ${CUDA_LIBRARIES}) -target_link_libraries(sense_gpbb_radial_2d gadgetron_toolbox_gpuoperators gadgetron_toolbox_cpucore gadgetron_toolbox_gpucore gadgetron_toolbox_gpuparallelmri gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils gadgetron_toolbox_gpusolvers ${CUDA_LIBRARIES}) -target_link_libraries(sense_nlcg_radial_2d gadgetron_toolbox_gpuoperators gadgetron_toolbox_cpucore gadgetron_toolbox_gpucore gadgetron_toolbox_gpuparallelmri gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils gadgetron_toolbox_gpusolvers ${CUDA_LIBRARIES}) +target_link_libraries(sense_cg_radial_2d gadgetron_toolbox_gpu gadgetron_toolbox_cpucore gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(sense_sbc_radial_2d gadgetron_toolbox_gpu gadgetron_toolbox_cpucore gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(sense_gpbb_radial_2d gadgetron_toolbox_gpu gadgetron_toolbox_cpucore gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) +target_link_libraries(sense_nlcg_radial_2d gadgetron_toolbox_gpu gadgetron_toolbox_cpucore gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) install(TARGETS sense_cg_radial_2d sense_sbc_radial_2d sense_gpbb_radial_2d sense_nlcg_radial_2d DESTINATION bin COMPONENT main) diff --git a/apps/standalone/gpu/mri/sense/noncartesian/radial/2d_golden_ratio_gui/CMakeLists.txt b/apps/standalone/gpu/mri/sense/noncartesian/radial/2d_golden_ratio_gui/CMakeLists.txt index 4255e2f6e..8b4dd5968 100644 --- a/apps/standalone/gpu/mri/sense/noncartesian/radial/2d_golden_ratio_gui/CMakeLists.txt +++ b/apps/standalone/gpu/mri/sense/noncartesian/radial/2d_golden_ratio_gui/CMakeLists.txt @@ -19,8 +19,8 @@ qt4_wrap_cpp (UI_MOC_OUTFILES ${UI_MOC_HEADERS}) add_executable(sense_2d_golden_radial_gui main.cpp ${UI_MOC_OUTFILES} radialSenseAppMainWidget.cpp reconWidget.cpp GLReconWidget.cpp ${UI_HEADERS} ) -target_link_libraries(sense_2d_golden_radial_gui gadgetron_toolbox_gpucore gadgetron_toolbox_gpuparallelmri -gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils gadgetron_toolbox_gpusolvers gpuoperators ${CUDA_LIBRARIES} ${QT_QTGUI_LIBRARY} ${GLEW_LIBRARY} +target_link_libraries(sense_2d_golden_radial_gui gadgetron_toolbox_gpu +gadgetron_toolbox_hostutils gpuoperators ${CUDA_LIBRARIES} ${QT_QTGUI_LIBRARY} ${GLEW_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ) if (WIN32) diff --git a/apps/standalone/gpu/mri/sense/noncartesian/radial/2d_golden_ratio_kt/CMakeLists.txt b/apps/standalone/gpu/mri/sense/noncartesian/radial/2d_golden_ratio_kt/CMakeLists.txt index 5826cb53f..596eab4a2 100644 --- a/apps/standalone/gpu/mri/sense/noncartesian/radial/2d_golden_ratio_kt/CMakeLists.txt +++ b/apps/standalone/gpu/mri/sense/noncartesian/radial/2d_golden_ratio_kt/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(ktsense_radial_2d main.cpp) -target_link_libraries(ktsense_radial_2d gadgetron_toolbox_gpucore gadgetron_toolbox_gpuparallelmri gadgetron_toolbox_gpuoperators gadgetron_toolbox_gpunfft gadgetron_toolbox_hostutils gadgetron_toolbox_gpusolvers ${CUDA_LIBRARIES}) +target_link_libraries(ktsense_radial_2d gadgetron_toolbox_gpu gadgetron_toolbox_hostutils ${CUDA_LIBRARIES}) install(TARGETS ktsense_radial_2d DESTINATION bin COMPONENT main) diff --git a/apps/standalone/gpu/registration/2d/CMakeLists.txt b/apps/standalone/gpu/registration/2d/CMakeLists.txt index 9d33eb755..98987ac08 100644 --- a/apps/standalone/gpu/registration/2d/CMakeLists.txt +++ b/apps/standalone/gpu/registration/2d/CMakeLists.txt @@ -9,19 +9,13 @@ include_directories( target_link_libraries(register_HS_2d_gpu gadgetron_toolbox_hostutils - gadgetron_toolbox_gpureg - gadgetron_toolbox_gpucore - gadgetron_toolbox_gpuoperators - gadgetron_toolbox_gpusolvers + gadgetron_toolbox_gpu ${CUDA_LIBRARIES} ) target_link_libraries(register_CK_2d_gpu gadgetron_toolbox_hostutils - gadgetron_toolbox_gpureg - gadgetron_toolbox_gpucore - gadgetron_toolbox_gpuoperators - gadgetron_toolbox_gpusolvers + gadgetron_toolbox_gpu ${CUDA_LIBRARIES} ) @@ -38,10 +32,7 @@ target_link_libraries(register_CK_2d_gpu target_link_libraries(register_CGHS_2d_gpu gadgetron_toolbox_hostutils - gadgetron_toolbox_gpureg - gadgetron_toolbox_gpucore - gadgetron_toolbox_gpuoperators - gadgetron_toolbox_gpusolvers + gadgetron_toolbox_gpu ${CUDA_LIBRARIES} ) diff --git a/apps/standalone/gpu/registration/3d/CMakeLists.txt b/apps/standalone/gpu/registration/3d/CMakeLists.txt index 3980478c7..5e6a4580d 100644 --- a/apps/standalone/gpu/registration/3d/CMakeLists.txt +++ b/apps/standalone/gpu/registration/3d/CMakeLists.txt @@ -2,10 +2,7 @@ add_executable(register_CK_3d_gpu register_CK_3d.cpp) target_link_libraries(register_CK_3d_gpu gadgetron_toolbox_hostutils - gadgetron_toolbox_gpureg - gadgetron_toolbox_gpucore - gadgetron_toolbox_gpuoperators - gadgetron_toolbox_gpusolvers + gadgetron_toolbox_gpu ${CUDA_LIBRARIES} ) diff --git a/gadgets/gpu/CMakeLists.txt b/gadgets/gpu/CMakeLists.txt index 8d55f0a26..f23c6e34c 100644 --- a/gadgets/gpu/CMakeLists.txt +++ b/gadgets/gpu/CMakeLists.txt @@ -10,7 +10,7 @@ set_target_properties(gadgetron_gpugadget PROPERTIES VERSION ${GADGETRON_VERSION target_link_libraries(gadgetron_gpugadget gadgetron_core - gadgetron_toolbox_gpunfft) + gadgetron_toolbox_gpu) install(FILES cuFFTGadget.h diff --git a/gadgets/grappa/CMakeLists.txt b/gadgets/grappa/CMakeLists.txt index 7a045da7c..5ba6f5416 100644 --- a/gadgets/grappa/CMakeLists.txt +++ b/gadgets/grappa/CMakeLists.txt @@ -36,9 +36,8 @@ target_link_libraries(gadgetron_grappa if (CUDA_FOUND) target_link_libraries(gadgetron_grappa - gadgetron_toolbox_gpunfft - gadgetron_toolbox_gpucore - gadgetron_toolbox_gpuparallelmri) + gadgetron_toolbox_gpu + ) endif() install(TARGETS gadgetron_grappa diff --git a/gadgets/hyper/CMakeLists.txt b/gadgets/hyper/CMakeLists.txt index 9af5d392c..8775db624 100644 --- a/gadgets/hyper/CMakeLists.txt +++ b/gadgets/hyper/CMakeLists.txt @@ -18,16 +18,10 @@ target_link_libraries(gadgetron_hyper gadgetron_core gadgetron_mricore gadgetron_gpuparallelmri - gadgetron_toolbox_gpunfft - gadgetron_toolbox_gpucore + gadgetron_toolbox_gpu gadgetron_toolbox_cpucore gadgetron_toolbox_cpufft - gadgetron_toolbox_gpudwt - gadgetron_toolbox_cpucore_math - gadgetron_toolbox_gpusolvers - gadgetron_toolbox_gpuoperators - gadgetron_toolbox_gpuparallelmri - gadgetron_toolbox_hyper) + gadgetron_toolbox_cpucore_math) install(FILES diff --git a/gadgets/moco/CMakeLists.txt b/gadgets/moco/CMakeLists.txt index b2d346bfd..868fb53cd 100644 --- a/gadgets/moco/CMakeLists.txt +++ b/gadgets/moco/CMakeLists.txt @@ -8,7 +8,7 @@ if (CUDA_FOUND) list(APPEND GPU_GADGETS gpuRegistrationAveragingGadget.cpp gpuRegistrationScatteringGadget.cpp) - list(APPEND GPU_LIBS gadgetron_toolbox_gpucore gadgetron_toolbox_gpureg ${CUDA_LIBRARIES}) + list(APPEND GPU_LIBS gadgetron_toolbox_gpu ${CUDA_LIBRARIES}) add_library(gadgetron_moco SHARED @@ -27,8 +27,7 @@ if (CUDA_FOUND) target_link_libraries(gadgetron_moco gadgetron_core gadgetron_toolbox_cpucore gadgetron_mricore - gadgetron_toolbox_gpucore - gadgetron_toolbox_gpureg + gadgetron_toolbox_gpu ) install(TARGETS gadgetron_moco diff --git a/gadgets/mri_noncartesian/CMakeLists.txt b/gadgets/mri_noncartesian/CMakeLists.txt index 648907ae9..4c705c560 100644 --- a/gadgets/mri_noncartesian/CMakeLists.txt +++ b/gadgets/mri_noncartesian/CMakeLists.txt @@ -49,10 +49,7 @@ target_link_libraries(gadgetron_mri_noncartesian ) if(CUDA_FOUND) target_link_libraries(gadgetron_mri_noncartesian - gadgetron_toolbox_gpucore - gadgetron_toolbox_gpusolvers - gadgetron_toolbox_gpuoperators - gadgetron_toolbox_gpuparallelmri + gadgetron_toolbox_gpu ) endif() diff --git a/gadgets/pmri/CMakeLists.txt b/gadgets/pmri/CMakeLists.txt index 47b77a66c..b799639af 100644 --- a/gadgets/pmri/CMakeLists.txt +++ b/gadgets/pmri/CMakeLists.txt @@ -32,12 +32,9 @@ target_link_libraries(gadgetron_gpuparallelmri gadgetron_mricore gadgetron_toolbox_log gadgetron_toolbox_cpucore - gadgetron_toolbox_gpudwt - gadgetron_toolbox_gpucore - gadgetron_toolbox_gpusolvers - gadgetron_toolbox_gpuoperators) + gadgetron_toolbox_gpu) -target_link_libraries(gadgetron_gpuparallelmri gadgetron_toolbox_gpuparallelmri) +target_link_libraries(gadgetron_gpuparallelmri gadgetron_toolbox_gpu) target_include_directories(gadgetron_gpuparallelmri PUBLIC diff --git a/gadgets/radial/CMakeLists.txt b/gadgets/radial/CMakeLists.txt index af4520103..d0107a88b 100644 --- a/gadgets/radial/CMakeLists.txt +++ b/gadgets/radial/CMakeLists.txt @@ -20,12 +20,9 @@ target_link_libraries(gadgetron_gpuradial gadgetron_mricore gadgetron_toolbox_log gadgetron_gpuparallelmri - gadgetron_toolbox_gpunfft - gadgetron_toolbox_gpusolvers - gadgetron_toolbox_gpuoperators gadgetron_toolbox_cpucore gadgetron_toolbox_cpucore_math - gadgetron_toolbox_gpucore) + gadgetron_toolbox_gpu) install (FILES gadgetron_radial_export.h gpuRadialPrepGadget.h diff --git a/gadgets/spiral/CMakeLists.txt b/gadgets/spiral/CMakeLists.txt index 0a1fc904b..27990cd64 100644 --- a/gadgets/spiral/CMakeLists.txt +++ b/gadgets/spiral/CMakeLists.txt @@ -23,12 +23,8 @@ target_link_libraries(gadgetron_spiral if (CUDA_FOUND) target_link_libraries(gadgetron_spiral gadgetron_gpuparallelmri - gadgetron_toolbox_gpucore + gadgetron_toolbox_gpu gadgetron_core - gadgetron_toolbox_gpunfft - gadgetron_toolbox_gpusolvers - gadgetron_toolbox_gpuoperators - gadgetron_toolbox_gpuparallelmri gadgetron_toolbox_deblur ) endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c78e9e7c4..d628dd3cb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -58,9 +58,7 @@ include(GoogleTest) if (CUDA_FOUND) target_link_libraries(test_all - gadgetron_toolbox_gpucore - gadgetron_toolbox_gpufft - gadgetron_toolbox_gpusdc + gadgetron_toolbox_gpu ) endif () target_link_libraries(test_all diff --git a/toolboxes/CMakeLists.txt b/toolboxes/CMakeLists.txt index 66d7c4f04..022f79245 100644 --- a/toolboxes/CMakeLists.txt +++ b/toolboxes/CMakeLists.txt @@ -42,4 +42,259 @@ if (ARMADILLO_FOUND AND Boost_FOUND AND PLPLOT_FOUND) add_subdirectory(plplot) endif () -set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file +set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) + +if(CUDA_FOUND) + # We compile all GPU code into one library to workaround Thrust and Cub using statics in templates + # (e.g. https://github.com/NVIDIA/cub/blob/48768e86a40c25d231a6ff1e04107a60016314a7/cub/util_device.cuh#L208) + # that when used from multiple libraries can cause crashes. + # See https://github.com/NVIDIA/thrust/issues/1401 for more information. + if (WIN32) + add_definitions(-D__BUILD_GADGETRON_GPU__) + add_definitions(-D_USE_MATH_DEFINES) + add_definitions(-DWIN32_LEAN_AND_MEAN) + + link_directories(${Boost_LIBRARY_DIRS}) + endif () + + cuda_add_library(gadgetron_toolbox_gpu SHARED + core/gpu/check_CUDA.h + core/gpu/CUBLASContextProvider.cpp + core/gpu/CUBLASContextProvider.h + core/gpu/cudaDeviceManager.cpp + core/gpu/cudaDeviceManager.h + core/gpu/cuNDArray_blas.cu + core/gpu/cuNDArray_blas.h + core/gpu/cuNDArray_elemwise.cu + core/gpu/cuNDArray_elemwise.h + core/gpu/cuNDArray_fileio.h + core/gpu/cuNDArray_operators.cu + core/gpu/cuNDArray_operators.h + core/gpu/cuNDArray_reductions.cu + core/gpu/cuNDArray_reductions.h + core/gpu/cuNDArray_utils.cu + core/gpu/cuNDArray_utils.h + core/gpu/cuNDArray.h + core/gpu/cuSparseMatrix.cu + core/gpu/GadgetronCuException.h + core/gpu/GPUTimer.h + core/gpu/hoCuNDArray_blas.cpp + core/gpu/hoCuNDArray_blas.h + core/gpu/hoCuNDArray_elemwise.h + core/gpu/hoCuNDArray_utils.h + core/gpu/hoCuNDArray.h + core/gpu/radial_utilities.cu + core/gpu/radial_utilities.h + core/gpu/real_utilities_device.h + core/gpu/setup_grid.h + dwt/gpu/cuNDDWT.cu + dwt/gpu/cuNDDWT.h + fft/gpu/cuFFTCachedPlan.h + fft/gpu/cuFFTPlan.h + fft/gpu/cuFFTPlan.hpp + fft/gpu/cuNDFFT.cpp + fft/gpu/cuNDFFT.cu + fft/gpu/cuNDFFT.h + mri/hyper/CSI_utils.cu + mri/hyper/CSI_utils.h + mri/hyper/CSIOperator.cpp + mri/hyper/CSIOperator.h + mri/hyper/gadgetron_toolbox_hyper_export.h + mri/pmri/gpu/b1_map_NIH_Souheil.cu + mri/pmri/gpu/b1_map.cu + mri/pmri/gpu/b1_map.h + mri/pmri/gpu/cuBuffer.cpp + mri/pmri/gpu/cuBuffer.h + mri/pmri/gpu/cuCartesianSenseOperator.cu + mri/pmri/gpu/cuCartesianSenseOperator.h + mri/pmri/gpu/cuNonCartesianKtSenseOperator.cu + mri/pmri/gpu/cuNonCartesianKtSenseOperator.h + mri/pmri/gpu/cuNonCartesianSenseOperator.cu + mri/pmri/gpu/cuNonCartesianSenseOperator.h + mri/pmri/gpu/cuSenseBuffer.cpp + mri/pmri/gpu/cuSenseBuffer.h + mri/pmri/gpu/cuSenseBufferCg.cpp + mri/pmri/gpu/cuSenseBufferCg.h + mri/pmri/gpu/cuSenseOperator.cu + mri/pmri/gpu/cuSenseOperator.h + mri/pmri/gpu/cuSpiritBuffer.cpp + mri/pmri/gpu/cuSpiritOperator.h + mri/pmri/gpu/gpupmri_export.h + mri/pmri/gpu/htgrappa.cpp + mri/pmri/gpu/htgrappa.cu + mri/pmri/gpu/htgrappa.h + mri/pmri/gpu/sense_utilities.cu + mri/pmri/gpu/sense_utilities.h + mri/pmri/gpu/senseOperator.h + mri/pmri/gpu/spirit_calibration.cu + mri/pmri/gpu/spirit_calibration.h + mri/pmri/gpu/trajectory_utils.cu + mri/pmri/gpu/trajectory_utils.h + mri/sdc/gpu/cuSDC.cu + nfft/gpu/cuGriddingConvolution.cu + nfft/gpu/cuGriddingConvolution.h + nfft/gpu/cuNFFT.cu + nfft/gpu/cuNFFT.h + nfft/gpu/cuNFFTOperator.cpp + operators/gpu/../generalOperator.h + operators/gpu/../linearOperator.h + operators/gpu/cuConvolutionOperator.cu + operators/gpu/cuConvolutionOperator.h + operators/gpu/cuLaplaceOperator.cu + operators/gpu/cuLaplaceOperator.h + operators/gpu/cuPartialDerivativeOperator.cu + operators/gpu/cuPartialDerivativeOperator.h + operators/gpu/cuPartialDerivativeOperator2.cu + operators/gpu/cuTv1dOperator.cu + operators/gpu/cuTv1dOperator.h + operators/gpu/cuTvOperator.cu + operators/gpu/cuTvOperator.h + registration/optical_flow/gpu/cuCKOpticalFlowSolver.cu + registration/optical_flow/gpu/cuHSOpticalFlowSolver.cu + registration/optical_flow/gpu/cuLinearResampleOperator.cu + registration/optical_flow/gpu/cuOpticalFlowSolver.cu + registration/optical_flow/gpu/cuResampleOperator.cu + solvers/gpu/cuSolverUtils.cu + solvers/gpu/gpusolvers_export.h + ) + + target_include_directories(gadgetron_toolbox_gpu + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/core/gpu + ${CMAKE_CURRENT_SOURCE_DIR}/dwt/gpu/ + ${CMAKE_CURRENT_SOURCE_DIR}/fft/gpu + ${CMAKE_CURRENT_SOURCE_DIR}/mri/hyper + ${CMAKE_CURRENT_SOURCE_DIR}/mri/pmri/gpu + ${CMAKE_CURRENT_SOURCE_DIR}/nfft/gpu + ${CMAKE_CURRENT_SOURCE_DIR}/operators/gpu + ${CMAKE_CURRENT_SOURCE_DIR}/registration/optical_flow/ + ${CMAKE_CURRENT_SOURCE_DIR}/registration/optical_flow/gpu + ${CMAKE_CURRENT_SOURCE_DIR}/mri/sdc/gpu + ${CMAKE_CURRENT_SOURCE_DIR}/solvers + ${CMAKE_CURRENT_SOURCE_DIR}/solvers/gpu + ) + + set_target_properties(gadgetron_toolbox_gpu PROPERTIES VERSION ${GADGETRON_VERSION_STRING} SOVERSION ${GADGETRON_SOVERSION}) + + target_link_libraries(gadgetron_toolbox_gpu + gadgetron_toolbox_cpucore + gadgetron_toolbox_cpucore_math + gadgetron_toolbox_log + gadgetron_toolbox_nfft + gadgetron_toolbox_operator + gadgetron_toolbox_sdc + ${CUDA_LIBRARIES} + ${CUDA_CUFFT_LIBRARIES} + ${CUDA_CUBLAS_LIBRARIES} + ${CUDA_CUSPARSE_LIBRARIES} + ${MKL_LIBRARIES} + ) + + + install(TARGETS gadgetron_toolbox_gpu + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + COMPONENT main + ) + + install(FILES + core/gpu/check_CUDA.h + core/gpu/CUBLASContextProvider.h + core/gpu/cudaDeviceManager.h + core/gpu/cuNDArray_blas.h + core/gpu/cuNDArray_converter.h + core/gpu/cuNDArray_elemwise.h + core/gpu/cuNDArray_fileio.h + core/gpu/cuNDArray_math.h + core/gpu/cuNDArray_operators.h + core/gpu/cuNDArray_reductions.h + core/gpu/cuNDArray_utils.h + core/gpu/cuNDArray.h + core/gpu/cuSparseMatrix.h + core/gpu/GadgetronCuException.h + core/gpu/GPUTimer.h + core/gpu/hoCuNDArray_blas.h + core/gpu/hoCuNDArray_elemwise.h + core/gpu/hoCuNDArray_math.h + core/gpu/hoCuNDArray_utils.h + core/gpu/hoCuNDArray.h + core/gpu/radial_utilities.h + core/gpu/real_utilities_device.h + core/gpu/setup_grid.h + dwt/gpu/cuDWTOperator.h + dwt/gpu/cuNDDWT.h + fft/gpu/cuFFTCachedPlan.h + fft/gpu/cuFFTCachedPlan.hpp + fft/gpu/cuFFTPlan.h + fft/gpu/cuFFTPlan.hpp + fft/gpu/cuNDFFT.h + fft/gpu/gpufft_export.h + mri/hyper/CSI_utils.h + mri/hyper/CSIOperator.h + mri/pmri/gpu/b1_map.h + mri/pmri/gpu/cuBuffer.h + mri/pmri/gpu/cuCartesianSenseOperator.h + mri/pmri/gpu/cuNonCartesianKtSenseOperator.h + mri/pmri/gpu/cuNonCartesianSenseOperator.h + mri/pmri/gpu/cuSenseBuffer.h + mri/pmri/gpu/cuSenseBufferCg.h + mri/pmri/gpu/cuSenseOperator.h + mri/pmri/gpu/cuSpiritBuffer.h + mri/pmri/gpu/cuSpiritOperator.h + mri/pmri/gpu/gpupmri_export.h + mri/pmri/gpu/htgrappa.h + mri/pmri/gpu/sense_utilities.h + mri/pmri/gpu/senseOperator.h + mri/sdc/gpu/cuSDC.h + nfft/gpu/cuGriddingConvolution.h + nfft/gpu/cuNFFT.h + operators/gpu/cuConvolutionOperator.h + operators/gpu/cuDiagonalOperator.h + operators/gpu/cuDiagonalSumOperator.h + operators/gpu/cuDownsampleOperator.h + operators/gpu/cuFFTOperator.h + operators/gpu/cuImageOperator.h + operators/gpu/cuLaplaceOperator.h + operators/gpu/cuPartialDerivativeOperator.h + operators/gpu/cuPartialDerivativeOperator2.h + operators/gpu/cuTv1dOperator.h + operators/gpu/cuTvOperator.h + operators/gpu/cuTvPicsOperator.h + operators/gpu/cuUpsampleOperator.h + operators/gpu/gpuoperators_export.h + operators/gpu/hoCuEncodingOperatorContainer.h + operators/gpu/hoCuIdentityOperator.h + operators/gpu/hoCuOperator.h + operators/gpu/hoCuPartialDerivativeOperator.h + operators/gpu/hoCuTvOperator.h + operators/gpu/hoCuTvPicsOperator.h + registration/optical_flow/gpu/cuCGHSOFSolver.h + registration/optical_flow/gpu/cuCKOpticalFlowSolver.h + registration/optical_flow/gpu/cuHSOpticalFlowSolver.h + registration/optical_flow/gpu/cuLinearResampleOperator.h + registration/optical_flow/gpu/cuOpticalFlowSolver.h + registration/optical_flow/gpu/cuResampleOperator.h + registration/optical_flow/gpu/gpureg_export.h + solvers/gpu/cuCgPreconditioner.h + solvers/gpu/cuCgSolver.h + solvers/gpu/cuGpBbSolver.h + solvers/gpu/cuLbfgsSolver.h + solvers/gpu/cuLwSolver.h + solvers/gpu/cuNlcgSolver.h + solvers/gpu/cuSbcCgSolver.h + solvers/gpu/cuSbCgSolver.h + solvers/gpu/cuSbcLwSolver.h + solvers/gpu/cuSbLwSolver.h + solvers/gpu/cuSolverUtils.h + solvers/gpu/gpusolvers_export.h + solvers/gpu/hoCuCgSolver.h + solvers/gpu/hoCuGpBbSolver.h + solvers/gpu/hoCuNlcgSolver.h + solvers/gpu/hoCuSbcCgSolver.h + DESTINATION ${GADGETRON_INSTALL_INCLUDE_PATH} COMPONENT main) + +else() + message("CUDA not found, not compiling gpu toolbox") +endif() \ No newline at end of file diff --git a/toolboxes/core/CMakeLists.txt b/toolboxes/core/CMakeLists.txt index b017bd98c..79e0f7ece 100644 --- a/toolboxes/core/CMakeLists.txt +++ b/toolboxes/core/CMakeLists.txt @@ -18,8 +18,4 @@ install(FILES add_subdirectory(cpu) -if (CUDA_FOUND) - add_subdirectory(gpu) -endif () - set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/core/gpu/CMakeLists.txt b/toolboxes/core/gpu/CMakeLists.txt deleted file mode 100644 index 7e80c4bec..000000000 --- a/toolboxes/core/gpu/CMakeLists.txt +++ /dev/null @@ -1,91 +0,0 @@ -if(WIN32) - link_directories(${Boost_LIBRARY_DIRS}) -endif() - - -cuda_add_library(gadgetron_toolbox_gpucore SHARED - check_CUDA.h - CUBLASContextProvider.h - cudaDeviceManager.h - cuNDArray.h - cuNDArray_blas.h - cuNDArray_elemwise.h - cuNDArray_operators.h - cuNDArray_utils.h - cuNDArray_fileio.h - cuNDArray_reductions.h - GadgetronCuException.h - GPUTimer.h - hoCuNDArray.h - hoCuNDArray_blas.h - hoCuNDArray_elemwise.h - hoCuNDArray_utils.h - radial_utilities.h - real_utilities_device.h - setup_grid.h - cuNDArray_operators.cu - cuNDArray_elemwise.cu - cuNDArray_blas.cu - cuNDArray_utils.cu - cuNDArray_reductions.cu - radial_utilities.cu - hoCuNDArray_blas.cpp - CUBLASContextProvider.cpp - cudaDeviceManager.cpp - cuSparseMatrix.cu - ) - -set_target_properties(gadgetron_toolbox_gpucore PROPERTIES VERSION ${GADGETRON_VERSION_STRING} SOVERSION ${GADGETRON_SOVERSION}) - -target_link_libraries(gadgetron_toolbox_gpucore - gadgetron_toolbox_cpucore - gadgetron_toolbox_log - ${CUDA_LIBRARIES} - ${CUDA_CUFFT_LIBRARIES} - ${CUDA_CUBLAS_LIBRARIES} - ${CUDA_CUSPARSE_LIBRARIES} - ${MKL_LIBRARIES} - ) - -target_include_directories(gadgetron_toolbox_gpucore - PUBLIC - $ - $ -) - - -install(TARGETS gadgetron_toolbox_gpucore - EXPORT gadgetron-export - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - COMPONENT main -) - -install(FILES - cuNDArray.h - cuNDArray_operators.h - cuNDArray_elemwise.h - cuNDArray_blas.h - cuNDArray_utils.h - cuNDArray_math.h - cuNDArray_fileio.h - cuNDArray_reductions.h - hoCuNDArray.h - hoCuNDArray_blas.h - hoCuNDArray_elemwise.h - hoCuNDArray_utils.h - hoCuNDArray_math.h - GPUTimer.h - GadgetronCuException.h - radial_utilities.h - real_utilities_device.h - check_CUDA.h - cudaDeviceManager.h - CUBLASContextProvider.h - setup_grid.h - cuSparseMatrix.h - cuNDArray_converter.h - DESTINATION ${GADGETRON_INSTALL_INCLUDE_PATH} COMPONENT main) - - set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/deblur/CMakeLists.txt b/toolboxes/deblur/CMakeLists.txt index 947fb0e4b..9fc5e6a8e 100644 --- a/toolboxes/deblur/CMakeLists.txt +++ b/toolboxes/deblur/CMakeLists.txt @@ -8,9 +8,7 @@ set_target_properties(gadgetron_toolbox_deblur PROPERTIES VERSION ${GADGETRON_VE target_link_libraries(gadgetron_toolbox_deblur gadgetron_toolbox_cpucore gadgetron_toolbox_cpucore_math - gadgetron_toolbox_gpucore - gadgetron_toolbox_gpuparallelmri - gadgetron_toolbox_gpunfft + gadgetron_toolbox_gpu ) target_include_directories(gadgetron_toolbox_deblur PUBLIC diff --git a/toolboxes/dwt/CMakeLists.txt b/toolboxes/dwt/CMakeLists.txt index 31f1cf92e..6d9934fe4 100644 --- a/toolboxes/dwt/CMakeLists.txt +++ b/toolboxes/dwt/CMakeLists.txt @@ -1,7 +1,3 @@ -if (CUDA_FOUND) - add_subdirectory(gpu) -endif() - add_subdirectory(cpu) set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/dwt/gpu/CMakeLists.txt b/toolboxes/dwt/gpu/CMakeLists.txt deleted file mode 100644 index f0b17243e..000000000 --- a/toolboxes/dwt/gpu/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -if (WIN32) - add_definitions(-D__BUILD_GADGETRON_GPUDWT__) -endif () - -if(WIN32) - link_directories(${Boost_LIBRARY_DIRS}) -endif() - - - -cuda_add_library(gadgetron_toolbox_gpudwt SHARED - cuNDDWT.h - cuNDDWT.cu - ) - - -target_include_directories(gadgetron_toolbox_gpudwt - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}) - -set_target_properties(gadgetron_toolbox_gpudwt PROPERTIES VERSION ${GADGETRON_VERSION_STRING} SOVERSION ${GADGETRON_SOVERSION}) - -target_link_libraries(gadgetron_toolbox_gpudwt - gadgetron_toolbox_cpucore - gadgetron_toolbox_gpucore - ${CUDA_LIBRARIES} - ${CUDA_CUFFT_LIBRARIES} - ) - - - -install(TARGETS gadgetron_toolbox_gpudwt - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - COMPONENT main -) - - -install(FILES - cuNDDWT.h - cuDWTOperator.h - DESTINATION ${GADGETRON_INSTALL_INCLUDE_PATH} COMPONENT main) - -set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/dwt/gpu/cuNDDWT.h b/toolboxes/dwt/gpu/cuNDDWT.h index 31d6dfb9e..093c745e4 100644 --- a/toolboxes/dwt/gpu/cuNDDWT.h +++ b/toolboxes/dwt/gpu/cuNDDWT.h @@ -5,7 +5,7 @@ #if defined (WIN32) -#if defined (__BUILD_GADGETRON_GPUDWT__) +#if defined (__BUILD_GADGETRON_GPU__) #define EXPORTGPUDWT __declspec(dllexport) #else #define EXPORTGPUDWT __declspec(dllimport) diff --git a/toolboxes/fft/CMakeLists.txt b/toolboxes/fft/CMakeLists.txt index 85e6bf4a1..6d9934fe4 100644 --- a/toolboxes/fft/CMakeLists.txt +++ b/toolboxes/fft/CMakeLists.txt @@ -1,9 +1,3 @@ add_subdirectory(cpu) -if(CUDA_FOUND) - add_subdirectory(gpu) -else() - message("CUDA not found, not compiling gpu fft toolbox") -endif() - set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/fft/gpu/CMakeLists.txt b/toolboxes/fft/gpu/CMakeLists.txt deleted file mode 100644 index e44030e85..000000000 --- a/toolboxes/fft/gpu/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -if (WIN32) - add_definitions(-D__BUILD_GADGETRON_GPUFFT__) -endif () - - -cuda_add_library(gadgetron_toolbox_gpufft SHARED - cuNDFFT.h - cuNDFFT.cpp - cuNDFFT.cu - cuFFTCachedPlan.h - cuFFTPlan.h cuFFTPlan.hpp) - -set_target_properties(gadgetron_toolbox_gpufft PROPERTIES VERSION ${GADGETRON_VERSION_STRING} SOVERSION ${GADGETRON_SOVERSION}) - -target_include_directories(gadgetron_toolbox_gpufft - PUBLIC - $ - $ - ) - - -target_link_libraries(gadgetron_toolbox_gpufft - gadgetron_toolbox_cpucore - gadgetron_toolbox_log - gadgetron_toolbox_gpucore - ${CUDA_LIBRARIES} - ${CUDA_CUFFT_LIBRARIES} - ) - -install(TARGETS gadgetron_toolbox_gpufft - EXPORT gadgetron-export - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - COMPONENT main - ) - -install(FILES - gpufft_export.h - cuNDFFT.h - cuFFTPlan.h - cuFFTPlan.hpp - cuFFTCachedPlan.h - cuFFTCachedPlan.hpp - DESTINATION ${GADGETRON_INSTALL_INCLUDE_PATH} COMPONENT main) - -set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/fft/gpu/gpufft_export.h b/toolboxes/fft/gpu/gpufft_export.h index ab0252a21..4a6b80222 100644 --- a/toolboxes/fft/gpu/gpufft_export.h +++ b/toolboxes/fft/gpu/gpufft_export.h @@ -6,7 +6,7 @@ #define GPUFFT_EXPORT_H_ #if defined (WIN32) - #if defined (__BUILD_GADGETRON_GPUFFT__) || defined (gpufft_EXPORTS) + #if defined (__BUILD_GADGETRON_GPU__) || defined (gpufft_EXPORTS) #define EXPORTGPUFFT __declspec(dllexport) #else #define EXPORTGPUFFT __declspec(dllimport) diff --git a/toolboxes/mri/CMakeLists.txt b/toolboxes/mri/CMakeLists.txt index f910cbede..f74cb7ef7 100644 --- a/toolboxes/mri/CMakeLists.txt +++ b/toolboxes/mri/CMakeLists.txt @@ -2,9 +2,6 @@ add_subdirectory(pmri) add_subdirectory(spiral) add_subdirectory(epi) -if (CUDA_FOUND) - add_subdirectory(hyper) -endif () add_subdirectory(sdc) diff --git a/toolboxes/mri/hyper/CMakeLists.txt b/toolboxes/mri/hyper/CMakeLists.txt deleted file mode 100644 index 053fe0b36..000000000 --- a/toolboxes/mri/hyper/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -if (WIN32) - add_definitions(-D__BUILD_GADGETRON_TOOLBOX_HYPER__) -endif () - - -cuda_add_library(gadgetron_toolbox_hyper SHARED - CSIOperator.cpp - CSI_utils.cu - CSIOperator.h - CSI_utils.h - gadgetron_toolbox_hyper_export.h - ) - -set_target_properties(gadgetron_toolbox_hyper PROPERTIES VERSION ${GADGETRON_VERSION_STRING} SOVERSION ${GADGETRON_SOVERSION}) -target_include_directories(gadgetron_toolbox_hyper - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(gadgetron_toolbox_hyper - gadgetron_toolbox_gpucore - gadgetron_toolbox_gpunfft - ${Boost_LIBRARIES} - ${CUDA_LIBRARIES} - ${CUDA_CUBLAS_LIBRARIES} - ) - -install(TARGETS gadgetron_toolbox_hyper - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - COMPONENT main -) - - -install(FILES - CSIOperator.h - CSI_utils.h - DESTINATION ${GADGETRON_INSTALL_INCLUDE_PATH} COMPONENT main) - -set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/mri/hyper/gadgetron_toolbox_hyper_export.h b/toolboxes/mri/hyper/gadgetron_toolbox_hyper_export.h index 2fb545fae..ddef79773 100644 --- a/toolboxes/mri/hyper/gadgetron_toolbox_hyper_export.h +++ b/toolboxes/mri/hyper/gadgetron_toolbox_hyper_export.h @@ -1,7 +1,7 @@ #pragma once #if defined (WIN32) -#if defined (__BUILD_GADGETRON_TOOLBOX_HYPER__) +#if defined (__BUILD_GADGETRON_GPU__) #define EXPORTHYPER __declspec(dllexport) #else #define EXPORTHYPER __declspec(dllimport) diff --git a/toolboxes/mri/pmri/CMakeLists.txt b/toolboxes/mri/pmri/CMakeLists.txt index 4f4b81930..e695b4136 100644 --- a/toolboxes/mri/pmri/CMakeLists.txt +++ b/toolboxes/mri/pmri/CMakeLists.txt @@ -1,5 +1 @@ -if(CUDA_FOUND) - add_subdirectory(gpu) -endif() - set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/mri/pmri/gpu/CMakeLists.txt b/toolboxes/mri/pmri/gpu/CMakeLists.txt deleted file mode 100644 index 7a7021f39..000000000 --- a/toolboxes/mri/pmri/gpu/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -if (WIN32) - add_definitions(-D__BUILD_GADGETRON_GPUPMRI__) - add_definitions(-DWIN32_LEAN_AND_MEAN) -endif () - -if(WIN32) - link_directories(${Boost_LIBRARY_DIRS}) -endif() - - -cuda_add_library(gadgetron_toolbox_gpuparallelmri SHARED - b1_map.h - spirit_calibration.h - cuCartesianSenseOperator.h - cuNonCartesianKtSenseOperator.h - cuNonCartesianSenseOperator.h - cuSpiritOperator.h - cuBuffer.h - cuSenseBuffer.h - cuSenseBufferCg.h - cuSenseOperator.h - gpupmri_export.h - htgrappa.h - senseOperator.h - sense_utilities.h - b1_map.cu - b1_map_NIH_Souheil.cu - spirit_calibration.cu - sense_utilities.cu - cuSenseOperator.cu - cuCartesianSenseOperator.cu - cuNonCartesianSenseOperator.cu - cuNonCartesianKtSenseOperator.cu - cuBuffer.cpp - cuSenseBuffer.cpp - cuSenseBufferCg.cpp - cuSpiritBuffer.cpp - htgrappa.cpp - htgrappa.cu - trajectory_utils.h - trajectory_utils.cu - ) - -set_target_properties(gadgetron_toolbox_gpuparallelmri PROPERTIES VERSION ${GADGETRON_VERSION_STRING} SOVERSION ${GADGETRON_SOVERSION}) - -target_link_libraries(gadgetron_toolbox_gpuparallelmri - gadgetron_toolbox_gpucore - gadgetron_toolbox_log - gadgetron_toolbox_gpusolvers - gadgetron_toolbox_gpunfft - gadgetron_toolbox_cpucore - gadgetron_toolbox_cpucore_math - ) - - -target_include_directories(gadgetron_toolbox_gpuparallelmri - PUBLIC - $ - $ - ) - -install(TARGETS gadgetron_toolbox_gpuparallelmri - EXPORT gadgetron-export - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - COMPONENT main -) - -install(FILES - b1_map.h - sense_utilities.h - htgrappa.h - senseOperator.h - cuSenseOperator.h - cuCartesianSenseOperator.h - cuNonCartesianSenseOperator.h - cuNonCartesianKtSenseOperator.h - cuSpiritOperator.h - cuBuffer.h - cuSenseBuffer.h - cuSenseBufferCg.h - cuSpiritBuffer.h - gpupmri_export.h -DESTINATION ${GADGETRON_INSTALL_INCLUDE_PATH} COMPONENT main) - -set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/mri/pmri/gpu/gpupmri_export.h b/toolboxes/mri/pmri/gpu/gpupmri_export.h index a66fa32fb..d3f946361 100644 --- a/toolboxes/mri/pmri/gpu/gpupmri_export.h +++ b/toolboxes/mri/pmri/gpu/gpupmri_export.h @@ -6,7 +6,7 @@ #define GPUPMRI_EXPORT_H_ #if defined (WIN32) -#if defined (__BUILD_GADGETRON_GPUPMRI__) || defined (gpuparallelmri_EXPORTS) +#if defined (__BUILD_GADGETRON_GPU__) || defined (gpuparallelmri_EXPORTS) #define EXPORTGPUPMRI __declspec(dllexport) #else #define EXPORTGPUPMRI __declspec(dllimport) diff --git a/toolboxes/mri/sdc/CMakeLists.txt b/toolboxes/mri/sdc/CMakeLists.txt index f7e514b49..c53201fa2 100644 --- a/toolboxes/mri/sdc/CMakeLists.txt +++ b/toolboxes/mri/sdc/CMakeLists.txt @@ -1,8 +1,5 @@ add_subdirectory(cpu) -if (CUDA_FOUND) - add_subdirectory(gpu) -endif () add_library(gadgetron_toolbox_sdc INTERFACE) target_include_directories(gadgetron_toolbox_sdc diff --git a/toolboxes/mri/sdc/gpu/CMakeLists.txt b/toolboxes/mri/sdc/gpu/CMakeLists.txt deleted file mode 100644 index 32a577bfc..000000000 --- a/toolboxes/mri/sdc/gpu/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -if (WIN32) - add_definitions(-D__BUILD_GADGETRON_GPUSDC__) - add_definitions(-D_USE_MATH_DEFINES) -endif () - -cuda_add_library(gadgetron_toolbox_gpusdc SHARED - cuSDC.cu -) - -set_target_properties(gadgetron_toolbox_gpusdc PROPERTIES VERSION ${GADGETRON_VERSION_STRING} SOVERSION ${GADGETRON_SOVERSION}) - -target_include_directories(gadgetron_toolbox_gpusdc - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) - -target_link_libraries(gadgetron_toolbox_gpusdc - gadgetron_toolbox_gpucore - gadgetron_toolbox_operator - gadgetron_toolbox_log - gadgetron_toolbox_sdc - gadgetron_toolbox_nfft - gadgetron_toolbox_gpunfft - ${CUDA_LIBRARIES} -) - -install(TARGETS gadgetron_toolbox_gpusdc - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - COMPONENT main -) - -install(FILES - cuSDC.h - DESTINATION ${GADGETRON_INSTALL_INCLUDE_PATH} - COMPONENT main) diff --git a/toolboxes/nfft/CMakeLists.txt b/toolboxes/nfft/CMakeLists.txt index 404ec6109..459cc7d15 100644 --- a/toolboxes/nfft/CMakeLists.txt +++ b/toolboxes/nfft/CMakeLists.txt @@ -1,7 +1,3 @@ -if (CUDA_FOUND) - add_subdirectory(gpu) -endif () - add_subdirectory(cpu) add_library(gadgetron_toolbox_nfft INTERFACE) diff --git a/toolboxes/nfft/gpu/CMakeLists.txt b/toolboxes/nfft/gpu/CMakeLists.txt deleted file mode 100644 index c8fe55e43..000000000 --- a/toolboxes/nfft/gpu/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -if (WIN32) - add_definitions(-D__BUILD_GADGETRON_GPUNFFT__) - add_definitions(-D_USE_MATH_DEFINES) -endif () - - - -cuda_add_library(gadgetron_toolbox_gpunfft SHARED - cuGriddingConvolution.h - cuGriddingConvolution.cu - cuNFFT.h - cuNFFT.cu - cuNFFTOperator.cpp - ) - -target_include_directories(gadgetron_toolbox_gpunfft - PUBLIC - $ - $ - $) - -set_target_properties(gadgetron_toolbox_gpunfft PROPERTIES VERSION ${GADGETRON_VERSION_STRING} SOVERSION ${GADGETRON_SOVERSION}) - -target_link_libraries(gadgetron_toolbox_gpunfft - gadgetron_toolbox_operator - gadgetron_toolbox_gpufft - gadgetron_toolbox_gpucore - gadgetron_toolbox_log - ${CUDA_LIBRARIES} - ${CUDA_CUFFT_LIBRARIES} - ${CUDA_CUBLAS_LIBRARIES} - ${CUDA_CUSPARSE_LIBRARIES} - ) -install(TARGETS gadgetron_toolbox_gpunfft - EXPORT gadgetron-export - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - COMPONENT main - ) - - -install(FILES - cuGriddingConvolution.h - cuNFFT.h - DESTINATION ${GADGETRON_INSTALL_INCLUDE_PATH} COMPONENT main) - -set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/nfft/gpu/cuGriddingConvolution.cu b/toolboxes/nfft/gpu/cuGriddingConvolution.cu index dd40ce645..0fafc912a 100755 --- a/toolboxes/nfft/gpu/cuGriddingConvolution.cu +++ b/toolboxes/nfft/gpu/cuGriddingConvolution.cu @@ -141,7 +141,7 @@ namespace Gadgetron thrust::pair, thrust::device_ptr> mm_pair = thrust::minmax_element(traj_view.begin(), traj_view.end()); - + if (*mm_pair.first < REAL(-0.5) || *mm_pair.second > REAL(0.5)) { std::stringstream ss; @@ -170,7 +170,7 @@ namespace Gadgetron this->trajectory_.begin(), trajectory_scale(matrix_size_os_fp, matrix_size_os_padded_fp)); - + // Prepare convolution. if (prep_mode == GriddingConvolutionPrepMode::C2NC || prep_mode == GriddingConvolutionPrepMode::ALL) @@ -366,23 +366,17 @@ namespace Gadgetron // (#cells influenced per sample). thrust::device_vector c_p_s(trajectory.size()); thrust::device_vector c_p_s_ps(trajectory.size()); + CHECK_FOR_CUDA_ERROR(); - REAL radius = this->plan_.kernel_.get_radius(); - transform(trajectory.begin(), trajectory.end(), c_p_s.begin(), compute_num_cells_per_sample(radius)); - - const bool thrust_workaround = true; - if (thrust_workaround) { - thrust::host_vector h_c_p_s(c_p_s); - thrust::host_vector h_c_p_s_ps(c_p_s_ps.size()); - inclusive_scan(thrust::host, h_c_p_s.begin(), h_c_p_s.end(), h_c_p_s_ps.begin()); - c_p_s_ps = h_c_p_s_ps; - } - else - { - inclusive_scan(c_p_s.begin(), c_p_s.end(), c_p_s_ps.begin(), - thrust::plus()); // Prefix sum. - } + GDEBUG("trajectory.size() = %d\n", trajectory.size()); + REAL radius = this->plan_.kernel_.get_radius(); + // radius = 1.0; + GDEBUG("radius = %f\n", radius); + transform(trajectory.begin(), trajectory.end(), + c_p_s.begin(), compute_num_cells_per_sample(radius)); + inclusive_scan(c_p_s.begin(), c_p_s.end(), c_p_s_ps.begin(), + thrust::plus()); // Prefix sum. // Build the vector of (grid_idx, sample_idx) tuples. Actually kept in // two separate vectors. @@ -392,6 +386,8 @@ namespace Gadgetron tuples_first = thrust::device_vector(num_pairs); tuples_last = thrust::device_vector(num_pairs); + CHECK_FOR_CUDA_ERROR(); + // Fill tuple vector. write_pairs(vector_td(this->plan_.matrix_size_os_), vector_td(this->plan_.matrix_padding_), @@ -404,16 +400,10 @@ namespace Gadgetron c_p_s_ps.clear(); // Sort by grid indices. - if (thrust_workaround) { - thrust::host_vector tuples_first_host(tuples_first); - thrust::host_vector tuples_last_host(tuples_last); - sort_by_key(tuples_first_host.begin(), tuples_first_host.end(), tuples_last_host.begin()); - tuples_first = tuples_first_host; - tuples_last = tuples_last_host; - } else { - sort_by_key(tuples_first.begin(), tuples_first.end(), tuples_last.begin()); - } - + GDEBUG("num_pairs = %d\n", num_pairs); + GDEBUG("tuples_first.begin() = %d\n", tuples_first.begin()); + sort_by_key(tuples_first.begin(), tuples_first.end(), tuples_last.begin()); + // Each bucket_begin[i] indexes the first element of bucket i's list of points. // Each bucket_end[i] indexes one past the last element of bucket i's list of points. bucket_begin = thrust::device_vector( diff --git a/toolboxes/operators/CMakeLists.txt b/toolboxes/operators/CMakeLists.txt index e95e9e7a6..d82482a35 100644 --- a/toolboxes/operators/CMakeLists.txt +++ b/toolboxes/operators/CMakeLists.txt @@ -34,8 +34,4 @@ install(TARGETS gadgetron_toolbox_operator add_subdirectory(cpu) -if (CUDA_FOUND) - add_subdirectory(gpu) -endif () - set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/operators/gpu/CMakeLists.txt b/toolboxes/operators/gpu/CMakeLists.txt deleted file mode 100644 index b57fab83b..000000000 --- a/toolboxes/operators/gpu/CMakeLists.txt +++ /dev/null @@ -1,70 +0,0 @@ -if (WIN32) - add_definitions(-D__BUILD_GADGETRON_GPUOPERATORS__) -endif () - - - -cuda_add_library(gadgetron_toolbox_gpuoperators SHARED - ../generalOperator.h - ../linearOperator.h - cuPartialDerivativeOperator.h - cuLaplaceOperator.h - cuTvOperator.h - cuTv1dOperator.h - cuConvolutionOperator.h - cuPartialDerivativeOperator.cu - cuPartialDerivativeOperator2.cu - cuLaplaceOperator.cu - cuTvOperator.cu - cuTv1dOperator.cu - cuConvolutionOperator.cu - ) - -set_target_properties(gadgetron_toolbox_gpuoperators PROPERTIES VERSION ${GADGETRON_VERSION_STRING} SOVERSION ${GADGETRON_SOVERSION}) - -target_link_libraries(gadgetron_toolbox_gpuoperators - gadgetron_toolbox_operator - gadgetron_toolbox_gpucore - gadgetron_toolbox_gpunfft - ${CUDA_LIBRARIES} - ${CUDA_CUBLAS_LIBRARIES} - ) - -target_include_directories(gadgetron_toolbox_gpuoperators - PUBLIC - $ - $ - ) - -install(TARGETS gadgetron_toolbox_gpuoperators - EXPORT gadgetron-export - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - COMPONENT main -) - -install(FILES - cuImageOperator.h - cuDiagonalOperator.h - cuDiagonalSumOperator.h - cuPartialDerivativeOperator.h - cuPartialDerivativeOperator2.h - cuConvolutionOperator.h - cuLaplaceOperator.h - cuTvOperator.h - cuTvPicsOperator.h - cuTv1dOperator.h - cuDownsampleOperator.h - cuFFTOperator.h - cuUpsampleOperator.h - hoCuIdentityOperator.h - hoCuPartialDerivativeOperator.h - hoCuTvOperator.h - hoCuTvPicsOperator.h - hoCuEncodingOperatorContainer.h - gpuoperators_export.h - hoCuOperator.h - DESTINATION ${GADGETRON_INSTALL_INCLUDE_PATH} COMPONENT main) - -set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/operators/gpu/gpuoperators_export.h b/toolboxes/operators/gpu/gpuoperators_export.h index 0a9622b9b..088d7af7e 100644 --- a/toolboxes/operators/gpu/gpuoperators_export.h +++ b/toolboxes/operators/gpu/gpuoperators_export.h @@ -6,7 +6,7 @@ #define GPUOPERATORS_EXPORT_H_ #if defined (WIN32) -#if defined (__BUILD_GADGETRON_GPUOPERATORS__) +#if defined (__BUILD_GADGETRON_GPU__) #define EXPORTGPUOPERATORS __declspec(dllexport) #else #define EXPORTGPUOPERATORS __declspec(dllimport) diff --git a/toolboxes/registration/optical_flow/CMakeLists.txt b/toolboxes/registration/optical_flow/CMakeLists.txt index 1ad0ee5b1..d0021c296 100644 --- a/toolboxes/registration/optical_flow/CMakeLists.txt +++ b/toolboxes/registration/optical_flow/CMakeLists.txt @@ -18,9 +18,4 @@ set(BUILD_CPU_OPTIMAL_FLOW_REG On) add_subdirectory(cpu) -if (CUDA_FOUND) - message("Compiling gpu based optical flow registration toolbox.") - add_subdirectory(gpu) -endif () - set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/registration/optical_flow/gpu/CMakeLists.txt b/toolboxes/registration/optical_flow/gpu/CMakeLists.txt deleted file mode 100644 index 511eb949f..000000000 --- a/toolboxes/registration/optical_flow/gpu/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -if (WIN32) - add_definitions(-D__BUILD_GADGETRON_GPUREG__) -endif () - - -cuda_add_library(gadgetron_toolbox_gpureg SHARED - cuOpticalFlowSolver.cu - cuHSOpticalFlowSolver.cu - cuCKOpticalFlowSolver.cu - cuResampleOperator.cu - cuLinearResampleOperator.cu - ) - -set_target_properties(gadgetron_toolbox_gpureg PROPERTIES VERSION ${GADGETRON_VERSION_STRING} SOVERSION ${GADGETRON_SOVERSION}) - -target_link_libraries(gadgetron_toolbox_gpureg - gadgetron_toolbox_registration_optical_flow - gadgetron_toolbox_operator - gadgetron_toolbox_gpucore - gadgetron_toolbox_solvers - gadgetron_toolbox_log - ${CUDA_LIBRARIES} ${CUDA_CUFFT_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES}) - -target_include_directories(gadgetron_toolbox_gpureg - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ) - -install(TARGETS gadgetron_toolbox_gpureg - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - COMPONENT main -) - - -install(FILES - cuOpticalFlowSolver.h - cuHSOpticalFlowSolver.h - cuCKOpticalFlowSolver.h - gpureg_export.h - cuResampleOperator.h - cuLinearResampleOperator.h - cuCGHSOFSolver.h - DESTINATION ${GADGETRON_INSTALL_INCLUDE_PATH} COMPONENT main) - -set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/registration/optical_flow/gpu/gpureg_export.h b/toolboxes/registration/optical_flow/gpu/gpureg_export.h index 6690a4c07..51d9e2969 100644 --- a/toolboxes/registration/optical_flow/gpu/gpureg_export.h +++ b/toolboxes/registration/optical_flow/gpu/gpureg_export.h @@ -2,7 +2,7 @@ #define _GPUREG_EXPORT_H_ #if defined (WIN32) -#if defined (__BUILD_GADGETRON_GPUREG__) || defined (gpureg_EXPORTS) +#if defined (__BUILD_GADGETRON_GPU__) || defined (gpureg_EXPORTS) #define EXPORTGPUREG __declspec(dllexport) #else #define EXPORTGPUREG __declspec(dllimport) diff --git a/toolboxes/solvers/CMakeLists.txt b/toolboxes/solvers/CMakeLists.txt index cce4630b1..791db3e9f 100644 --- a/toolboxes/solvers/CMakeLists.txt +++ b/toolboxes/solvers/CMakeLists.txt @@ -31,8 +31,4 @@ install(TARGETS gadgetron_toolbox_solvers EXPORT gadgetron-export) add_subdirectory(cpu) -if( CUDA_FOUND) - add_subdirectory(gpu) -endif () - set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) diff --git a/toolboxes/solvers/gpu/CMakeLists.txt b/toolboxes/solvers/gpu/CMakeLists.txt deleted file mode 100644 index 9132e3ae8..000000000 --- a/toolboxes/solvers/gpu/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ -if (WIN32) - add_definitions(-D__BUILD_GADGETRON_GPUSOLVERS__) -endif () - - -cuda_add_library(gadgetron_toolbox_gpusolvers SHARED - gpusolvers_export.h - cuSolverUtils.cu - ) - -set_target_properties(gadgetron_toolbox_gpusolvers PROPERTIES VERSION ${GADGETRON_VERSION_STRING} SOVERSION ${GADGETRON_SOVERSION}) - -target_link_libraries(gadgetron_toolbox_gpusolvers - gadgetron_toolbox_gpucore - gadgetron_toolbox_solvers - gadgetron_toolbox_log) - -target_include_directories(gadgetron_toolbox_gpusolvers - PUBLIC - $ - $ -) - - -install(TARGETS gadgetron_toolbox_gpusolvers - EXPORT gadgetron-export - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin - COMPONENT main -) - - -install(FILES - cuSbCgSolver.h - cuSbcCgSolver.h - cuCgPreconditioner.h - cuLwSolver.h - cuLbfgsSolver.h - cuSbLwSolver.h - cuSbcLwSolver.h - cuCgSolver.h - cuNlcgSolver.h - cuGpBbSolver.h - hoCuCgSolver.h - hoCuNlcgSolver.h - hoCuSbcCgSolver.h - hoCuGpBbSolver.h - cuSolverUtils.h - gpusolvers_export.h - DESTINATION ${GADGETRON_INSTALL_INCLUDE_PATH} COMPONENT main) - -set(GADGETRON_BUILD_RPATH "${CMAKE_CURRENT_BINARY_DIR};${GADGETRON_BUILD_RPATH}" PARENT_SCOPE) \ No newline at end of file diff --git a/toolboxes/solvers/gpu/gpusolvers_export.h b/toolboxes/solvers/gpu/gpusolvers_export.h index 1dc1c3e8a..b92c37eff 100644 --- a/toolboxes/solvers/gpu/gpusolvers_export.h +++ b/toolboxes/solvers/gpu/gpusolvers_export.h @@ -6,7 +6,7 @@ #define GPUSOLVERS_EXPORT_H_ #if defined (WIN32) -#if defined (__BUILD_GADGETRON_GPUSOLVERS__) || defined (gpusolvers_EXPORTS) +#if defined (__BUILD_GADGETRON_GPU__) || defined (gpusolvers_EXPORTS) #define EXPORTGPUSOLVERS __declspec(dllexport) #else #define EXPORTGPUSOLVERS __declspec(dllimport)