HDK
|
Shared implementation between public and internal classes. CRTP pattern. More...
#include <onnxruntime_float16.h>
Public Member Functions | |
BFloat16Impl ()=default | |
bool | IsNegative () const noexcept |
Checks if the value is negative More... | |
bool | IsNaN () const noexcept |
Tests if the value is NaN More... | |
bool | IsFinite () const noexcept |
Tests if the value is finite More... | |
bool | IsPositiveInfinity () const noexcept |
Tests if the value represents positive infinity. More... | |
bool | IsNegativeInfinity () const noexcept |
Tests if the value represents negative infinity More... | |
bool | IsInfinity () const noexcept |
Tests if the value is either positive or negative infinity. More... | |
bool | IsNaNOrZero () const noexcept |
Tests if the value is NaN or zero. Useful for comparisons. More... | |
bool | IsNormal () const noexcept |
Tests if the value is normal (not zero, subnormal, infinite, or NaN). More... | |
bool | IsSubnormal () const noexcept |
Tests if the value is subnormal (denormal). More... | |
Derived | Abs () const noexcept |
Creates an instance that represents absolute value. More... | |
Derived | Negate () const noexcept |
Creates a new instance with the sign flipped. More... | |
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. More... | |
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 More... | |
uint16_t | AbsImpl () const noexcept |
Creates an instance that represents absolute value. More... | |
uint16_t | NegateImpl () const noexcept |
Creates a new instance with the sign flipped. More... | |
Static Protected Member Functions | |
static uint16_t | ToUint16Impl (float v) noexcept |
Converts from float to uint16_t float16 representation More... | |
Shared implementation between public and internal classes. CRTP pattern.
Definition at line 328 of file onnxruntime_float16.h.
|
default |
|
inlinenoexcept |
Creates an instance that represents absolute value.
Definition at line 462 of file onnxruntime_float16.h.
|
inlineprotectednoexcept |
Creates an instance that represents absolute value.
Definition at line 347 of file onnxruntime_float16.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 478 of file onnxruntime_float16.h.
|
inlinenoexcept |
Tests if the value is finite
Definition at line 399 of file onnxruntime_float16.h.
|
inlinenoexcept |
Tests if the value is either positive or negative infinity.
Definition at line 423 of file onnxruntime_float16.h.
|
inlinenoexcept |
|
inlinenoexcept |
Tests if the value is NaN or zero. Useful for comparisons.
Definition at line 431 of file onnxruntime_float16.h.
|
inlinenoexcept |
Checks if the value is negative
Definition at line 383 of file onnxruntime_float16.h.
|
inlinenoexcept |
Tests if the value represents negative infinity
Definition at line 415 of file onnxruntime_float16.h.
|
inlinenoexcept |
Tests if the value is normal (not zero, subnormal, infinite, or NaN).
Definition at line 440 of file onnxruntime_float16.h.
|
inlinenoexcept |
Tests if the value represents positive infinity.
Definition at line 407 of file onnxruntime_float16.h.
|
inlinenoexcept |
Tests if the value is subnormal (denormal).
Definition at line 451 of file onnxruntime_float16.h.
|
inlinenoexcept |
Creates a new instance with the sign flipped.
Definition at line 468 of file onnxruntime_float16.h.
|
inlineprotectednoexcept |
Creates a new instance with the sign flipped.
Definition at line 355 of file onnxruntime_float16.h.
|
inlineprotectednoexcept |
Converts bfloat16 to float
Definition at line 519 of file onnxruntime_float16.h.
|
inlinestaticprotectednoexcept |
Converts from float to uint16_t float16 representation
v |
Definition at line 487 of file onnxruntime_float16.h.
|
static |
Definition at line 362 of file onnxruntime_float16.h.
|
static |
Definition at line 368 of file onnxruntime_float16.h.
|
static |
Definition at line 370 of file onnxruntime_float16.h.
|
static |
Definition at line 373 of file onnxruntime_float16.h.
|
static |
Definition at line 369 of file onnxruntime_float16.h.
|
static |
Definition at line 364 of file onnxruntime_float16.h.
|
static |
Definition at line 366 of file onnxruntime_float16.h.
|
static |
Definition at line 372 of file onnxruntime_float16.h.
|
static |
Definition at line 363 of file onnxruntime_float16.h.
|
static |
Definition at line 365 of file onnxruntime_float16.h.
|
static |
Definition at line 371 of file onnxruntime_float16.h.
|
static |
Definition at line 367 of file onnxruntime_float16.h.
|
static |
Definition at line 361 of file onnxruntime_float16.h.
uint16_t onnxruntime_float16::BFloat16Impl< Derived >::val {0} |
Definition at line 375 of file onnxruntime_float16.h.