Skip to content

Commit 76948c6

Browse files
committed
flags are needed at compile time
1 parent 7951eda commit 76948c6

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ project(finufft VERSION 2.2.0 LANGUAGES C CXX)
44

55
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
66

7+
include(CheckCXXCompilerFlag)
78

89
set(GNU_LIKE_FRONTENDS AppleClang Clang GNU)
910
if (CMAKE_CXX_COMPILER_ID IN_LIST GNU_LIKE_FRONTENDS)
@@ -12,7 +13,18 @@ if (CMAKE_CXX_COMPILER_ID IN_LIST GNU_LIKE_FRONTENDS)
1213
-funroll-loops
1314
-ffp-contract=fast
1415
-fexcess-precision=fast
16+
-fno-math-errno
17+
-fno-signed-zeros
18+
-fno-trapping-math
19+
-fassociative-math
20+
-freciprocal-math
21+
-fmerge-all-constants
1522
)
23+
# if the compiler does support -fimplicit-constexpr add it
24+
check_cxx_compiler_flag("-fimplicit-constexpr" COMPILER_SUPPORTS_FIMPLICIT_CONSTEXPR)
25+
if (COMPILER_SUPPORTS_FIMPLICIT_CONSTEXPR)
26+
list(APPEND FINUFFT_CXX_FLAGS_RELEASE -fimplicit-constexpr)
27+
endif ()
1628
set(FINUFFT_CXX_FLAGS_RELWITHDEBINFO -g ${FINUFFT_CXX_FLAGS_RELEASE})
1729
endif ()
1830

src/spreadinterp.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,11 +1014,6 @@ FINUFFT_NEVER_INLINE static void interp_square_wrap(
10141014
target[1] = out[1];
10151015
}
10161016

1017-
#pragma GCC optimize("no-math-errno")
1018-
#pragma GCC optimize("no-signed-zeros")
1019-
#pragma GCC optimize("no-trapping-math")
1020-
#pragma GCC optimize("associative-math")
1021-
#pragma GCC optimize("reciprocal-math")
10221017
template<uint8_t ns, class simd_type>
10231018
void interp_square(FLT *FINUFFT_RESTRICT target, const FLT *du, const FLT *ker1,
10241019
const FLT *ker2, const BIGINT i1, const BIGINT i2, const UBIGINT N1,
@@ -1218,11 +1213,6 @@ FINUFFT_NEVER_INLINE static void interp_cube_wrapped(
12181213
target[1] = out[1];
12191214
}
12201215

1221-
#pragma GCC optimize("no-math-errno")
1222-
#pragma GCC optimize("no-signed-zeros")
1223-
#pragma GCC optimize("no-trapping-math")
1224-
#pragma GCC optimize("associative-math")
1225-
#pragma GCC optimize("reciprocal-math")
12261216
template<uint8_t ns, class simd_type>
12271217
void interp_cube(FLT *FINUFFT_RESTRICT target, const FLT *du, const FLT *ker1,
12281218
const FLT *ker2, const FLT *ker3, const BIGINT i1, const BIGINT i2,

0 commit comments

Comments
 (0)