15.18.__nv_fp8_e4m3
- struct__nv_fp8_e4m3
__nv_fp8_e4m3 datatype
This structure implements the datatype for storing
fp8floating-point numbers ofe4m3kind: with 1 sign, 4 exponent, 1 implicit and 3 explicit mantissa bits. The encoding doesn’t support Infinity. NaNs are limited to 0x7F and 0xFF values.The structure implements converting constructors and operators.
Public Functions
- __nv_fp8_e4m3()=default
Constructor by default.
- __host____device__inlineexplicit__nv_fp8_e4m3(const__halff)
Constructor from
__halfdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
- __host____device__inlineexplicit__nv_fp8_e4m3(const__nv_bfloat16f)
Constructor from
__nv_bfloat16data type, relies on__NV_SATFINITEbehavior for out-of-range values.
- __host____device__inlineexplicit__nv_fp8_e4m3(constdoublef)
Constructor from
doubledata type, relies on__NV_SATFINITEbehavior for out-of-range values.
- __host____device__inlineexplicit__nv_fp8_e4m3(constfloatf)
Constructor from
floatdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
- __host____device__inlineexplicit__nv_fp8_e4m3(constintval)
Constructor from
intdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
- __host____device__inlineexplicit__nv_fp8_e4m3(constlongintval)
Constructor from
longintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
- __host____device__inlineexplicit__nv_fp8_e4m3(constlonglongintval)
Constructor from
longlongintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
- __host____device__inlineexplicit__nv_fp8_e4m3(constshortintval)
Constructor from
shortintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
- __host____device__inlineexplicit__nv_fp8_e4m3(constunsignedintval)
Constructor from
unsignedintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
- __host____device__inlineexplicit__nv_fp8_e4m3(constunsignedlongintval)
Constructor from
unsignedlongintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
- __host____device__inlineexplicit__nv_fp8_e4m3(constunsignedlonglongintval)
Constructor from
unsignedlonglongintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
- __host____device__inlineexplicit__nv_fp8_e4m3(constunsignedshortintval)
Constructor from
unsignedshortintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
- __host____device__inlineexplicitoperator__nv_bfloat16()const
Conversion operator to
__nv_bfloat16data type.
- __host____device__inlineexplicitoperatorbool()const
Conversion operator to
booldata type.+0 and -0 inputs convert to
false. Non-zero inputs convert totrue.
- __host____device__inlineexplicitoperatorchar()const
Conversion operator to an implementation defined
chardata type.Detects signedness of the
chartype and proceeds accordingly, see further details in signed and unsigned char operators.Clamps inputs to the output range.
NaNinputs convert tozero.
- __host____device__inlineexplicitoperatordouble()const
Conversion operator to
doubledata type.
- __host____device__inlineexplicitoperatorfloat()const
Conversion operator to
floatdata type.
- __host____device__inlineexplicitoperatorint()const
Conversion operator to
intdata type.NaNinputs convert tozero.
- __host____device__inlineexplicitoperatorlongint()const
Conversion operator to
longintdata type.Clamps too large inputs to the output range.
NaNinputs convert tozeroif output type is 32-bit.NaNinputs convert to0x8000000000000000ULLif output type is 64-bit.
- __host____device__inlineexplicitoperatorlonglongint()const
Conversion operator to
longlongintdata type.NaNinputs convert to0x8000000000000000LL.
- __host____device__inlineexplicitoperatorshortint()const
Conversion operator to
shortintdata type.NaNinputs convert tozero.
- __host____device__inlineexplicitoperatorsignedchar()const
Conversion operator to
signedchardata type.Clamps too large inputs to the output range.
NaNinputs convert tozero.
- __host____device__inlineexplicitoperatorunsignedchar()const
Conversion operator to
unsignedchardata type.Clamps negative and too large inputs to the output range.
NaNinputs convert tozero.
- __host____device__inlineexplicitoperatorunsignedint()const
Conversion operator to
unsignedintdata type.Clamps negative inputs to zero.
NaNinputs convert tozero.
- __host____device__inlineexplicitoperatorunsignedlongint()const
Conversion operator to
unsignedlongintdata type.Clamps negative and too large inputs to the output range.
NaNinputs convert tozeroif output type is 32-bit.NaNinputs convert to0x8000000000000000ULLif output type is 64-bit.
- __host____device__inlineexplicitoperatorunsignedlonglongint()const
Conversion operator to
unsignedlonglongintdata type.Clamps negative inputs to zero.
NaNinputs convert to0x8000000000000000ULL.
- __host____device__inlineexplicitoperatorunsignedshortint()const
Conversion operator to
unsignedshortintdata type.Clamps negative inputs to zero.
NaNinputs convert tozero.
Public Members
- __nv_fp8_storage_t__x
Storage variable contains the
fp8floating-point data.
- __nv_fp8_e4m3()=default