HDK
|
IEEE 754 half-precision floating point data type. More...
#include <onnxruntime_cxx_api.h>
Public Types | |
using | Base = onnxruntime_float16::Float16Impl< Float16_t > |
Public Member Functions | |
Float16_t ()=default | |
Default constructor More... | |
Float16_t (float v) noexcept | |
__ctor from float. Float is converted into float16 16-bit representation. More... | |
float | ToFloat () const noexcept |
Converts float16 to float More... | |
operator float () const noexcept | |
User defined conversion operator. Converts Float16_t to float. More... | |
Public Member Functions inherited from onnxruntime_float16::Float16Impl< Float16_t > | |
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... | |
Float16_t | Abs () const noexcept |
Creates an instance that represents absolute value. More... | |
Float16_t | 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 constexpr Float16_t | FromBits (uint16_t v) noexcept |
Explicit conversion to uint16_t representation of float16. More... | |
Static Public Member Functions inherited from onnxruntime_float16::Float16Impl< Float16_t > | |
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... | |
Additional Inherited Members | |
Public Attributes inherited from onnxruntime_float16::Float16Impl< Float16_t > | |
uint16_t | val |
Static Public Attributes inherited from onnxruntime_float16::Float16Impl< Float16_t > | |
static constexpr uint16_t | kSignMask |
static constexpr uint16_t | kBiasedExponentMask |
static constexpr uint16_t | kPositiveInfinityBits |
static constexpr uint16_t | kNegativeInfinityBits |
static constexpr uint16_t | kPositiveQNaNBits |
static constexpr uint16_t | kNegativeQNaNBits |
static constexpr uint16_t | kEpsilonBits |
static constexpr uint16_t | kMinValueBits |
static constexpr uint16_t | kMaxValueBits |
static constexpr uint16_t | kOneBits |
static constexpr uint16_t | kMinusOneBits |
Protected Member Functions inherited from onnxruntime_float16::Float16Impl< Float16_t > | |
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 inherited from onnxruntime_float16::Float16Impl< Float16_t > | |
static constexpr uint16_t | ToUint16Impl (float v) noexcept |
Converts from float to uint16_t float16 representation More... | |
IEEE 754 half-precision floating point data type.
This struct is used for converting float to float16 and back so the user could feed inputs and fetch outputs using these type.
The size of the structure should align with uint16_t and one can freely cast uint16_t buffers to/from Ort::Float16_t to feed and retrieve data.
Definition at line 164 of file onnxruntime_cxx_api.h.
Definition at line 174 of file onnxruntime_cxx_api.h.
|
default |
Default constructor
|
inlineexplicitnoexcept |
__ctor from float. Float is converted into float16 16-bit representation.
v | float value |
Definition at line 192 of file onnxruntime_cxx_api.h.
|
inlinestaticnoexcept |
Explicit conversion to uint16_t representation of float16.
v | uint16_t bit representation of float16 |
Definition at line 186 of file onnxruntime_cxx_api.h.
|
inlineexplicitnoexcept |
User defined conversion operator. Converts Float16_t to float.
Definition at line 279 of file onnxruntime_cxx_api.h.
|
inlinenoexcept |
Converts float16 to float
Definition at line 198 of file onnxruntime_cxx_api.h.