HDK
|
Shared implementation between public and internal classes. CRTP pattern. More...
#include <onnxruntime_float16.h>
Public Member Functions | |
Float16Impl ()=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... | |
bool | operator== (const Float16Impl &rhs) const noexcept |
bool | operator!= (const Float16Impl &rhs) const noexcept |
bool | operator< (const Float16Impl &rhs) const noexcept |
Static Public Member Functions | |
static bool | AreZero (const Float16Impl &lhs, const Float16Impl &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 = 0x7C00U |
static constexpr uint16_t | kPositiveInfinityBits = 0x7C00U |
static constexpr uint16_t | kNegativeInfinityBits = 0xFC00U |
static constexpr uint16_t | kPositiveQNaNBits = 0x7E00U |
static constexpr uint16_t | kNegativeQNaNBits = 0xFE00U |
static constexpr uint16_t | kEpsilonBits = 0x4170U |
static constexpr uint16_t | kMinValueBits = 0xFBFFU |
static constexpr uint16_t | kMaxValueBits = 0x7BFFU |
static constexpr uint16_t | kOneBits = 0x3C00U |
static constexpr uint16_t | kMinusOneBits = 0xBC00U |
Protected Member Functions | |
float | ToFloatImpl () const noexcept |
Converts float16 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 constexpr 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 39 of file onnxruntime_float16.h.
|
default |
|
inlinenoexcept |
Creates an instance that represents absolute value.
Definition at line 171 of file onnxruntime_float16.h.
|
inlineprotectednoexcept |
Creates an instance that represents absolute value.
Definition at line 58 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 187 of file onnxruntime_float16.h.
|
inlinenoexcept |
Tests if the value is finite
Definition at line 108 of file onnxruntime_float16.h.
|
inlinenoexcept |
Tests if the value is either positive or negative infinity.
Definition at line 132 of file onnxruntime_float16.h.
|
inlinenoexcept |
|
inlinenoexcept |
Tests if the value is NaN or zero. Useful for comparisons.
Definition at line 140 of file onnxruntime_float16.h.
|
inlinenoexcept |
Checks if the value is negative
Definition at line 92 of file onnxruntime_float16.h.
|
inlinenoexcept |
Tests if the value represents negative infinity
Definition at line 124 of file onnxruntime_float16.h.
|
inlinenoexcept |
Tests if the value is normal (not zero, subnormal, infinite, or NaN).
Definition at line 149 of file onnxruntime_float16.h.
|
inlinenoexcept |
Tests if the value represents positive infinity.
Definition at line 116 of file onnxruntime_float16.h.
|
inlinenoexcept |
Tests if the value is subnormal (denormal).
Definition at line 160 of file onnxruntime_float16.h.
|
inlinenoexcept |
Creates a new instance with the sign flipped.
Definition at line 177 of file onnxruntime_float16.h.
|
inlineprotectednoexcept |
Creates a new instance with the sign flipped.
Definition at line 66 of file onnxruntime_float16.h.
|
inlinenoexcept |
Definition at line 199 of file onnxruntime_float16.h.
|
inlinenoexcept |
Definition at line 201 of file onnxruntime_float16.h.
|
inlinenoexcept |
Definition at line 191 of file onnxruntime_float16.h.
|
inlineprotectednoexcept |
Converts float16 to float
Definition at line 296 of file onnxruntime_float16.h.
|
inlinestaticprotectednoexcept |
Converts from float to uint16_t float16 representation
v |
Definition at line 248 of file onnxruntime_float16.h.
|
static |
Definition at line 73 of file onnxruntime_float16.h.
|
static |
Definition at line 78 of file onnxruntime_float16.h.
|
static |
Definition at line 80 of file onnxruntime_float16.h.
|
static |
Definition at line 82 of file onnxruntime_float16.h.
|
static |
Definition at line 79 of file onnxruntime_float16.h.
|
static |
Definition at line 75 of file onnxruntime_float16.h.
|
static |
Definition at line 77 of file onnxruntime_float16.h.
|
static |
Definition at line 81 of file onnxruntime_float16.h.
|
static |
Definition at line 74 of file onnxruntime_float16.h.
|
static |
Definition at line 76 of file onnxruntime_float16.h.
|
static |
Definition at line 72 of file onnxruntime_float16.h.
uint16_t onnxruntime_float16::Float16Impl< Derived >::val {0} |
Definition at line 84 of file onnxruntime_float16.h.