Skip to content

Commit

Permalink
Merge branch 'develop' into feature_clangBot
Browse files Browse the repository at this point in the history
  • Loading branch information
KSkwarczynski authored Feb 19, 2025
2 parents 8f33caf + 8c75fa7 commit c9cf063
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Following neutrino oscillation calculators are available:
| Prob3++Linear | CPU | Beam | |
| NuFastLinear | CPU | Beam | [Ref](https://doi.org/10.48550/arXiv.2405.02400) |
| OscProb | CPU | Beam/Atm | [Ref](https://doi.org/10.5281/zenodo.6347002) |
| NuSQUIDSLinear | CPU | Beam | [Ref](https://doi.org/10.1016/j.cpc.2022.108346) |

If nothing is specified in cmake build then NuFastLinear_ENABLED will be used. To control which oscillation calculators you want to use here is syntax:

Expand Down
18 changes: 8 additions & 10 deletions cmake/Modules/NuOscillatorSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DefineEnabledRequiredSwitch(CUDAProb3_ENABLED FALSE)
DefineEnabledRequiredSwitch(ProbGPULinear_ENABLED FALSE)
DefineEnabledRequiredSwitch(Prob3ppLinear_ENABLED FALSE)
DefineEnabledRequiredSwitch(NuFastLinear_ENABLED FALSE)
DefineEnabledRequiredSwitch(NuSQUIDSLinear_ENABLED FALSE)
DefineEnabledRequiredSwitch(OscProb_ENABLED FALSE)

#KS: If all Oscillators are turned off then enable CUDAProb3Linear_ENABLED
Expand All @@ -14,6 +15,7 @@ if (NOT CUDAProb3Linear_ENABLED AND
NOT ProbGPULinear_ENABLED AND
NOT Prob3ppLinear_ENABLED AND
NOT NuFastLinear_ENABLED AND
NOT NuSQUIDSLinear_ENABLED AND
NOT OscProb_ENABLED)
set(NuFastLinear_ENABLED TRUE)
endif()
Expand All @@ -26,6 +28,7 @@ foreach(option
ProbGPULinear
Prob3ppLinear
NuFastLinear
NuSQUIDSLinear
OscProb
)
if(${option}_ENABLED)
Expand All @@ -38,7 +41,8 @@ IsTrue(CUDAProb3Linear_ENABLED USE_CUDAProb3Linear)
IsTrue(CUDAProb3_ENABLED USE_CUDAProb3)
IsTrue(ProbGPULinear_ENABLED USE_ProbGPULinear)
IsTrue(Prob3ppLinear_ENABLED USE_Prob3ppLinear)
IsTrue(NuFastLinear_ENABLED USE_NuFastLiner)
IsTrue(NuFastLinear_ENABLED USE_NuFastLinear)
IsTrue(NuSQUIDSLinear_ENABLED USE_NuSQUIDSLinear)
IsTrue(OscProb_ENABLED USE_OscProb)

#Also additional flags
Expand All @@ -53,24 +57,17 @@ get_target_property(cpu_compile_options MaCh3CompilerOptions INTERFACE_COMPILE_O
# Join the compile options list into a space-separated string
string(REPLACE ";" " " cpu_compile_options_string "${cpu_compile_options}")

if(USE_CUDAProb3Linear EQUAL 1 AND DAN_USE_GPU EQUAL 1)
cmessage(WARNING "Right now GPU support for CUDAProb3Linear is broken, turning OFF GPU support")
set(DAN_USE_GPU 0)
endif()

#KS: This may seem hacky, but when CMAKE_CUDA_ARCHITECTURES is passed, it's treated as a string rather than a list. Since CMake uses semi-colon-delimited strings to represent lists, we convert it to a proper list to handle CUDA architectures correctly.
set(CMAKE_CUDA_ARCHITECTURES_STRING ${CMAKE_CUDA_ARCHITECTURES})
#string(REPLACE " " ";" CMAKE_CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}")
string(REPLACE " " ";" CMAKE_CUDA_ARCHITECTURES_STRING "${CMAKE_CUDA_ARCHITECTURES}")

if(NOT DEFINED MaCh3_NuOscillatorBranch)
set(MaCh3_NuOscillatorBranch "v1.2.0")
set(MaCh3_NuOscillatorBranch "v1.2.1")
endif()

#Try adding Oscillator Class
CPMAddPackage(
NAME NuOscillator
VERSION 1.2.0
GITHUB_REPOSITORY "dbarrow257/NuOscillator"
GIT_TAG ${MaCh3_NuOscillatorBranch}
GIT_SHALLOW YES
Expand All @@ -83,7 +80,8 @@ CPMAddPackage(
"UseCUDAProb3 ${USE_CUDAProb3}"
"UseProbGPULinear ${USE_ProbGPULinear}"
"UseProb3ppLinear ${USE_Prob3ppLinear}"
"UseNuFASTLinear ${USE_NuFastLiner}"
"UseNuFASTLinear ${USE_NuFastLinear}"
"UseNuSQUIDSLinear ${USE_NuSQUIDSLinear}"
"UseOscProb ${USE_OscProb}"

"NuOscillator_Compiler_Flags ${cpu_compile_options_string}"
Expand Down

0 comments on commit c9cf063

Please sign in to comment.