File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,27 @@ project(finufft VERSION 2.2.0 LANGUAGES C CXX)
44
55set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
66
7+
78set (GNU_LIKE_FRONTENDS AppleClang Clang GNU)
89if (CMAKE_CXX_COMPILER_ID IN_LIST GNU_LIKE_FRONTENDS)
910 # Set custom compiler flags for gcc-compatible compilers
10- set (FINUFFT_CXX_FLAGS_RELEASE -O3 -funroll-loops -ffp-contract=fast)
11+ set (FINUFFT_CXX_FLAGS_RELEASE -O3
12+ -funroll-loops
13+ -ffp-contract=fast
14+ -fexcess-precision=fast
15+ -fno-math-errno
16+ -fno-signed-zeros
17+ -fno-trapping-math
18+ -fassociative-math
19+ -freciprocal-math
20+ # These flags make the spreader 20% faster in 2D and up to 100% faster in 3D with no loss of accuracy.
21+ # Why no -fast-math or -funsafe-math-optimizations ?
22+ # It breaks the code, and influences other software that depend on finufft bu changing the rounding mode.
23+ # GCC-13 recently fixed this issue:
24+ # https://github.com/llvm/llvm-project/issues/57589
25+ # https://gcc.gnu.org/gcc-13/changes.html
26+ # https://trofi.github.io/posts/302-Ofast-and-ffast-math-non-local-effects.html
27+ )
1128 set (FINUFFT_CXX_FLAGS_RELWITHDEBINFO -g ${FINUFFT_CXX_FLAGS_RELEASE} )
1229endif ()
1330
You can’t perform that action at this time.
0 commit comments