Compute Library
 21.02
bfloat16 Class Referencefinal

Brain floating point representation class. More...

#include <Bfloat16.h>

Public Member Functions

 bfloat16 ()
 Default Constructor. More...
 
 bfloat16 (float v)
 Constructor. More...
 
bfloat16operator= (float v)
 Assignment operator. More...
 
 operator float () const
 Floating point conversion operator. More...
 

Static Public Member Functions

static bfloat16 lowest ()
 Lowest representative value. More...
 
static bfloat16 max ()
 Largest representative value. More...
 

Detailed Description

Brain floating point representation class.

Definition at line 80 of file Bfloat16.h.

Constructor & Destructor Documentation

◆ bfloat16() [1/2]

bfloat16 ( )
inline

Default Constructor.

Definition at line 84 of file Bfloat16.h.

85  : value(0)
86  {
87  }

◆ bfloat16() [2/2]

bfloat16 ( float  v)
inlineexplicit

Constructor.

Parameters
[in]vFloating-point value

Definition at line 92 of file Bfloat16.h.

93  : value(float_to_bf16(v))
94  {
95  }

Member Function Documentation

◆ lowest()

static bfloat16 lowest ( )
inlinestatic

Lowest representative value.

Returns
Returns the lowest finite value representable by bfloat16

Definition at line 119 of file Bfloat16.h.

Referenced by arm_compute::check_value_range(), arm_compute::get_min_max(), and arm_compute::support::cpp11::lowest< bfloat16 >().

120  {
121  bfloat16 val;
122  val.value = 0xFF7F;
123  return val;
124  }
bfloat16()
Default Constructor.
Definition: Bfloat16.h:84

◆ max()

static bfloat16 max ( )
inlinestatic

Largest representative value.

Returns
Returns the largest finite value representable by bfloat16

Definition at line 129 of file Bfloat16.h.

Referenced by arm_compute::check_value_range(), and arm_compute::get_min_max().

130  {
131  bfloat16 val;
132  val.value = 0x7F7F;
133  return val;
134  }
bfloat16()
Default Constructor.
Definition: Bfloat16.h:84

◆ operator float()

operator float ( ) const
inline

Floating point conversion operator.

Returns
Floating point representation of the value

Definition at line 111 of file Bfloat16.h.

112  {
113  return bf16_to_float(value);
114  }

◆ operator=()

bfloat16& operator= ( float  v)
inline

Assignment operator.

Parameters
[in]vFloating point value to assign
Returns
The updated object

Definition at line 102 of file Bfloat16.h.

103  {
104  value = float_to_bf16(v);
105  return *this;
106  }

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