Skip to content

Commit a8fb2e0

Browse files
committed
GPU Math: Suppress compiler warnings about NaN in ffast-math
1 parent 3d2a03c commit a8fb2e0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

GPU/Common/GPUCommonMath.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ class GPUCommonMath
9999
GPUhdi() static float Remainderf(float x, float y);
100100
GPUd() constexpr static bool Finite(float x);
101101
GPUd() constexpr static bool IsNaN(float x);
102+
#pragma GCC diagnostic push
103+
#if defined(__FAST_MATH__) && defined(__clang__)
104+
#pragma GCC diagnostic ignored "-Wnan-infinity-disabled"
105+
#endif
102106
GPUd() constexpr static float QuietNaN() { return GPUCA_CHOICE(std::numeric_limits<float>::quiet_NaN(), __builtin_nanf(""), nan(0u)); }
107+
#pragma GCC diagnostic pop
103108
GPUd() constexpr static uint32_t Clz(uint32_t val);
104109
GPUd() constexpr static uint32_t Popcount(uint32_t val);
105110

0 commit comments

Comments
 (0)