allow to enalbe wich parts of DKS to compile trough cmake flags
This commit is contained in:
@ -38,6 +38,18 @@ IF (Boost_FOUND)
|
||||
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
|
||||
ENDIF (Boost_FOUND)
|
||||
|
||||
#include OPAL, musrfit or pet kernels
|
||||
OPTION(DKS_FULL "Compile DKS with full library" OFF)
|
||||
OPTION(ENABLE_OPAL "Compile DKS with OPAL kernels" OFF)
|
||||
OPTION(ENABLE_MUSR "Compile DKS with musrfit kernels" OFF)
|
||||
OPTION(ENABLE_PET "Compile DKS with PET reconstruction kernels" OFF)
|
||||
|
||||
IF (DKS_FULL)
|
||||
SET(ENABLE_OPAL ON)
|
||||
SET(ENABLE_MUSR ON)
|
||||
SET(ENABLE_PET ON)
|
||||
ENDIF(DKS_FULL)
|
||||
|
||||
#find clFFT
|
||||
OPTION (ENABLE_AMD "Enable AMD libraries" OFF)
|
||||
IF (ENABLE_AMD)
|
||||
|
@ -2,6 +2,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src )
|
||||
LINK_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src )
|
||||
|
||||
#chi square kernel tests
|
||||
IF (ENABLE_MUSR)
|
||||
ADD_EXECUTABLE(testChiSquareRT testChiSquareRT.cpp)
|
||||
TARGET_LINK_LIBRARIES(testChiSquareRT dks ${Boost_LIBRARIES} ${CLFFT_LIBRARIES})
|
||||
|
||||
@ -17,3 +18,5 @@ ENDIF (USE_UQTK)
|
||||
#test to verify search functions
|
||||
ADD_EXECUTABLE(testSearch testSearch.cpp)
|
||||
TARGET_LINK_LIBRARIES(testSearch dks ${Boost_LIBRARIES} ${CLFFT_LIBRARIES})
|
||||
ENDIF (ENABLE_MUSR)
|
||||
|
||||
|
@ -35,13 +35,29 @@ ENDMACRO ()
|
||||
SET (DKS_BASEDIR_HDRS
|
||||
DKSBase.h
|
||||
DKSDefinitions.h
|
||||
DKSOPAL.h
|
||||
)
|
||||
|
||||
SET (DKS_BASEDIR_SRCS
|
||||
DKSBase.cpp
|
||||
DKSOPAL.cpp
|
||||
)
|
||||
|
||||
IF (USE_CUDA OR USE_OPENCL)
|
||||
#add opal to DKS if enable_opal is set
|
||||
IF (ENABLE_OPAL)
|
||||
SET (DKS_BASEDIR_HDRS
|
||||
${DKS_BASEDIR_HDRS}
|
||||
DKSOPAL.h
|
||||
)
|
||||
|
||||
SET (DKS_BASEDIR_SRCS
|
||||
${DKS_BASEDIR_SRCS}
|
||||
DKSOPAL.cpp
|
||||
)
|
||||
ENDIF (ENABLE_OPAL)
|
||||
|
||||
#and musrt to DKS if cuda or opencl is used and enable_musr is set
|
||||
IF ( (USE_CUDA OR USE_OPENCL) AND ENABLE_MUSR)
|
||||
SET (DKS_BASEDIR_HDRS
|
||||
${DKS_BASEDIR_HDRS}
|
||||
DKSBaseMuSR.h
|
||||
@ -51,9 +67,10 @@ IF (USE_CUDA OR USE_OPENCL)
|
||||
${DKS_BASEDIR_SRCS}
|
||||
DKSBaseMuSR.cpp
|
||||
)
|
||||
ENDIF (USE_CUDA OR USE_OPENCL)
|
||||
ENDIF ( (USE_CUDA OR USE_OPENCL) AND ENABLE_MUSR)
|
||||
|
||||
IF (USE_CUDA)
|
||||
#add image reconstruction to DKS if cuda is used and enable_pet is set
|
||||
IF (USE_CUDA AND ENABLE_PET)
|
||||
SET (DKS_BASEDIR_HDRS
|
||||
${DKS_BASEDIR_HDRS}
|
||||
DKSImageReconstruction.h
|
||||
@ -63,7 +80,7 @@ IF (USE_CUDA)
|
||||
${DKS_BASEDIR_SRCS}
|
||||
DKSImageReconstruction.cpp
|
||||
)
|
||||
ENDIF (USE_CUDA)
|
||||
ENDIF (USE_CUDA AND ENABLE_PET)
|
||||
|
||||
ADD_HEADERS (${DKS_BASEDIR_HDRS})
|
||||
ADD_SOURCES (${DKS_BASEDIR_SRCS})
|
||||
|
@ -1,35 +1,25 @@
|
||||
SET (_HDRS
|
||||
CudaBase.cuh
|
||||
CudaFFT.cuh
|
||||
CudaGreensFunction.cuh
|
||||
CudaChiSquare.cuh
|
||||
CudaCollimatorPhysics.cuh
|
||||
CudaImageReconstruction.cuh
|
||||
CudaChiSquareRuntime.cuh
|
||||
)
|
||||
SET (_HDRS CudaBase.cuh)
|
||||
SET (_SRCS CudaBase.cu)
|
||||
|
||||
SET (_SRCS
|
||||
CudaBase.cu
|
||||
CudaFFT.cu
|
||||
CudaGreensFunction.cu
|
||||
CudaChiSquare.cu
|
||||
CudaCollimatorPhysics.cu
|
||||
CudaImageReconstruction.cu
|
||||
CudaChiSquareRuntime.cu
|
||||
)
|
||||
IF (ENABLE_OPAL)
|
||||
SET (_HDRS ${_HDRS} CudaFFT.cuh CudaGreensFunction.cuh CudaCollimatorPhysics.cuh)
|
||||
SET (_SRCS ${_SRCS} CudaFFT.cu CudaGreensFunction.cu CudaCollimatorPhysics.cu)
|
||||
ENDIF (ENABLE_OPAL)
|
||||
|
||||
#INCLUDE_DIRECTORIES (
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
#)
|
||||
IF (ENABLE_MUSR)
|
||||
SET (_HDRS ${_HDRS} CudaChiSquareRuntime.cuh)
|
||||
SET (_SRCS ${_SRCS} CudaChiSquareRuntime.cu)
|
||||
SET (_KERNELS NVRTCKernels/CudaChiSquareKernel.cu)
|
||||
ENDIF (ENABLE_MUSR)
|
||||
|
||||
IF (ENABLE_PET)
|
||||
SET (_HDRS ${_HDRS} CudaImageReconstruction.cuh)
|
||||
SET (_SRCS ${_SRCS} CudaImageReconstruction.cu)
|
||||
ENDIF (ENABLE_PET)
|
||||
|
||||
ADD_SOURCES(${_SRCS})
|
||||
ADD_HEADERS(${_HDRS})
|
||||
|
||||
INSTALL(FILES ${_HDRS} DESTINATION include/CUDA)
|
||||
|
||||
SET (_KERNELS
|
||||
NVRTCKernels/CudaChiSquareKernel.cu
|
||||
)
|
||||
|
||||
INSTALL(FILES ${_KERNELS} DESTINATION include/CUDA/NVRTCKernels)
|
||||
|
||||
|
@ -1,5 +1,9 @@
|
||||
SET (_SRCS MICBase.cpp)
|
||||
SET (_HDRS MICBase.h)
|
||||
|
||||
IF (ENABLE_OPAL)
|
||||
SET (_SRCS
|
||||
MICBase.cpp
|
||||
${_SRCS}
|
||||
MICChiSquare.cpp
|
||||
MICFFT.cpp
|
||||
MICGreensFunction.cpp
|
||||
@ -7,13 +11,14 @@ SET (_SRCS
|
||||
)
|
||||
|
||||
SET (_HDRS
|
||||
MICBase.h
|
||||
${_HDRS}
|
||||
MICChiSquare.h
|
||||
MICFFT.h
|
||||
MICCollimatorPhysics.h
|
||||
MICGreensFunction.hpp
|
||||
MICMergeSort.h
|
||||
)
|
||||
ENDIF (ENABLE_OPAL)
|
||||
|
||||
#INCLUDE_DIRECTORIES (
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
|
@ -1,46 +1,39 @@
|
||||
#dont include FFT, GreensFunction and CollimatorPhysics if clFFT and clRNG not found
|
||||
|
||||
IF (ENABLE_AMD)
|
||||
SET (_HDRS OpenCLBase.h)
|
||||
SET (_SRCS OpenCLBase.cpp)
|
||||
SET (_KERNELS "")
|
||||
|
||||
IF (ENABLE_MUSR)
|
||||
SET (_HDRS ${_HDRS} OpenCLChiSquareRuntime.h)
|
||||
SET (_SRCS ${_SRCS} OpenCLChiSquareRuntime.cpp)
|
||||
SET (_KERNELS OpenCLKernels/OpenCLChiSquareRuntime.cl)
|
||||
ENDIF (ENABLE_MUSR)
|
||||
|
||||
IF (ENABLE_AMD AND ENABLE_OPAL)
|
||||
SET (_SRCS
|
||||
OpenCLBase.cpp
|
||||
${_SRCS}
|
||||
OpenCLFFT.cpp
|
||||
OpenCLChiSquare.cpp
|
||||
OpenCLCollimatorPhysics.cpp
|
||||
OpenCLChiSquareRuntime.cpp
|
||||
OpenCLGreensFunction.cpp
|
||||
)
|
||||
|
||||
SET (_HDRS
|
||||
OpenCLBase.h
|
||||
${_HDRS}
|
||||
OpenCLFFT.h
|
||||
OpenCLChiSquare.h
|
||||
OpenCLCollimatorPhysics.h
|
||||
OpenCLChiSquareRuntime.h
|
||||
OpenCLGreensFunction.h
|
||||
)
|
||||
ELSE (ENABLE_AMD)
|
||||
SET (_SRCS
|
||||
OpenCLBase.cpp
|
||||
OpenCLChiSquare.cpp
|
||||
OpenCLChiSquareRuntime.cpp
|
||||
)
|
||||
|
||||
SET (_HDRS
|
||||
OpenCLBase.h
|
||||
OpenCLChiSquare.h
|
||||
OpenCLChiSquareRuntime.h
|
||||
)
|
||||
ENDIF (ENABLE_AMD)
|
||||
|
||||
SET (_KERNELS
|
||||
OpenCLKernels/OpenCLChiSquare.cl
|
||||
${_KERNELS}
|
||||
OpenCLKernels/OpenCLFFT.cl
|
||||
OpenCLKernels/OpenCLFFTStockham.cl
|
||||
OpenCLKernels/OpenCLTranspose.cl
|
||||
OpenCLKernels/OpenCLCollimatorPhysics.cl
|
||||
OpenCLKernels/OpenCLChiSquareRuntime.cl
|
||||
OpenCLKernels/OpenCLGreensFunction.cl
|
||||
)
|
||||
ENDIF (ENABLE_AMD AND ENABLE_OPAL)
|
||||
|
||||
ADD_SOURCES (${_SRCS})
|
||||
ADD_HEADERS (${_HDRS})
|
||||
|
Reference in New Issue
Block a user