Halide 18.0.0
Halide compiler and libraries
|
Class that provides a type that implements half precision floating point (IEEE754 2008 binary16) in software. More...
#include <Float16.h>
Static Public Member Functions | |
static float16_t | make_zero () |
Get a new float16_t that represents a special value. | |
static float16_t | make_negative_zero () |
static float16_t | make_infinity () |
static float16_t | make_negative_infinity () |
static float16_t | make_nan () |
static float16_t | make_from_bits (uint16_t bits) |
Get a new float16_t with the given raw bits. | |
Static Public Attributes | |
static const int | mantissa_bits = 10 |
static const uint16_t | sign_mask = 0x8000 |
static const uint16_t | exponent_mask = 0x7c00 |
static const uint16_t | mantissa_mask = 0x03ff |
Class that provides a type that implements half precision floating point (IEEE754 2008 binary16) in software.
This type is enforced to be 16-bits wide and maintains no state other than the raw IEEE754 binary16 bits so that it can passed to code that checks a type's size and used for halide_buffer_t allocation.
|
explicit |
Construct from a float, double, or int using round-to-nearest-ties-to-even.
Out-of-range values become +/- infinity.
|
explicit |
Construct from a float, double, or int using round-to-nearest-ties-to-even.
Out-of-range values become +/- infinity.
|
explicit |
Construct from a float, double, or int using round-to-nearest-ties-to-even.
Out-of-range values become +/- infinity.
|
default |
Construct a float16_t with the bits initialised to 0.
This represents positive zero.
References Halide::cast(), and memcpy().
|
explicit |
Cast to float.
|
explicit |
Cast to double.
|
explicit |
Cast to int.
Get a new float16_t that represents a special value.
Get a new float16_t with the given raw bits.
bits | The bits conformant to IEEE754 binary16 |
Definition at line 91 of file Float16.h.
References Halide::cast().
Definition at line 94 of file Float16.h.
References Halide::cast().
Definition at line 97 of file Float16.h.
References Halide::cast().
Definition at line 100 of file Float16.h.
References Halide::cast().
Definition at line 108 of file Float16.h.
References Halide::cast().
Definition at line 113 of file Float16.h.
References Halide::cast().
Definition at line 116 of file Float16.h.
References Halide::cast().
bool Halide::float16_t::is_nan | ( | ) | const |
Properties.
bool Halide::float16_t::is_infinity | ( | ) | const |
bool Halide::float16_t::is_negative | ( | ) | const |
bool Halide::float16_t::is_zero | ( | ) | const |
uint16_t Halide::float16_t::to_bits | ( | ) | const |
Returns the bits that represent this float16_t.
An alternative method to access the bits is to cast a pointer to this instance as a pointer to a uint16_t.