Commit 47fe8e8e authored by Uldis Locans's avatar Uldis Locans
Browse files

allow to enalbe wich parts of DKS to compile trough cmake flags

parent eee9dfd8
......@@ -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,18 +2,21 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src )
LINK_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src )
#chi square kernel tests
ADD_EXECUTABLE(testChiSquareRT testChiSquareRT.cpp)
TARGET_LINK_LIBRARIES(testChiSquareRT dks ${Boost_LIBRARIES} ${CLFFT_LIBRARIES})
IF (ENABLE_MUSR)
ADD_EXECUTABLE(testChiSquareRT testChiSquareRT.cpp)
TARGET_LINK_LIBRARIES(testChiSquareRT dks ${Boost_LIBRARIES} ${CLFFT_LIBRARIES})
ADD_EXECUTABLE(testChiSquareRTRandom testChiSquareRTRandom.cpp)
TARGET_LINK_LIBRARIES(testChiSquareRTRandom dks ${Boost_LIBRARIES} ${CLFFT_LIBRARIES})
ADD_EXECUTABLE(testChiSquareRTRandom testChiSquareRTRandom.cpp)
TARGET_LINK_LIBRARIES(testChiSquareRTRandom dks ${Boost_LIBRARIES} ${CLFFT_LIBRARIES})
IF (USE_UQTK)
ADD_EXECUTABLE(testChiSquareRTUQTK testChiSquareRTUQTK.cpp)
TARGET_LINK_LIBRARIES(testChiSquareRTUQTK dks ${Boost_LIBRARIES} ${CLFFT_LIBRARIES} lreg UQTk quad bcs uqtktools cvode-2.6.0 dsfmt lbfgs uqtklapack uqtkslatec uqtkblas gfortran)
ENDIF (USE_UQTK)
#TARGET_LINK_LIBRARIES(testChiSquareRTUQTK dks ${Boost_LIBRARIES})
IF (USE_UQTK)
ADD_EXECUTABLE(testChiSquareRTUQTK testChiSquareRTUQTK.cpp)
TARGET_LINK_LIBRARIES(testChiSquareRTUQTK dks ${Boost_LIBRARIES} ${CLFFT_LIBRARIES} lreg UQTk quad bcs uqtktools cvode-2.6.0 dsfmt lbfgs uqtklapack uqtkslatec uqtkblas gfortran)
ENDIF (USE_UQTK)
#TARGET_LINK_LIBRARIES(testChiSquareRTUQTK dks ${Boost_LIBRARIES})
#test to verify search functions
ADD_EXECUTABLE(testSearch testSearch.cpp)
TARGET_LINK_LIBRARIES(testSearch dks ${Boost_LIBRARIES} ${CLFFT_LIBRARIES})
ENDIF (ENABLE_MUSR)
#test to verify search functions
ADD_EXECUTABLE(testSearch testSearch.cpp)
TARGET_LINK_LIBRARIES(testSearch dks ${Boost_LIBRARIES} ${CLFFT_LIBRARIES})
......@@ -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})
......
SET (_HDRS
CudaBase.cuh
CudaFFT.cuh
CudaGreensFunction.cuh
CudaChiSquare.cuh
CudaCollimatorPhysics.cuh
CudaImageReconstruction.cuh
CudaChiSquareRuntime.cuh
)
SET (_SRCS
CudaBase.cu
CudaFFT.cu
CudaGreensFunction.cu
CudaChiSquare.cu
CudaCollimatorPhysics.cu
CudaImageReconstruction.cu
CudaChiSquareRuntime.cu
)
SET (_HDRS CudaBase.cuh)
SET (_SRCS CudaBase.cu)
#INCLUDE_DIRECTORIES (
# ${CMAKE_CURRENT_SOURCE_DIR}
#)
IF (ENABLE_OPAL)
SET (_HDRS ${_HDRS} CudaFFT.cuh CudaGreensFunction.cuh CudaCollimatorPhysics.cuh)
SET (_SRCS ${_SRCS} CudaFFT.cu CudaGreensFunction.cu CudaCollimatorPhysics.cu)
ENDIF (ENABLE_OPAL)
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)
SET (_SRCS
MICBase.cpp
MICChiSquare.cpp
MICFFT.cpp
MICGreensFunction.cpp
MICCollimatorPhysics.cpp
)
SET (_SRCS MICBase.cpp)
SET (_HDRS MICBase.h)
SET (_HDRS
MICBase.h
MICChiSquare.h
MICFFT.h
MICCollimatorPhysics.h
MICGreensFunction.hpp
MICMergeSort.h
)
IF (ENABLE_OPAL)
SET (_SRCS
${_SRCS}
MICChiSquare.cpp
MICFFT.cpp
MICGreensFunction.cpp
MICCollimatorPhysics.cpp
)
SET (_HDRS
${_HDRS}
MICChiSquare.h
MICFFT.h
MICCollimatorPhysics.h
MICGreensFunction.hpp
MICMergeSort.h
)
ENDIF (ENABLE_OPAL)
#INCLUDE_DIRECTORIES (
# ${CMAKE_CURRENT_SOURCE_DIR}
......
#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
OpenCLKernels/OpenCLFFT.cl
OpenCLKernels/OpenCLFFTStockham.cl
OpenCLKernels/OpenCLTranspose.cl
OpenCLKernels/OpenCLCollimatorPhysics.cl
OpenCLKernels/OpenCLChiSquareRuntime.cl
OpenCLKernels/OpenCLGreensFunction.cl
SET (_KERNELS
${_KERNELS}
OpenCLKernels/OpenCLFFT.cl
OpenCLKernels/OpenCLFFTStockham.cl
OpenCLKernels/OpenCLTranspose.cl
OpenCLKernels/OpenCLCollimatorPhysics.cl
OpenCLKernels/OpenCLGreensFunction.cl
)
ENDIF (ENABLE_AMD AND ENABLE_OPAL)
ADD_SOURCES (${_SRCS})
ADD_HEADERS (${_HDRS})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment