From a5e6ba0c443b13941122124d473268e379e48a7d Mon Sep 17 00:00:00 2001 From: Patrick Stotko Date: Thu, 28 May 2020 12:43:41 +0200 Subject: [PATCH] limits: Suppress long double device code warning with MSVC --- src/stdgpu/impl/limits_detail.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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