Skip to main content

ClikaRT::dtype::float8_e8m0_t

struct

Header: ClikaRT/compute/scalar_types.h

FP8 E8M0 block-scale: 8 exponent bits, 0 mantissa, no sign. Bias 127; pure powers of two from 2^-127 to 2^127, one NaN at 0xFF. Used as the per-block scale in MX block formats. Conversion from fp32 takes the biased exponent of |f|; magnitudes below 2^-126 saturate to the smallest scale. 8-bit storage.

Static member functions

from_bits()

static constexpr float8_e8m0_t from_bits(std::uint8_t b) noexcept

Reinterpret a raw 8-bit encoding without converting.

Declared in ClikaRT/compute/scalar_types.h, line 249

Member functions

float8_e8m0_t()

constexpr constexpr float8_e8m0_t() noexcept=default

Declared in ClikaRT/compute/scalar_types.h, line 240

float8_e8m0_t(float)

explicit float8_e8m0_t(float f) noexcept

Convert from fp32 (extract the biased exponent of the magnitude).

Declared in ClikaRT/compute/scalar_types.h, line 243

operator float()

operator float() const noexcept

Convert to fp32 (the power of two this scale encodes).

Declared in ClikaRT/compute/scalar_types.h, line 246

is_nan()

constexpr bool is_nan() const noexcept

True at the format's single NaN (0xFF).

Declared in ClikaRT/compute/scalar_types.h, line 251

Data members

bits

std::uint8_t bits = 0

Raw 8-bit encoding (the storage/ABI form).

Declared in ClikaRT/compute/scalar_types.h, line 238

Friends

operator==

friend bool operator==(float8_e8m0_t a, float8_e8m0_t b) noexcept

Compares a and b by dequantized value (IEEE rules; a NaN operand compares false).

Declared in ClikaRT/compute/scalar_types.h, line 253

operator!=

friend bool operator!=(float8_e8m0_t a, float8_e8m0_t b) noexcept

Compares a and b by dequantized value (IEEE rules; a NaN operand compares false).

Declared in ClikaRT/compute/scalar_types.h, line 254

operator<

friend bool operator<(float8_e8m0_t a, float8_e8m0_t b) noexcept

Compares a and b by dequantized value (IEEE rules; a NaN operand compares false).

Declared in ClikaRT/compute/scalar_types.h, line 255

operator<=

friend bool operator<=(float8_e8m0_t a, float8_e8m0_t b) noexcept

Compares a and b by dequantized value (IEEE rules; a NaN operand compares false).

Declared in ClikaRT/compute/scalar_types.h, line 256

operator>

friend bool operator>(float8_e8m0_t a, float8_e8m0_t b) noexcept

Compares a and b by dequantized value (IEEE rules; a NaN operand compares false).

Declared in ClikaRT/compute/scalar_types.h, line 257

operator>=

friend bool operator>=(float8_e8m0_t a, float8_e8m0_t b) noexcept

Compares a and b by dequantized value (IEEE rules; a NaN operand compares false).

Declared in ClikaRT/compute/scalar_types.h, line 258