-
Notifications
You must be signed in to change notification settings - Fork 3
Description
gcc
According to the documentation of -ffinite-math-only:
Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or +-Infs.
When -ffinite-math-only is used, gcc
-
may replace a call to
std::isnan(arg)with0(x86-64, aarch64). -
compiles correctly the current implementation of
xtd::isnan(arg)(x86-64, aarch64).
nvcc
According to the documentation --use_fast_math:
Make use of fast math library.
--use_fast_mathimplies--ftz=true --prec-div=false --prec-sqrt=false --fmad=true.
When --use_fast_math is used, nvcc
-
compiles
std::isnan(arg),::isnan(arg)and__builtin_isnan(arg)to correct PTX (sm_90) -
compiles the current implementation of
xtd::isnan(arg)to correct PTX (sm_90)
clang
According to the documentation of -ffinite-math-only:
Allow floating-point optimizations that assume arguments and results are not NaNs or +-inf. This defines the
__FINITE_MATH_ONLY__preprocessor macro.
host compilation
When -ffinite-math-only is used, clang
-
may replace a call to
std::isnan(arg)with0, with a warning (x86-64, aarch64):warning: use of NaN is undefined behavior due to the currently enabled floating-point options [-Wnan-infinity-disabled]
-
optimises the current implementation of
xtd::isnan(arg)and replaces it with0(x86-64, aarch64)
clang -x cu
When -ffinite-math-only is used, clang -x cu
-
may replace a call to
__builtin_isnan(arg)with0, with a warning (sm_90):warning: use of NaN is undefined behavior due to the currently enabled floating-point options [-Wnan-infinity-disabled]
-
optimises the current implementation of
xtd::isnan(arg)and replaces it with0(sm_90)
clang -x hip, hipcc
When -ffinite-math-only is used, hipcc or clang -x hip
-
may replace a call to
__builtin_isnan(arg),::isnan(arg)orstd::isnan(arg)with0, with a warning (gfx906, gfx942) -
optimises the current implementation of
xtd::isnan(arg)and replaces it with0(gfx906)