15.20.__nv_fp8_e8m0

struct__nv_fp8_e8m0

__nv_fp8_e8m0 datatype

This structure implements the datatype for handling 8-bit scale factors ofe8m0 kind: interpreted as powers of two with biased exponent. Bias equals to 127, so numbers 0 through 254 represent 2^-127 through 2^127. Number0xFF = 255 is reserved for NaN.

The structure implements converting constructors and operators.

Public Functions

__nv_fp8_e8m0()=default

Constructor by default.

__host____device__inlineexplicit__nv_fp8_e8m0(const__halff)

Constructor from__half data type, relies on__NV_SATFINITE behavior for large input values andcudaRoundPosInf for rounding.

See also

__nv_cvt_float_to_e8m0 for further details

__host____device__inlineexplicit__nv_fp8_e8m0(const__nv_bfloat16f)

Constructor from__nv_bfloat16 data type, relies on__NV_SATFINITE behavior for large input values andcudaRoundPosInf for rounding.

See also

__nv_cvt_bfloat16raw_to_e8m0 for further details

__host____device__inlineexplicit__nv_fp8_e8m0(constdoublef)

Constructor fromdouble data type, relies on__NV_SATFINITE behavior for large input values andcudaRoundPosInf for rounding.

See also

__nv_cvt_double_to_e8m0 for further details

__host____device__inlineexplicit__nv_fp8_e8m0(constfloatf)

Constructor fromfloat data type, relies on__NV_SATFINITE behavior behavior for large input values andcudaRoundPosInf for rounding.

See also

__nv_cvt_float_to_e8m0 for further details

__host____device__inlineexplicit__nv_fp8_e8m0(constintval)

Constructor fromint data type, relies oncudaRoundPosInf rounding.

__host____device__inlineexplicit__nv_fp8_e8m0(constlongintval)

Constructor fromlongint data type, relies oncudaRoundPosInf rounding.

__host____device__inlineexplicit__nv_fp8_e8m0(constlonglongintval)

Constructor fromlonglongint data type, relies oncudaRoundPosInf rounding.

__host____device__inlineexplicit__nv_fp8_e8m0(constshortintval)

Constructor fromshortint data type, relies oncudaRoundPosInf rounding.

__host____device__inlineexplicit__nv_fp8_e8m0(constunsignedintval)

Constructor fromunsignedint data type, relies oncudaRoundPosInf rounding.

__host____device__inlineexplicit__nv_fp8_e8m0(constunsignedlongintval)

Constructor fromunsignedlongint data type, relies oncudaRoundPosInf rounding.

__host____device__inlineexplicit__nv_fp8_e8m0(constunsignedlonglongintval)

Constructor fromunsignedlonglongint data type, relies oncudaRoundPosInf rounding.

__host____device__inlineexplicit__nv_fp8_e8m0(constunsignedshortintval)

Constructor fromunsignedshortint data type, relies oncudaRoundPosInf rounding.

__host____device__inlineexplicitoperator__half()const

Conversion operator to__half data type.

__host____device__inlineexplicitoperator__nv_bfloat16()const

Conversion operator to__nv_bfloat16 data type.

__host____device__inlineexplicitoperatorbool()const

Conversion operator tobool data type.

All values in input range are non-zero, so result is alwaystrue.

__host____device__inlineexplicitoperatorchar()const

Conversion operator to an implementation definedchar data type.

Detects signedness of thechar type and proceeds accordingly, see further details in signed and unsigned char operators.

Clamps inputs to the output range.NaN inputs convert tozero.

__host____device__inlineexplicitoperatordouble()const

Conversion operator todouble data type.

__host____device__inlineexplicitoperatorfloat()const

Conversion operator tofloat data type.

__host____device__inlineexplicitoperatorint()const

Conversion operator toint data type.

Clamps too large inputs to the output range.NaN inputs convert tozero.

__host____device__inlineexplicitoperatorlongint()const

Conversion operator tolongint data type.

Clamps too large inputs to the output range.NaN inputs convert tozero if output type is 32-bit.NaN inputs convert to0x8000000000000000ULL if output type is 64-bit.

__host____device__inlineexplicitoperatorlonglongint()const

Conversion operator tolonglongint data type.

Clamps too large inputs to the output range.NaN inputs convert to0x8000000000000000LL.

__host____device__inlineexplicitoperatorshortint()const

Conversion operator toshortint data type.

Clamps too large inputs to the output range.NaN inputs convert tozero.

__host____device__inlineexplicitoperatorsignedchar()const

Conversion operator tosignedchar data type.

Clamps too large inputs to the output range.NaN inputs convert tozero.

__host____device__inlineexplicitoperatorunsignedchar()const

Conversion operator tounsignedchar data type.

Clamps too large inputs to the output range.NaN inputs convert tozero.

__host____device__inlineexplicitoperatorunsignedint()const

Conversion operator tounsignedint data type.

Clamps too large inputs to the output range.NaN inputs convert tozero.

__host____device__inlineexplicitoperatorunsignedlongint()const

Conversion operator tounsignedlongint data type.

Clamps too large inputs to the output range.NaN inputs convert tozero if output type is 32-bit.NaN inputs convert to0x8000000000000000ULL if output type is 64-bit.

__host____device__inlineexplicitoperatorunsignedlonglongint()const

Conversion operator tounsignedlonglongint data type.

Clamps too large inputs to the output range.NaN inputs convert to0x8000000000000000ULL.

__host____device__inlineexplicitoperatorunsignedshortint()const

Conversion operator tounsignedshortint data type.

Clamps too large inputs to the output range.NaN inputs convert tozero.

Public Members

__nv_fp8_storage_t__x

Storage variable contains the 8-bit scale data.