diff --git a/CMakeLists.txt b/CMakeLists.txt index 57c83a8ef..79801b719 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,11 +47,16 @@ ENDIF() # came out differently from the same source and data. Off, every x86-64 level computes the same bits # (measured: identical p.mtz on nine battery sets, no measurable time cost), and aarch64, where FMA is # always there and GCC contracts by default, follows the same arithmetic. MSVC does not contract under -# its default /fp:precise. Host code of .cu sources gets it through nvcc; device code is not affected. +# its default /fp:precise. Host code of .cu sources gets it through nvcc. IF (NOT MSVC) ADD_COMPILE_OPTIONS($<$:-ffp-contract=off>) ADD_COMPILE_OPTIONS($<$:-Xcompiler=-ffp-contract=off>) ENDIF() +# The same for device code. nvcc contracts by default and does it separately for every architecture +# it compiles for, so a T4 (sm_75) and an RTX 5080 (sm_120) ran the same kernels to different bits +# and a run that hit a knife edge came out differently on the two machines. Off, the architectures +# compute the same bits (measured: identical p.hkl from sm_75 and sm_120 builds, no measurable time cost). +ADD_COMPILE_OPTIONS($<$:--fmad=false>) SET(JFJOCH_WRITER_ONLY OFF CACHE BOOL "Compile HDF5 writer only") SET(JFJOCH_INSTALL_DRIVER_SOURCE OFF CACHE BOOL "Install kernel driver source (ignored if building writer only; necessary for RPM building)")