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__ constexpr __device__ e8m0_bexp_t ()
 
__host__ constexpr __device__ e8m0_bexp_t (type init)
 
__host__ constexpr __device__ e8m0_bexp_t (int init)
 
__host__ constexpr __device__ e8m0_bexp_t (float scale)
 
__host__ constexpr __device__ operator float () const
 
__host__ constexpr __device__ bool operator== (const e8m0_bexp_t &other) const
 
__host__ constexpr __device__ bool is_nan () const
 

Public Attributes

type data
 

Static Public Attributes

constexpr static type bias = 127
 
constexpr static 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

using ck::e8m0_bexp_t::type = uint8_t

Constructor & Destructor Documentation

◆ e8m0_bexp_t() [1/4]

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

◆ e8m0_bexp_t() [2/4]

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

◆ e8m0_bexp_t() [3/4]

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

◆ e8m0_bexp_t() [4/4]

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

Member Function Documentation

◆ is_nan()

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

◆ operator float()

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

◆ operator==()

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

Member Data Documentation

◆ bias

constexpr static type ck::e8m0_bexp_t::bias = 127
staticconstexpr

◆ data

type ck::e8m0_bexp_t::data

◆ nan_mask

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

The documentation for this struct was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/docs-6.4.3/include/ck/utility/e8m0.hpp