@@ -82,6 +82,7 @@ class GPUCommonMath
8282 GPUd () static int32_t Float2IntRn (float x);
8383 GPUd () static float Modf (float x, float y);
8484 GPUd () static bool Finite (float x);
85+ GPUd () static bool IsNaN (float x);
8586 GPUd () static uint32_t Clz (uint32_t val);
8687 GPUd () static uint32_t Popcount (uint32_t val);
8788
@@ -224,7 +225,8 @@ GPUdi() float GPUCommonMath::Floor(float x) { return CHOICE(floorf(x), floorf(x)
224225#ifdef GPUCA_NO_FAST_MATH
225226GPUdi () float GPUCommonMath::Round(float x) { return CHOICE (roundf (x), roundf (x), round (x)); }
226227GPUdi () int32_t GPUCommonMath::Float2IntRn(float x) { return (int32_t )Round (x); }
227- GPUdi () bool GPUCommonMath::Finite(float x) { return CHOICE (std::isfinite (x), isfinite (x), true ); }
228+ GPUdi () bool GPUCommonMath::Finite(float x) { return CHOICE (std::isfinite (x), isfinite (x), true ); } // Fixme: fix these 2 for OpenCL
229+ GPUdi () bool GPUCommonMath::IsNaN(float x) { return CHOICE (std::isnan (x), isnan (x), false ); }
228230GPUhdi () float GPUCommonMath::Sqrt(float x) { return CHOICE (sqrtf (x), (float )sqrt ((double )x), sqrt (x)); }
229231GPUdi () float GPUCommonMath::ATan(float x) { return CHOICE ((float )atan ((double )x), (float )atan ((double )x), atan (x)); }
230232GPUhdi () float GPUCommonMath::ATan2(float y, float x) { return CHOICE ((float )atan2 ((double )y, (double )x), (float )atan2 ((double )y, (double )x), atan2 (y, x)); }
0 commit comments