Skip to content

Commit

Permalink
Fix truncation of constant value (#1097)
Browse files Browse the repository at this point in the history
* Fix truncation of constant value

* Suppress truncation warning
  • Loading branch information
gevtushenko authored Nov 14, 2023
1 parent 11bd9a0 commit af1641f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libcudacxx/include/cuda/std/detail/libcxx/include/limits
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class _Tp, int __digits, bool _IsSigned>
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 <class _Tp, int __digits>
struct __libcpp_compute_min<_Tp, __digits, false>
Expand Down

0 comments on commit af1641f

Please sign in to comment.