Skip to content

Commit

Permalink
limits: Suppress long double device code warning with MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
stotko committed May 28, 2020
1 parent 3caec37 commit d005edc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/stdgpu/impl/limits_detail.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <cmath>
#include <cstdint>

#include <stdgpu/compiler.h>



namespace stdgpu
Expand Down Expand Up @@ -749,7 +751,12 @@ numeric_limits<long double>::round_error() noexcept
constexpr STDGPU_HOST_DEVICE long double
numeric_limits<long double>::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
Expand Down

0 comments on commit d005edc

Please sign in to comment.