![]() |
Project
|
Shared implementation between public and internal classes. CRTP pattern. More...
#include <GPUORTFloat16.h>
Public Member Functions | |
BFloat16Impl ()=default | |
bool | IsNegative () const noexcept |
Checks if the value is negative. | |
bool | IsNaN () const noexcept |
Tests if the value is NaN. | |
bool | IsFinite () const noexcept |
Tests if the value is finite. | |
bool | IsPositiveInfinity () const noexcept |
Tests if the value represents positive infinity. | |
bool | IsNegativeInfinity () const noexcept |
Tests if the value represents negative infinity. | |
bool | IsInfinity () const noexcept |
Tests if the value is either positive or negative infinity. | |
bool | IsNaNOrZero () const noexcept |
Tests if the value is NaN or zero. Useful for comparisons. | |
bool | IsNormal () const noexcept |
Tests if the value is normal (not zero, subnormal, infinite, or NaN). | |
bool | IsSubnormal () const noexcept |
Tests if the value is subnormal (denormal). | |
Derived | Abs () const noexcept |
Creates an instance that represents absolute value. | |
Derived | Negate () const noexcept |
Creates a new instance with the sign flipped. | |
Static Public Member Functions | |
static bool | AreZero (const BFloat16Impl &lhs, const BFloat16Impl &rhs) noexcept |
IEEE defines that positive and negative zero are equal, this gives us a quick equality check for two values by or'ing the private bits together and stripping the sign. They are both zero, and therefore equivalent, if the resulting value is still zero. | |
Public Attributes | |
uint16_t | val {0} |
Static Public Attributes | |
static constexpr uint16_t | kSignMask = 0x8000U |
static constexpr uint16_t | kBiasedExponentMask = 0x7F80U |
static constexpr uint16_t | kPositiveInfinityBits = 0x7F80U |
static constexpr uint16_t | kNegativeInfinityBits = 0xFF80U |
static constexpr uint16_t | kPositiveQNaNBits = 0x7FC1U |
static constexpr uint16_t | kNegativeQNaNBits = 0xFFC1U |
static constexpr uint16_t | kSignaling_NaNBits = 0x7F80U |
static constexpr uint16_t | kEpsilonBits = 0x0080U |
static constexpr uint16_t | kMinValueBits = 0xFF7FU |
static constexpr uint16_t | kMaxValueBits = 0x7F7FU |
static constexpr uint16_t | kRoundToNearest = 0x7FFFU |
static constexpr uint16_t | kOneBits = 0x3F80U |
static constexpr uint16_t | kMinusOneBits = 0xBF80U |
Protected Member Functions | |
float | ToFloatImpl () const noexcept |
Converts bfloat16 to float. | |
uint16_t | AbsImpl () const noexcept |
Creates an instance that represents absolute value. | |
uint16_t | NegateImpl () const noexcept |
Creates a new instance with the sign flipped. | |
Static Protected Member Functions | |
static uint16_t | ToUint16Impl (float v) noexcept |
Converts from float to uint16_t float16 representation. | |
Shared implementation between public and internal classes. CRTP pattern.
Definition at line 352 of file GPUORTFloat16.h.
|
default |
|
inlinenoexcept |
Creates an instance that represents absolute value.
Definition at line 497 of file GPUORTFloat16.h.
|
inlineprotectednoexcept |
Creates an instance that represents absolute value.
Definition at line 371 of file GPUORTFloat16.h.
|
inlinestaticnoexcept |
IEEE defines that positive and negative zero are equal, this gives us a quick equality check for two values by or'ing the private bits together and stripping the sign. They are both zero, and therefore equivalent, if the resulting value is still zero.
lhs | first value |
rhs | second value |
Definition at line 513 of file GPUORTFloat16.h.
|
inlinenoexcept |
|
inlinenoexcept |
Tests if the value is either positive or negative infinity.
Definition at line 454 of file GPUORTFloat16.h.
|
inlinenoexcept |
|
inlinenoexcept |
Tests if the value is NaN or zero. Useful for comparisons.
Definition at line 463 of file GPUORTFloat16.h.
|
inlinenoexcept |
Checks if the value is negative.
Definition at line 409 of file GPUORTFloat16.h.
|
inlinenoexcept |
Tests if the value represents negative infinity.
Definition at line 445 of file GPUORTFloat16.h.
|
inlinenoexcept |
Tests if the value is normal (not zero, subnormal, infinite, or NaN).
Definition at line 473 of file GPUORTFloat16.h.
|
inlinenoexcept |
Tests if the value represents positive infinity.
Definition at line 436 of file GPUORTFloat16.h.
|
inlinenoexcept |
Tests if the value is subnormal (denormal).
Definition at line 485 of file GPUORTFloat16.h.
|
inlinenoexcept |
Creates a new instance with the sign flipped.
Definition at line 503 of file GPUORTFloat16.h.
|
inlineprotectednoexcept |
Creates a new instance with the sign flipped.
Definition at line 380 of file GPUORTFloat16.h.
|
inlineprotectednoexcept |
Converts bfloat16 to float.
Definition at line 557 of file GPUORTFloat16.h.
|
inlinestaticprotectednoexcept |
Converts from float to uint16_t float16 representation.
v |
Definition at line 523 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 388 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 394 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 396 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 399 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 395 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 390 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 392 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 398 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 389 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 391 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 397 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 393 of file GPUORTFloat16.h.
|
staticconstexpr |
Definition at line 387 of file GPUORTFloat16.h.
uint16_t o2::OrtDataType::BFloat16Impl< Derived >::val {0} |
Definition at line 401 of file GPUORTFloat16.h.