HIP: Heterogenous-computing Interface for Portability
Loading...
Searching...
No Matches
__hip_fp8_e5m2 Struct Reference

struct representing ocp fp8 numbers with e5m2 interpretation More...

#include <amd_hip_fp8.h>

Public Member Functions

__FP8_HOST_DEVICE__ __hip_fp8_e5m2 (const long int val)
 
__FP8_HOST_DEVICE__ __hip_fp8_e5m2 (const int val)
 
__FP8_HOST_DEVICE__ __hip_fp8_e5m2 (const short int val)
 
__FP8_HOST_DEVICE__ __hip_fp8_e5m2 (const unsigned long int val)
 
__FP8_HOST_DEVICE__ __hip_fp8_e5m2 (const unsigned int val)
 
__FP8_HOST_DEVICE__ __hip_fp8_e5m2 (const unsigned short int val)
 
__FP8_HOST_DEVICE__ __hip_fp8_e5m2 (const double f)
 
__FP8_HOST_DEVICE__ __hip_fp8_e5m2 (const float f)
 
__FP8_HOST_DEVICE__ __hip_fp8_e5m2 (const __hip_bfloat16 f)
 
__FP8_HOST_DEVICE__ __hip_fp8_e5m2 (const __half f)
 
__FP8_HOST_DEVICE__ __hip_fp8_e5m2 ()=default
 
__FP8_HOST_DEVICE__ operator float () const
 
__FP8_HOST_DEVICE__ operator __half () const
 
__FP8_HOST_DEVICE__ operator __hip_bfloat16 () const
 
__FP8_HOST_DEVICE__ operator bool () const
 
__FP8_HOST_DEVICE__ operator char () const
 
__FP8_HOST_DEVICE__ operator double () const
 
__FP8_HOST_DEVICE__ operator int () const
 
__FP8_HOST_DEVICE__ operator long int () const
 
__FP8_HOST_DEVICE__ operator long long int () const
 
__FP8_HOST_DEVICE__ operator short int () const
 
__FP8_HOST_DEVICE__ operator signed char () const
 
__FP8_HOST_DEVICE__ operator unsigned char () const
 
__FP8_HOST_DEVICE__ operator unsigned int () const
 
__FP8_HOST_DEVICE__ operator unsigned long int () const
 
__FP8_HOST_DEVICE__ operator unsigned long long int () const
 
__FP8_HOST_DEVICE__ operator unsigned short int () const
 

Public Attributes

__hip_fp8_storage_t __x
 

Static Public Attributes

static constexpr __hip_saturation_t __default_saturation = __HIP_SATFINITE
 raw storage of one fp8 numbers
 
static constexpr __hip_fp8_interpretation_t __default_interpret = __HIP_E5M2
 
static constexpr unsigned int __we = 5
 
static constexpr unsigned int __wm = 2
 

Detailed Description

struct representing ocp fp8 numbers with e5m2 interpretation

Constructor & Destructor Documentation

◆ __hip_fp8_e5m2() [1/11]

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::__hip_fp8_e5m2 ( const long int val)
inline

create fp8 e5m2 type from long

◆ __hip_fp8_e5m2() [2/11]

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::__hip_fp8_e5m2 ( const int val)
inline

create fp8 e5m2 type from int

◆ __hip_fp8_e5m2() [3/11]

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::__hip_fp8_e5m2 ( const short int val)
inline

create fp8 e5m2 type from short int

◆ __hip_fp8_e5m2() [4/11]

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::__hip_fp8_e5m2 ( const unsigned long int val)
inline

create fp8 e5m2 type from unsigned long

◆ __hip_fp8_e5m2() [5/11]

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::__hip_fp8_e5m2 ( const unsigned int val)
inline

create fp8 e5m2 type from unsigned int

◆ __hip_fp8_e5m2() [6/11]

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::__hip_fp8_e5m2 ( const unsigned short int val)
inline

create fp8 e5m2 type from unsigned short

◆ __hip_fp8_e5m2() [7/11]

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::__hip_fp8_e5m2 ( const double f)
inline

create fp8 e5m2 type from double

◆ __hip_fp8_e5m2() [8/11]

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::__hip_fp8_e5m2 ( const float f)
inline

create fp8 e5m2 type from float

◆ __hip_fp8_e5m2() [9/11]

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::__hip_fp8_e5m2 ( const __hip_bfloat16 f)
inline

create fp8 e5m2 type from __hip_bfloat16

◆ __hip_fp8_e5m2() [10/11]

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::__hip_fp8_e5m2 ( const __half f)
inline

create fp8 e5m2 type from __hip_bfloat16

◆ __hip_fp8_e5m2() [11/11]

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::__hip_fp8_e5m2 ( )
default

default construct fp8 e5m2

Member Function Documentation

◆ operator __half()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator __half ( ) const
inline

convert fp8 e5m2 to __half

◆ operator __hip_bfloat16()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator __hip_bfloat16 ( ) const
inline

convert fp8 e5m2 to __hip_bfloat16

◆ operator bool()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator bool ( ) const
inline

convert fp8 e4m3 to bool, return false if value is 0, true otherwise

◆ operator char()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator char ( ) const
inline

convert fp8 e5m2 to char, clamp out of bound values, return 0 if value is NaN

◆ operator double()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator double ( ) const
inline

convert fp8 e5m2 to double

◆ operator float()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator float ( ) const
inline

convert fp8 e5m2 to float

◆ operator int()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator int ( ) const
inline

convert fp8 e5m2 to int, return 0 if value is NaN

◆ operator long int()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator long int ( ) const
inline

convert fp8 e5m2 to long, return 0 if value is NaN

◆ operator long long int()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator long long int ( ) const
inline

convert fp8 e5m2 to long long, return 0 if value is NaN

◆ operator short int()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator short int ( ) const
inline

convert fp8 e5m2 to short, clamp out of bound values, return 0 if value is NaN

◆ operator signed char()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator signed char ( ) const
inline

convert fp8 e5m2 to signed char, clamp out of bound values, return 0 if value is NaN

◆ operator unsigned char()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator unsigned char ( ) const
inline

convert fp8 e5m2 to unsigned char, clamp out of bound values, return 0 if value is NaN

◆ operator unsigned int()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator unsigned int ( ) const
inline

convert fp8 e5m2 to unsigned int, return 0 if value is NaN

◆ operator unsigned long int()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator unsigned long int ( ) const
inline

convert fp8 e5m2 to unsigned long, return 0 if value is NaN

◆ operator unsigned long long int()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator unsigned long long int ( ) const
inline

convert fp8 e5m2 to unsigned long long, return 0 if value is NaN

◆ operator unsigned short int()

__FP8_HOST_DEVICE__ __hip_fp8_e5m2::operator unsigned short int ( ) const
inline

convert fp8 e5m2 to unsigned short, return 0 if value is NaN


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