From af1641fdf45a742c3e6077a378d0327239c84a0d Mon Sep 17 00:00:00 2001 From: Georgii Evtushenko Date: Tue, 14 Nov 2023 09:03:40 -0800 Subject: [PATCH] Fix truncation of constant value (#1097) * Fix truncation of constant value * Suppress truncation warning --- libcudacxx/include/cuda/std/detail/libcxx/include/limits | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/limits b/libcudacxx/include/cuda/std/detail/libcxx/include/limits index 4c12ba5cbcc..e89a8785b0e 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/limits +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/limits @@ -197,11 +197,18 @@ protected: static constexpr float_round_style round_style = round_toward_zero; }; +#if defined(_LIBCUDACXX_COMPILER_MSVC) +# pragma warning(push) +# pragma warning(disable : 4309) +#endif // _LIBCUDACXX_COMPILER_MSVC template struct __libcpp_compute_min { static constexpr _Tp value = static_cast<_Tp>(_Tp(1) << __digits); }; +#if defined(_LIBCUDACXX_COMPILER_MSVC) +# pragma warning(pop) +#endif // _LIBCUDACXX_COMPILER_MSVC template struct __libcpp_compute_min<_Tp, __digits, false>