15.21. __nv_fp8_ue5m3
-
struct __nv_fp8_ue5m3
-
__nv_fp8_ue5m3 datatype
This structure implements the datatype for handling
fp8floating-point numbers ofue5m3kind: with no sign, 5 exponent, 1 implicit and 3 explicit mantissa bits. The encoding doesn’t support Infinity. NaNs are limited to 0xFF values.The structure implements converting constructors and operators.
Public Functions
-
__nv_fp8_ue5m3() = default
-
Constructor by default.
-
__host__ __device__ inline explicit __nv_fp8_ue5m3(const __half f)
-
Constructor from
__halfdata type, relies on__NV_SATFINITEbehavior for large input values andcudaRoundNearestfor rounding.See also
__nv_cvt_halfraw_to_ue5m3 for further details
-
__host__ __device__ inline explicit __nv_fp8_ue5m3(const __nv_bfloat16 f)
-
Constructor from
__nv_bfloat16data type, relies on__NV_SATFINITEbehavior for large input values andcudaRoundNearestfor rounding.See also
__nv_cvt_bfloat16raw_to_ue5m3 for further details
-
__host__ __device__ inline explicit __nv_fp8_ue5m3(const double f)
-
Constructor from
doubledata type, relies on__NV_SATFINITEbehavior for large input values andcudaRoundNearestfor rounding.See also
__nv_cvt_double_to_ue5m3 for further details
-
__host__ __device__ inline explicit __nv_fp8_ue5m3(const float f)
-
Constructor from
floatdata type, relies on__NV_SATFINITEbehavior for large input values andcudaRoundNearestfor rounding.See also
__nv_cvt_float_to_ue5m3 for further details
-
__host__ __device__ inline explicit __nv_fp8_ue5m3(const int val)
-
Constructor from
intdata type, relies oncudaRoundNearestrounding.
-
__host__ __device__ inline explicit __nv_fp8_ue5m3(const long int val)
-
Constructor from
longintdata type, relies oncudaRoundNearestrounding.
-
__host__ __device__ inline explicit __nv_fp8_ue5m3(const long long int val)
-
Constructor from
longlongintdata type, relies oncudaRoundNearestrounding.
-
__host__ __device__ inline explicit __nv_fp8_ue5m3(const short int val)
-
Constructor from
shortintdata type, relies oncudaRoundNearestrounding.
-
__host__ __device__ inline explicit __nv_fp8_ue5m3(const unsigned int val)
-
Constructor from
unsignedintdata type, relies oncudaRoundNearestrounding.
-
__host__ __device__ inline explicit __nv_fp8_ue5m3(const unsigned long int val)
-
Constructor from
unsignedlongintdata type, relies oncudaRoundNearestrounding.
-
__host__ __device__ inline explicit __nv_fp8_ue5m3(const unsigned long long int val)
-
Constructor from
unsignedlonglongintdata type, relies oncudaRoundNearestrounding.
-
__host__ __device__ inline explicit __nv_fp8_ue5m3(const unsigned short int val)
-
Constructor from
unsignedshortintdata type, relies oncudaRoundNearestrounding.
-
__host__ __device__ inline explicit operator __half() const
-
Conversion operator to
__halfdata type.
-
__host__ __device__ inline explicit operator __nv_bfloat16() const
-
Conversion operator to
__nv_bfloat16data type.
-
__host__ __device__ inline explicit operator bool() const
-
Conversion operator to
booldata type.Zero converts
false, all other values, includingNaN, converttrue.
-
__host__ __device__ inline explicit operator char() 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__ inline explicit operator double() const
-
Conversion operator to
doubledata type.
-
__host__ __device__ inline explicit operator float() const
-
Conversion operator to
floatdata type.
-
__host__ __device__ inline explicit operator int() const
-
Conversion operator to
intdata type.NaNinputs convert tozero.
-
__host__ __device__ inline explicit operator long int() const
-
Conversion operator to
longintdata type.NaNinputs convert tozeroif output type is 32-bit.NaNinputs convert to0x8000000000000000ULLif output type is 64-bit.
-
__host__ __device__ inline explicit operator long long int() const
-
Conversion operator to
longlongintdata type.NaNinputs convert to0x8000000000000000LL.
-
__host__ __device__ inline explicit operator short int() const
-
Conversion operator to
shortintdata type.Clamps too large inputs to the output range.
NaNinputs convert tozero.
-
__host__ __device__ inline explicit operator signed char() const
-
Conversion operator to
signedchardata type.Clamps too large inputs to the output range.
NaNinputs convert tozero.
-
__host__ __device__ inline explicit operator unsigned char() const
-
Conversion operator to
unsignedchardata type.Clamps too large inputs to the output range.
NaNinputs convert tozero.
-
__host__ __device__ inline explicit operator unsigned int() const
-
Conversion operator to
unsignedintdata type.NaNinputs convert tozero.
-
__host__ __device__ inline explicit operator unsigned long int() const
-
Conversion operator to
unsignedlongintdata type.NaNinputs convert tozeroif output type is 32-bit.NaNinputs convert to0x8000000000000000ULLif output type is 64-bit.
-
__host__ __device__ inline explicit operator unsigned long long int() const
-
Conversion operator to
unsignedlonglongintdata type.NaNinputs convert to0x8000000000000000ULL.
-
__host__ __device__ inline explicit operator unsigned short int() const
-
Conversion operator to
unsignedshortintdata type.Clamps too large inputs to the output range.
NaNinputs convert tozero.
Public Members
-
__nv_fp8_storage_t __x
-
Storage variable contains the
fp8floating-point data.
-
__nv_fp8_ue5m3() = default