diff --git a/src/pbrt/util/float.h b/src/pbrt/util/float.h index 03431948dca4089856ffb8bfcbf17d185c64348e..3c6db2a36fe4dd3480ec89b0ef78745886acd5ee 100644 --- a/src/pbrt/util/float.h +++ b/src/pbrt/util/float.h @@ -56,7 +56,11 @@ static constexpr float OneMinusEpsilon = FloatOneMinusEpsilon; template inline PBRT_CPU_GPU typename std::enable_if_t::value, bool> IsNaN(T v) { +#ifdef PBRT_IS_GPU_CODE + return isnan(v); +#else return std::isnan(v); +#endif } template @@ -68,7 +72,11 @@ inline PBRT_CPU_GPU typename std::enable_if_t::value, bool> template inline PBRT_CPU_GPU typename std::enable_if_t::value, bool> IsInf(T v) { +#ifdef PBRT_IS_GPU_CODE + return isinf(v); +#else return std::isinf(v); +#endif } template