e8m0_bexp_t Struct Reference

e8m0_bexp_t Struct Reference#

Composable Kernel: ck::e8m0_bexp_t Struct Reference

Unsigned representation of a conventional biased Float32 exponent. More...

#include <e8m0.hpp>

Public Types

using type = uint8_t

Public Member Functions

__host__ __device__ constexpr e8m0_bexp_t ()
__host__ __device__ constexpr e8m0_bexp_t (type init)
__host__ __device__ constexpr e8m0_bexp_t (int init)
__host__ __device__ constexpr e8m0_bexp_t (float scale)
__host__ __device__ constexpr operator float () const
__host__ __device__ constexpr bool operator== (const e8m0_bexp_t &other) const
__host__ __device__ constexpr bool is_nan () const

Public Attributes

type data

Static Public Attributes

static constexpr type bias = 127
static constexpr type nan_mask = 0xFF

Detailed Description

Unsigned representation of a conventional biased Float32 exponent.

bias = 127;

E8M0_1 = 0b01111111; => 2^(127-127) = 1 E8M0_2 = 0b10000000; => 2^(128-127) = 2^1 = 2 E8M0_3 = 0b10000010; => 2^(130-127) = 2^3 = 8 E8M0_135 = 0b10000111; => 2^(135-127) = 2^8 = 256 E8M0_142 = 0b10001110; => 2^(142-127) = 2^15 = 32768 E8M0_MIN = 0b00000000; => 2^-127 E8M0_MAX = 0b11111110; => 2^127 E8M0_NAN = 0b11111111; => NaN

Member Typedef Documentation

◆ type

Constructor & Destructor Documentation

◆ e8m0_bexp_t() [1/4]

__host__ __device__ constexpr ck::e8m0_bexp_t::e8m0_bexp_t ( )
inlineconstexpr

◆ e8m0_bexp_t() [2/4]

__host__ __device__ constexpr ck::e8m0_bexp_t::e8m0_bexp_t ( type init)
inlineconstexpr

◆ e8m0_bexp_t() [3/4]

__host__ __device__ constexpr ck::e8m0_bexp_t::e8m0_bexp_t ( int init)
inlineconstexpr

◆ e8m0_bexp_t() [4/4]

__host__ __device__ constexpr ck::e8m0_bexp_t::e8m0_bexp_t ( float scale)
inlineexplicitconstexpr

Member Function Documentation

◆ is_nan()

__host__ __device__ constexpr bool ck::e8m0_bexp_t::is_nan ( ) const
inlineconstexpr

◆ operator float()

__host__ __device__ constexpr ck::e8m0_bexp_t::operator float ( ) const
inlineexplicitconstexpr

◆ operator==()

__host__ __device__ constexpr bool ck::e8m0_bexp_t::operator== ( const e8m0_bexp_t & other) const
inlineconstexpr

Member Data Documentation

◆ bias

type ck::e8m0_bexp_t::bias = 127
staticconstexpr

◆ data

type ck::e8m0_bexp_t::data

◆ nan_mask

type ck::e8m0_bexp_t::nan_mask = 0xFF
staticconstexpr

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