HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
onnxruntime::BFloat16 Struct Reference

#include <float16.h>

+ Inheritance diagram for onnxruntime::BFloat16:

Classes

struct  FromBitsT
 

Public Types

using Base = onnxruntime_float16::BFloat16Impl< BFloat16 >
 

Public Member Functions

 BFloat16 ()=default
 
constexpr ORT_HOST_DEVICE BFloat16 (unsigned short bits, FromBitsT) noexcept
 
ORT_HOST_DEVICE BFloat16 (float v) noexcept
 
ORT_HOST_DEVICE float ToFloat () const noexcept
 
ORT_HOST_DEVICE operator float () const noexcept
 
ORT_HOST_DEVICE bool operator== (const BFloat16 &rhs) const noexcept
 
ORT_HOST_DEVICE bool operator!= (const BFloat16 &rhs) const noexcept
 
ORT_HOST_DEVICE bool operator< (const BFloat16 &rhs) const noexcept
 
ORT_HOST_DEVICE bool IsNegativeHostDevice () const noexcept
 
ORT_HOST_DEVICE bool IsNaNHostDevice () const noexcept
 
- Public Member Functions inherited from onnxruntime_float16::BFloat16Impl< BFloat16 >
 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...
 
BFloat16 Abs () const noexcept
 Creates an instance that represents absolute value. More...
 
BFloat16 Negate () const noexcept
 Creates a new instance with the sign flipped. More...
 

Static Public Member Functions

static constexpr
ORT_HOST_DEVICE FromBitsT 
FromBits () noexcept
 
static constexpr
ORT_HOST_DEVICE BFloat16 
FromBits (uint16_t bits) noexcept
 
static ORT_HOST_DEVICE bool AreZeroHostDevice (const BFloat16Impl &lhs, const BFloat16Impl &rhs) noexcept
 
- Static Public Member Functions inherited from onnxruntime_float16::BFloat16Impl< BFloat16 >
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...
 

Static Public Attributes

static const BFloat16 NaN
 
static const BFloat16 NegativeNaN
 
static const BFloat16 Infinity
 
static const BFloat16 NegativeInfinity
 
static const BFloat16 Epsilon
 
static const BFloat16 MinValue
 
static const BFloat16 MaxValue
 
static const BFloat16 Zero
 
static const BFloat16 One
 
static const BFloat16 MinusOne
 
- Static Public Attributes inherited from onnxruntime_float16::BFloat16Impl< BFloat16 >
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 kSignaling_NaNBits
 
static constexpr uint16_t kEpsilonBits
 
static constexpr uint16_t kMinValueBits
 
static constexpr uint16_t kMaxValueBits
 
static constexpr uint16_t kRoundToNearest
 
static constexpr uint16_t kOneBits
 
static constexpr uint16_t kMinusOneBits
 

Additional Inherited Members

- Public Attributes inherited from onnxruntime_float16::BFloat16Impl< BFloat16 >
uint16_t val
 
- Protected Member Functions inherited from onnxruntime_float16::BFloat16Impl< BFloat16 >
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 inherited from onnxruntime_float16::BFloat16Impl< BFloat16 >
static uint16_t ToUint16Impl (float v) noexcept
 Converts from float to uint16_t float16 representation More...
 

Detailed Description

Definition at line 89 of file float16.h.

Member Typedef Documentation

Constructor & Destructor Documentation

onnxruntime::BFloat16::BFloat16 ( )
default
constexpr ORT_HOST_DEVICE onnxruntime::BFloat16::BFloat16 ( unsigned short  bits,
FromBitsT   
)
inlinenoexcept

Definition at line 100 of file float16.h.

ORT_HOST_DEVICE onnxruntime::BFloat16::BFloat16 ( float  v)
inlinenoexcept

Definition at line 106 of file float16.h.

Member Function Documentation

static ORT_HOST_DEVICE bool onnxruntime::BFloat16::AreZeroHostDevice ( const BFloat16Impl lhs,
const BFloat16Impl rhs 
)
inlinestaticnoexcept

Definition at line 256 of file float16.h.

static constexpr ORT_HOST_DEVICE FromBitsT onnxruntime::BFloat16::FromBits ( )
inlinestaticnoexcept

Definition at line 99 of file float16.h.

static constexpr ORT_HOST_DEVICE BFloat16 onnxruntime::BFloat16::FromBits ( uint16_t  bits)
inlinestaticnoexcept

Definition at line 102 of file float16.h.

ORT_HOST_DEVICE bool onnxruntime::BFloat16::IsNaNHostDevice ( ) const
inlinenoexcept

Definition at line 252 of file float16.h.

ORT_HOST_DEVICE bool onnxruntime::BFloat16::IsNegativeHostDevice ( ) const
inlinenoexcept

Definition at line 248 of file float16.h.

ORT_HOST_DEVICE onnxruntime::BFloat16::operator float ( ) const
inlinenoexcept

Definition at line 213 of file float16.h.

ORT_HOST_DEVICE bool onnxruntime::BFloat16::operator!= ( const BFloat16 rhs) const
inlinenoexcept

Definition at line 228 of file float16.h.

ORT_HOST_DEVICE bool onnxruntime::BFloat16::operator< ( const BFloat16 rhs) const
inlinenoexcept

Definition at line 232 of file float16.h.

ORT_HOST_DEVICE bool onnxruntime::BFloat16::operator== ( const BFloat16 rhs) const
inlinenoexcept

Definition at line 220 of file float16.h.

ORT_HOST_DEVICE float onnxruntime::BFloat16::ToFloat ( ) const
inlinenoexcept

Definition at line 151 of file float16.h.

Member Data Documentation

const BFloat16 onnxruntime::BFloat16::Epsilon
static

Definition at line 184 of file float16.h.

const BFloat16 onnxruntime::BFloat16::Infinity
static

Definition at line 182 of file float16.h.

const BFloat16 onnxruntime::BFloat16::MaxValue
static

Definition at line 186 of file float16.h.

const BFloat16 onnxruntime::BFloat16::MinusOne
static

Definition at line 189 of file float16.h.

const BFloat16 onnxruntime::BFloat16::MinValue
static

Definition at line 185 of file float16.h.

const BFloat16 onnxruntime::BFloat16::NaN
static

Definition at line 180 of file float16.h.

const BFloat16 onnxruntime::BFloat16::NegativeInfinity
static

Definition at line 183 of file float16.h.

const BFloat16 onnxruntime::BFloat16::NegativeNaN
static

Definition at line 181 of file float16.h.

const BFloat16 onnxruntime::BFloat16::One
static

Definition at line 188 of file float16.h.

const BFloat16 onnxruntime::BFloat16::Zero
static

Definition at line 187 of file float16.h.


The documentation for this struct was generated from the following file: