Skip to content

Commit 0064a3a

Browse files
committed
With -ffast-math, std::finite is UB and one shoult assume all float to be finite
1 parent ce9dd39 commit 0064a3a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Common/MathUtils/include/MathUtils/detail/basicMath.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ GPUdi() int nint(double x)
113113
template <>
114114
GPUdi() bool finite(double x)
115115
{
116+
#ifdef __FAST_MATH__
117+
return false;
118+
#else
116119
return std::isfinite(x);
120+
#endif
117121
}
118122
template <>
119123
GPUdi() double log(double x)

0 commit comments

Comments
 (0)