Skip to content

Commit b2d7e3e

Browse files
committed
tuned makefile flags
1 parent 9176518 commit b2d7e3e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ if (CMAKE_CXX_COMPILER_ID IN_LIST GNU_LIKE_FRONTENDS)
1212
set(FINUFFT_CXX_FLAGS_RELEASE -O3
1313
-funroll-loops
1414
-ffp-contract=fast
15-
-fexcess-precision=fast
1615
-fno-math-errno
1716
-fno-signed-zeros
1817
-fno-trapping-math
1918
-fassociative-math
2019
-freciprocal-math
2120
-fmerge-all-constants
2221
-ftree-vectorize
23-
2422
)
2523
# if -fimplicit-constexpr is supported, add it to the list of flags
2624
check_cxx_compiler_flag("-fimplicit-constexpr" COMPILER_SUPPORTS_FIMPLICIT_CONSTEXPR)

makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ PYTHON = python3
2727
# Notes: 1) -Ofast breaks isfinite() & isnan(), so use -O3 which now is as fast
2828
# 2) -fcx-limited-range for fortran-speed complex arith in C++
2929
# 3) we use simply-expanded (:=) makefile variables, otherwise confusing
30-
CFLAGS := -O3 -funroll-loops -march=native -fcx-limited-range -ffp-contract=fast $(CFLAGS)
30+
# 4) the extra math flags are for speed, but they do not impact accuracy
31+
# they allow gcc to vectorize the code more effectively
32+
CFLAGS := -O3 -funroll-loops -march=native -fcx-limited-range -ffp-contract=fast\
33+
-fno-math-errno -fno-signed-zeros -fno-trapping-math -fassociative-math\
34+
-freciprocal-math -fmerge-all-constants -ftree-vectorize $(CFLAGS)
3135
FFLAGS := $(CFLAGS) $(FFLAGS)
3236
CXXFLAGS := $(CFLAGS) $(CXXFLAGS)
3337
# FFTW base name, and math linking...

0 commit comments

Comments
 (0)