Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limits: Suppress long double device code warning with MSVC #178

Merged
merged 1 commit into from
May 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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