@@ -94,14 +94,12 @@ class GPUCommonMath
9494 GPUd () constexpr static float Pi () { return 3 .1415927f ; }
9595 GPUd () constexpr static float Round (float x);
9696 GPUd () constexpr static float Floor (float x) { return GPUCA_CHOICE (floorf (x), floorf (x), floor (x)); }
97- GPUd () static uint32_t Float2UIntReint (float x);
97+ GPUd () static uint32_t Float2UIntReint (const float & x);
9898 GPUd () constexpr static uint32_t Float2UIntRn (float x) { return (uint32_t )(int32_t )(x + 0 .5f ); }
9999 GPUd () constexpr static int32_t Float2IntRn (float x);
100100 GPUd () constexpr static float Modf (float x, float y);
101- GPUd () constexpr static bool Finite (float x) { return GPUCA_CHOICE (std::isfinite (x), isfinite (x), isfinite (x)); }
102- GPUd () constexpr static bool IsNaN (float x) { return GPUCA_CHOICE (std::isnan (x), isnan (x), isnan (x)); }
103- GPUd () constexpr static bool FiniteRelaxed (float x); // always true if not using NO_FAST_MATH
104- GPUd () constexpr static bool IsNaNRelaxed (float x); // always true if not using NO_FAST_MATH
101+ GPUd () constexpr static bool Finite (float x);
102+ GPUd () constexpr static bool IsNaN (float x);
105103 GPUd () constexpr static float QuietNaN () { return GPUCA_CHOICE (std::numeric_limits<float >::quiet_NaN (), __builtin_nanf (" " ), nan (0u )); }
106104 GPUd () constexpr static uint32_t Clz (uint32_t val);
107105 GPUd () constexpr static uint32_t Popcount (uint32_t val);
@@ -241,7 +239,7 @@ GPUdi() float2 GPUCommonMath::MakeFloat2(float x, float y)
241239
242240GPUdi () constexpr float GPUCommonMath::Modf (float x, float y) { return GPUCA_CHOICE (fmodf (x, y), fmodf (x, y), fmod (x, y)); }
243241
244- GPUdi () uint32_t GPUCommonMath::Float2UIntReint (float x)
242+ GPUdi () uint32_t GPUCommonMath::Float2UIntReint (const float & x)
245243{
246244#if defined(GPUCA_GPUCODE_DEVICE) && (defined(__CUDACC__) || defined(__HIPCC__))
247245 return __float_as_uint (x);
@@ -266,8 +264,8 @@ GPUdi() constexpr float GPUCommonMath::ASin(float x) { return GPUCA_CHOICE((floa
266264GPUdi () constexpr float GPUCommonMath::ACos(float x) { return GPUCA_CHOICE ((float )acos ((double )x), (float )acos ((double )x), acos (x)); }
267265GPUdi () constexpr float GPUCommonMath::Log(float x) { return GPUCA_CHOICE ((float )log ((double )x), (float )log ((double )x), log (x)); }
268266GPUdi () constexpr float GPUCommonMath::Exp(float x) { return GPUCA_CHOICE ((float )exp ((double )x), (float )exp ((double )x), exp (x)); }
269- GPUdi () constexpr bool GPUCommonMath::FiniteRelaxed (float x) { return Finite (x ); }
270- GPUdi () constexpr bool GPUCommonMath::IsNaNRelaxed (float x) { return IsNaN (x ); }
267+ GPUdi () constexpr bool GPUCommonMath::Finite (float x) { return GPUCA_CHOICE ( std::isfinite (x), isfinite (x), isfinite (x) ); }
268+ GPUdi () constexpr bool GPUCommonMath::IsNaN (float x) { return GPUCA_CHOICE ( std::isnan (x), isnan (x), isnan (x) ); }
271269#else
272270GPUdi () constexpr float GPUCommonMath::Round(float x) { return GPUCA_CHOICE (roundf (x), rintf (x), rint (x)); }
273271GPUdi () constexpr int32_t GPUCommonMath::Float2IntRn(float x) { return GPUCA_CHOICE ((int32_t )Round (x), __float2int_rn (x), (int32_t )Round (x)); }
@@ -282,8 +280,8 @@ GPUdi() constexpr float GPUCommonMath::ASin(float x) { return GPUCA_CHOICE(asinf
282280GPUdi () constexpr float GPUCommonMath::ACos(float x) { return GPUCA_CHOICE (acosf (x), acosf (x), acos (x)); }
283281GPUdi () constexpr float GPUCommonMath::Log(float x) { return GPUCA_CHOICE (logf (x), logf (x), log (x)); }
284282GPUdi () constexpr float GPUCommonMath::Exp(float x) { return GPUCA_CHOICE (expf (x), expf (x), exp (x)); }
285- GPUdi () constexpr bool GPUCommonMath::FiniteRelaxed (float x) { return true ; }
286- GPUdi () constexpr bool GPUCommonMath::IsNaNRelaxed (float x) { return false ; }
283+ GPUdi () constexpr bool GPUCommonMath::Finite (float x) { return true ; }
284+ GPUdi () constexpr bool GPUCommonMath::IsNaN (float x) { return false ; }
287285#endif
288286
289287GPUhdi () void GPUCommonMath::SinCos (float x, float & s, float & c)
0 commit comments