diff --git a/src/stdgpu/impl/limits_detail.h b/src/stdgpu/impl/limits_detail.h index 3d47cedc4..3a89fd50d 100644 --- a/src/stdgpu/impl/limits_detail.h +++ b/src/stdgpu/impl/limits_detail.h @@ -21,6 +21,8 @@ #include #include +#include + namespace stdgpu @@ -749,7 +751,12 @@ numeric_limits::round_error() noexcept constexpr STDGPU_HOST_DEVICE long double numeric_limits::infinity() noexcept { - return HUGE_VALL; + // Suppress long double is treated as double in device code warning for MSVC on CUDA + #if STDGPU_HOST_COMPILER == STDGPU_HOST_COMPILER_MSVC + return HUGE_VAL; + #else + return HUGE_VALL; + #endif } } // namespace stdgpu