Skip to content
Merged
Show file tree
Hide file tree
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
112 changes: 56 additions & 56 deletions libcudacxx/include/cuda/std/__limits/numeric_limits.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ class __numeric_limits_impl
using type = _Tp;

static constexpr bool is_specialized = false;
_CCCL_API static constexpr type min() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type min() noexcept
{
return type();
}
_CCCL_API static constexpr type max() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type max() noexcept
{
return type();
}
_CCCL_API static constexpr type lowest() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type lowest() noexcept
{
return type();
}
Expand All @@ -115,11 +115,11 @@ class __numeric_limits_impl
static constexpr bool is_integer = false;
static constexpr bool is_exact = false;
static constexpr int radix = 0;
_CCCL_API static constexpr type epsilon() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type epsilon() noexcept
{
return type();
}
_CCCL_API static constexpr type round_error() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type round_error() noexcept
{
return type();
}
Expand All @@ -134,19 +134,19 @@ class __numeric_limits_impl
static constexpr bool has_signaling_NaN = false;
_CCCL_DEPRECATED_IN_CXX23 static constexpr float_denorm_style has_denorm = denorm_absent;
_CCCL_DEPRECATED_IN_CXX23 static constexpr bool has_denorm_loss = false;
_CCCL_API static constexpr type infinity() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type infinity() noexcept
{
return type();
}
_CCCL_API static constexpr type quiet_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type quiet_NaN() noexcept
{
return type();
}
_CCCL_API static constexpr type signaling_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type signaling_NaN() noexcept
{
return type();
}
_CCCL_API static constexpr type denorm_min() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type denorm_min() noexcept
{
return type();
}
Expand All @@ -172,28 +172,28 @@ class __numeric_limits_impl<_Tp, __numeric_limits_type::__integral>
static constexpr int digits = static_cast<int>(sizeof(type) * CHAR_BIT - is_signed);
static constexpr int digits10 = digits * 3 / 10;
static constexpr int max_digits10 = 0;
_CCCL_API static constexpr type min() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type min() noexcept
{
return static_cast<_Tp>(~max());
}
_CCCL_API static constexpr type max() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type max() noexcept
{
using _Up = make_unsigned_t<_Tp>;
return static_cast<_Tp>(static_cast<_Up>(~_Up{0}) >> static_cast<int>(is_signed));
}
_CCCL_API static constexpr type lowest() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type lowest() noexcept
{
return min();
}

static constexpr bool is_integer = true;
static constexpr bool is_exact = true;
static constexpr int radix = 2;
_CCCL_API static constexpr type epsilon() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type epsilon() noexcept
{
return type(0);
}
_CCCL_API static constexpr type round_error() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type round_error() noexcept
{
return type(0);
}
Expand All @@ -208,19 +208,19 @@ class __numeric_limits_impl<_Tp, __numeric_limits_type::__integral>
static constexpr bool has_signaling_NaN = false;
_CCCL_DEPRECATED_IN_CXX23 static constexpr float_denorm_style has_denorm = denorm_absent;
_CCCL_DEPRECATED_IN_CXX23 static constexpr bool has_denorm_loss = false;
_CCCL_API static constexpr type infinity() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type infinity() noexcept
{
return type(0);
}
_CCCL_API static constexpr type quiet_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type quiet_NaN() noexcept
{
return type(0);
}
_CCCL_API static constexpr type signaling_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type signaling_NaN() noexcept
{
return type(0);
}
_CCCL_API static constexpr type denorm_min() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type denorm_min() noexcept
{
return type(0);
}
Expand Down Expand Up @@ -251,27 +251,27 @@ class __numeric_limits_impl<bool, __numeric_limits_type::__bool>
static constexpr int digits10 = 0;
static constexpr int max_digits10 = 0;

_CCCL_API static constexpr type min() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type min() noexcept
{
return false;
}
_CCCL_API static constexpr type max() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type max() noexcept
{
return true;
}
_CCCL_API static constexpr type lowest() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type lowest() noexcept
{
return min();
}

static constexpr bool is_integer = true;
static constexpr bool is_exact = true;
static constexpr int radix = 2;
_CCCL_API static constexpr type epsilon() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type epsilon() noexcept
{
return false;
}
_CCCL_API static constexpr type round_error() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type round_error() noexcept
{
return false;
}
Expand All @@ -286,19 +286,19 @@ class __numeric_limits_impl<bool, __numeric_limits_type::__bool>
static constexpr bool has_signaling_NaN = false;
_CCCL_DEPRECATED_IN_CXX23 static constexpr float_denorm_style has_denorm = denorm_absent;
_CCCL_DEPRECATED_IN_CXX23 static constexpr bool has_denorm_loss = false;
_CCCL_API static constexpr type infinity() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type infinity() noexcept
{
return false;
}
_CCCL_API static constexpr type quiet_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type quiet_NaN() noexcept
{
return false;
}
_CCCL_API static constexpr type signaling_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type signaling_NaN() noexcept
{
return false;
}
_CCCL_API static constexpr type denorm_min() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type denorm_min() noexcept
{
return false;
}
Expand All @@ -324,27 +324,27 @@ class __numeric_limits_impl<float, __numeric_limits_type::__floating_point>
static constexpr int digits = FLT_MANT_DIG;
static constexpr int digits10 = FLT_DIG;
static constexpr int max_digits10 = 2 + (digits * 30103l) / 100000l;
_CCCL_API static constexpr type min() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type min() noexcept
{
return FLT_MIN;
}
_CCCL_API static constexpr type max() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type max() noexcept
{
return FLT_MAX;
}
_CCCL_API static constexpr type lowest() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type lowest() noexcept
{
return -max();
}

static constexpr bool is_integer = false;
static constexpr bool is_exact = false;
static constexpr int radix = FLT_RADIX;
_CCCL_API static constexpr type epsilon() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type epsilon() noexcept
{
return FLT_EPSILON;
}
_CCCL_API static constexpr type round_error() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type round_error() noexcept
{
return 0.5F;
}
Expand All @@ -360,26 +360,26 @@ class __numeric_limits_impl<float, __numeric_limits_type::__floating_point>
_CCCL_DEPRECATED_IN_CXX23 static constexpr float_denorm_style has_denorm = denorm_present;
_CCCL_DEPRECATED_IN_CXX23 static constexpr bool has_denorm_loss = false;

_CCCL_API static constexpr type infinity() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type infinity() noexcept
{
return _CCCL_BUILTIN_HUGE_VALF();
}
_CCCL_API static constexpr type quiet_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type quiet_NaN() noexcept
{
return _CCCL_BUILTIN_NANF();
}
#if defined(_CCCL_BUILTIN_NANSF)
_CCCL_API static constexpr type signaling_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type signaling_NaN() noexcept
{
return _CCCL_BUILTIN_NANSF();
}
#else // ^^^ _CCCL_BUILTIN_NANSF ^^^ // vvv !_CCCL_BUILTIN_NANSF vvv
_CCCL_API static _CCCL_CONSTEXPR_BIT_CAST type signaling_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static _CCCL_CONSTEXPR_BIT_CAST type signaling_NaN() noexcept
{
return ::cuda::std::bit_cast<type>(0x7fa00000);
}
#endif // !_CCCL_BUILTIN_NANSF
_CCCL_API static constexpr type denorm_min() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type denorm_min() noexcept
{
#if defined(FLT_TRUE_MIN)
return FLT_TRUE_MIN;
Expand Down Expand Up @@ -409,27 +409,27 @@ class __numeric_limits_impl<double, __numeric_limits_type::__floating_point>
static constexpr int digits = DBL_MANT_DIG;
static constexpr int digits10 = DBL_DIG;
static constexpr int max_digits10 = 2 + (digits * 30103l) / 100000l;
_CCCL_API static constexpr type min() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type min() noexcept
{
return DBL_MIN;
}
_CCCL_API static constexpr type max() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type max() noexcept
{
return DBL_MAX;
}
_CCCL_API static constexpr type lowest() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type lowest() noexcept
{
return -max();
}

static constexpr bool is_integer = false;
static constexpr bool is_exact = false;
static constexpr int radix = FLT_RADIX;
_CCCL_API static constexpr type epsilon() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type epsilon() noexcept
{
return DBL_EPSILON;
}
_CCCL_API static constexpr type round_error() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type round_error() noexcept
{
return 0.5;
}
Expand All @@ -445,26 +445,26 @@ class __numeric_limits_impl<double, __numeric_limits_type::__floating_point>
_CCCL_DEPRECATED_IN_CXX23 static constexpr float_denorm_style has_denorm = denorm_present;
_CCCL_DEPRECATED_IN_CXX23 static constexpr bool has_denorm_loss = false;

_CCCL_API static constexpr type infinity() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type infinity() noexcept
{
return _CCCL_BUILTIN_HUGE_VAL();
}
_CCCL_API static constexpr type quiet_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type quiet_NaN() noexcept
{
return _CCCL_BUILTIN_NAN();
}
#if defined(_CCCL_BUILTIN_NANS)
_CCCL_API static constexpr type signaling_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type signaling_NaN() noexcept
{
return _CCCL_BUILTIN_NANS();
}
#else // ^^^ _CCCL_BUILTIN_NANS ^^^ // vvv !_CCCL_BUILTIN_NANS vvv
_CCCL_API static _CCCL_CONSTEXPR_BIT_CAST type signaling_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static _CCCL_CONSTEXPR_BIT_CAST type signaling_NaN() noexcept
{
return ::cuda::std::bit_cast<type>(0x7ff4000000000000);
}
#endif // !_CCCL_BUILTIN_NANS
_CCCL_API static constexpr type denorm_min() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type denorm_min() noexcept
{
#if defined(DBL_TRUE_MIN)
return DBL_TRUE_MIN;
Expand Down Expand Up @@ -496,27 +496,27 @@ class __numeric_limits_impl<long double, __numeric_limits_type::__floating_point
static constexpr int digits = LDBL_MANT_DIG;
static constexpr int digits10 = LDBL_DIG;
static constexpr int max_digits10 = 2 + (digits * 30103l) / 100000l;
_CCCL_API static constexpr type min() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type min() noexcept
{
return LDBL_MIN;
}
_CCCL_API static constexpr type max() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type max() noexcept
{
return LDBL_MAX;
}
_CCCL_API static constexpr type lowest() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type lowest() noexcept
{
return -max();
}

static constexpr bool is_integer = false;
static constexpr bool is_exact = false;
static constexpr int radix = FLT_RADIX;
_CCCL_API static constexpr type epsilon() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type epsilon() noexcept
{
return LDBL_EPSILON;
}
_CCCL_API static constexpr type round_error() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type round_error() noexcept
{
return 0.5L;
}
Expand All @@ -531,19 +531,19 @@ class __numeric_limits_impl<long double, __numeric_limits_type::__floating_point
static constexpr bool has_signaling_NaN = true;
_CCCL_DEPRECATED_IN_CXX23 static constexpr float_denorm_style has_denorm = denorm_present;
_CCCL_DEPRECATED_IN_CXX23 static constexpr bool has_denorm_loss = false;
_CCCL_API static constexpr type infinity() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type infinity() noexcept
{
return _CCCL_BUILTIN_HUGE_VALL();
}
_CCCL_API static constexpr type quiet_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type quiet_NaN() noexcept
{
return _CCCL_BUILTIN_NANL();
}
_CCCL_API static constexpr type signaling_NaN() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type signaling_NaN() noexcept
{
return _CCCL_BUILTIN_NANSL();
}
_CCCL_API static constexpr type denorm_min() noexcept
[[nodiscard]] _CCCL_TRIVIAL_API static constexpr type denorm_min() noexcept
{
# if defined(LDBL_TRUE_MIN)
return LDBL_TRUE_MIN;
Expand Down
Loading
Loading