3.9. FP8 Conversion and Data Movement
To use these functions, include the header file cuda_fp8.h in your program.
Enumerations
- __nv_fp8_interpretation_t
-
Enumerates the possible interpretations of the 8-bit values when referring to them as
fp8types. - __nv_saturation_t
-
Enumerates the modes applicable when performing a narrowing conversion to
fp8destination types.
Functions
- __host__ __device__ __nv_fp8x2_storage_t __nv_cvt_bfloat162raw_to_e8m0x2(const __nv_bfloat162_raw x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
Converts a pair of
bfloat16values into a pair of scaling factors ofe8m0kind. - __host__ __device__ __nv_fp8x2_storage_t __nv_cvt_bfloat16raw2_to_fp8x2(const __nv_bfloat162_raw x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input vector of two
nv_bfloat16precision numbers packed in__nv_bfloat162_rawxinto a vector of two values offp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode. - __host__ __device__ __nv_fp8_storage_t __nv_cvt_bfloat16raw_to_e8m0(const __nv_bfloat16_raw x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
Converts input
bfloat16input into a scaling factor ofe8m0kind. - __host__ __device__ __nv_fp8_storage_t __nv_cvt_bfloat16raw_to_fp8(const __nv_bfloat16_raw x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input
nv_bfloat16precisionxtofp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode. - __host__ __device__ __nv_fp8x2_storage_t __nv_cvt_double2_to_e8m0x2(const double2 x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
Converts a pair of
doublevalues into a pair of scaling factors ofe8m0kind. - __host__ __device__ __nv_fp8x2_storage_t __nv_cvt_double2_to_fp8x2(const double2 x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input vector of two
doubleprecision numbers packed indouble2xinto a vector of two values offp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode. - __host__ __device__ __nv_fp8_storage_t __nv_cvt_double_to_e8m0(const double x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
Converts input
doublevalue into a scaling factor ofe8m0kind. - __host__ __device__ __nv_fp8_storage_t __nv_cvt_double_to_fp8(const double x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input
doubleprecisionxtofp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode. - __host__ __device__ __nv_bfloat16_raw __nv_cvt_e8m0_to_bf16raw(const __nv_fp8_storage_t x)
-
Converts input scaling factor value of
e8m0kind intobfloat16. - __host__ __device__ __nv_bfloat162_raw __nv_cvt_e8m0x2_to_bf162raw(const __nv_fp8x2_storage_t x)
-
Converts input pair of scaling factors of
e8m0kind into a pair ofbfloat16values. - __host__ __device__ __nv_fp8x2_storage_t __nv_cvt_float2_to_e8m0x2(const float2 x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
Converts a pair of
floatvalues into a pair of scaling factors ofe8m0kind. - __host__ __device__ __nv_fp8x2_storage_t __nv_cvt_float2_to_fp8x2(const float2 x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input vector of two
singleprecision numbers packed infloat2xinto a vector of two values offp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode. - __host__ __device__ __nv_fp8_storage_t __nv_cvt_float_to_e8m0(const float x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
Converts input
floatvalue into a scaling factor ofe8m0kind. - __host__ __device__ __nv_fp8_storage_t __nv_cvt_float_to_fp8(const float x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input
singleprecisionxtofp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode. - __host__ __device__ __half_raw __nv_cvt_fp8_to_halfraw(const __nv_fp8_storage_t x, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input
fp8xof the specified kind tohalfprecision. - __host__ __device__ __half2_raw __nv_cvt_fp8x2_to_halfraw2(const __nv_fp8x2_storage_t x, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input vector of two
fp8values of the specified kind to a vector of twohalfprecision values packed in__half2_rawstructure. - __host__ __device__ __nv_fp8x2_storage_t __nv_cvt_halfraw2_to_fp8x2(const __half2_raw x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input vector of two
halfprecision numbers packed in__half2_rawxinto a vector of two values offp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode. - __host__ __device__ __nv_fp8_storage_t __nv_cvt_halfraw_to_fp8(const __half_raw x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input
halfprecisionxtofp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode. - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const int val)
-
Constructor from
intdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const unsigned long long int val)
-
Constructor from
unsignedlonglongintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const __nv_bfloat16 f)
-
Constructor from
__nv_bfloat16data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const long int val)
-
Constructor from
longintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const long long int val)
-
Constructor from
longlongintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __nv_fp8_e4m3::__nv_fp8_e4m3()=default
-
Constructor by default.
- __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const unsigned short int val)
-
Constructor from
unsignedshortintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const float f)
-
Constructor from
floatdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const __half f)
-
Constructor from
__halfdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const unsigned long int val)
-
Constructor from
unsignedlongintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const double f)
-
Constructor from
doubledata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const short int val)
-
Constructor from
shortintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const unsigned int val)
-
Constructor from
unsignedintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e4m3::operator __half() const
-
Conversion operator to
__halfdata type. - __host__ __device__ __nv_fp8_e4m3::operator __nv_bfloat16() const
-
Conversion operator to
__nv_bfloat16data type. - __host__ __device__ __nv_fp8_e4m3::operator bool() const
-
Conversion operator to
booldata type. - __host__ __device__ __nv_fp8_e4m3::operator char() const
-
Conversion operator to an implementation defined
chardata type. - __host__ __device__ __nv_fp8_e4m3::operator double() const
-
Conversion operator to
doubledata type. - __host__ __device__ __nv_fp8_e4m3::operator float() const
-
Conversion operator to
floatdata type. - __host__ __device__ __nv_fp8_e4m3::operator int() const
-
Conversion operator to
intdata type. - __host__ __device__ __nv_fp8_e4m3::operator long int() const
-
Conversion operator to
longintdata type. - __host__ __device__ __nv_fp8_e4m3::operator long long int() const
-
Conversion operator to
longlongintdata type. - __host__ __device__ __nv_fp8_e4m3::operator short int() const
-
Conversion operator to
shortintdata type. - __host__ __device__ __nv_fp8_e4m3::operator signed char() const
-
Conversion operator to
signedchardata type. - __host__ __device__ __nv_fp8_e4m3::operator unsigned char() const
-
Conversion operator to
unsignedchardata type. - __host__ __device__ __nv_fp8_e4m3::operator unsigned int() const
-
Conversion operator to
unsignedintdata type. - __host__ __device__ __nv_fp8_e4m3::operator unsigned long int() const
-
Conversion operator to
unsignedlongintdata type. - __host__ __device__ __nv_fp8_e4m3::operator unsigned long long int() const
-
Conversion operator to
unsignedlonglongintdata type. - __host__ __device__ __nv_fp8_e4m3::operator unsigned short int() const
-
Conversion operator to
unsignedshortintdata type. - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const __half f)
-
Constructor from
__halfdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const long long int val)
-
Constructor from
longlongintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const unsigned int val)
-
Constructor from
unsignedintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const float f)
-
Constructor from
floatdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const unsigned short int val)
-
Constructor from
unsignedshortintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __nv_fp8_e5m2::__nv_fp8_e5m2()=default
-
Constructor by default.
- __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const int val)
-
Constructor from
intdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const long int val)
-
Constructor from
longintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const double f)
-
Constructor from
doubledata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const unsigned long int val)
-
Constructor from
unsignedlongintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const short int val)
-
Constructor from
shortintdata type. - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const __nv_bfloat16 f)
-
Constructor from
__nv_bfloat16data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const unsigned long long int val)
-
Constructor from
unsignedlonglongintdata type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8_e5m2::operator __half() const
-
Conversion operator to
__halfdata type. - __host__ __device__ __nv_fp8_e5m2::operator __nv_bfloat16() const
-
Conversion operator to
__nv_bfloat16data type. - __host__ __device__ __nv_fp8_e5m2::operator bool() const
-
Conversion operator to
booldata type. - __host__ __device__ __nv_fp8_e5m2::operator char() const
-
Conversion operator to an implementation defined
chardata type. - __host__ __device__ __nv_fp8_e5m2::operator double() const
-
Conversion operator to
doubledata type. - __host__ __device__ __nv_fp8_e5m2::operator float() const
-
Conversion operator to
floatdata type. - __host__ __device__ __nv_fp8_e5m2::operator int() const
-
Conversion operator to
intdata type. - __host__ __device__ __nv_fp8_e5m2::operator long int() const
-
Conversion operator to
longintdata type. - __host__ __device__ __nv_fp8_e5m2::operator long long int() const
-
Conversion operator to
longlongintdata type. - __host__ __device__ __nv_fp8_e5m2::operator short int() const
-
Conversion operator to
shortintdata type. - __host__ __device__ __nv_fp8_e5m2::operator signed char() const
-
Conversion operator to
signedchardata type. - __host__ __device__ __nv_fp8_e5m2::operator unsigned char() const
-
Conversion operator to
unsignedchardata type. - __host__ __device__ __nv_fp8_e5m2::operator unsigned int() const
-
Conversion operator to
unsignedintdata type. - __host__ __device__ __nv_fp8_e5m2::operator unsigned long int() const
-
Conversion operator to
unsignedlongintdata type. - __host__ __device__ __nv_fp8_e5m2::operator unsigned long long int() const
-
Conversion operator to
unsignedlonglongintdata type. - __host__ __device__ __nv_fp8_e5m2::operator unsigned short int() const
-
Conversion operator to
unsignedshortintdata type. - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const long int val)
-
Constructor from
longintdata type, relies oncudaRoundZerorounding. - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const int val)
-
Constructor from
intdata type, relies oncudaRoundZerorounding. - __nv_fp8_e8m0::__nv_fp8_e8m0()=default
-
Constructor by default.
- __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const unsigned int val)
-
Constructor from
unsignedintdata type, relies oncudaRoundZerorounding. - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const float f)
-
Constructor from
floatdata type, relies on__NV_SATFINITEbehavior behavior for large input values andcudaRoundZerofor rounding. - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const unsigned long long int val)
-
Constructor from
unsignedlonglongintdata type, relies oncudaRoundZerorounding. - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const double f)
-
Constructor from
doubledata type, relies on__NV_SATFINITEbehavior for large input values andcudaRoundZerofor rounding. - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const __half f)
-
Constructor from
__halfdata type, relies on__NV_SATFINITEbehavior for large input values andcudaRoundZerofor rounding. - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const __nv_bfloat16 f)
-
Constructor from
__nv_bfloat16data type, relies on__NV_SATFINITEbehavior for large input values andcudaRoundZerofor rounding. - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const unsigned long int val)
-
Constructor from
unsignedlongintdata type, relies oncudaRoundZerorounding. - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const unsigned short int val)
-
Constructor from
unsignedshortintdata type, relies oncudaRoundZerorounding. - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const long long int val)
-
Constructor from
longlongintdata type, relies oncudaRoundZerorounding. - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const short int val)
-
Constructor from
shortintdata type, relies oncudaRoundZerorounding. - __host__ __device__ __nv_fp8_e8m0::operator __half() const
-
Conversion operator to
__halfdata type. - __host__ __device__ __nv_fp8_e8m0::operator __nv_bfloat16() const
-
Conversion operator to
__nv_bfloat16data type. - __host__ __device__ __nv_fp8_e8m0::operator bool() const
-
Conversion operator to
booldata type. - __host__ __device__ __nv_fp8_e8m0::operator char() const
-
Conversion operator to an implementation defined
chardata type. - __host__ __device__ __nv_fp8_e8m0::operator double() const
-
Conversion operator to
doubledata type. - __host__ __device__ __nv_fp8_e8m0::operator float() const
-
Conversion operator to
floatdata type. - __host__ __device__ __nv_fp8_e8m0::operator int() const
-
Conversion operator to
intdata type. - __host__ __device__ __nv_fp8_e8m0::operator long int() const
-
Conversion operator to
longintdata type. - __host__ __device__ __nv_fp8_e8m0::operator long long int() const
-
Conversion operator to
longlongintdata type. - __host__ __device__ __nv_fp8_e8m0::operator short int() const
-
Conversion operator to
shortintdata type. - __host__ __device__ __nv_fp8_e8m0::operator signed char() const
-
Conversion operator to
signedchardata type. - __host__ __device__ __nv_fp8_e8m0::operator unsigned char() const
-
Conversion operator to
unsignedchardata type. - __host__ __device__ __nv_fp8_e8m0::operator unsigned int() const
-
Conversion operator to
unsignedintdata type. - __host__ __device__ __nv_fp8_e8m0::operator unsigned long int() const
-
Conversion operator to
unsignedlongintdata type. - __host__ __device__ __nv_fp8_e8m0::operator unsigned long long int() const
-
Conversion operator to
unsignedlonglongintdata type. - __host__ __device__ __nv_fp8_e8m0::operator unsigned short int() const
-
Conversion operator to
unsignedshortintdata type. - __nv_fp8x2_e4m3::__nv_fp8x2_e4m3()=default
-
Constructor by default.
- __host__ __device__ __nv_fp8x2_e4m3::__nv_fp8x2_e4m3(const __nv_bfloat162 f)
-
Constructor from
__nv_bfloat162data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x2_e4m3::__nv_fp8x2_e4m3(const double2 f)
-
Constructor from
double2data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x2_e4m3::__nv_fp8x2_e4m3(const __half2 f)
-
Constructor from
__half2data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x2_e4m3::__nv_fp8x2_e4m3(const float2 f)
-
Constructor from
float2data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x2_e4m3::operator __half2() const
-
Conversion operator to
__half2data type. - __host__ __device__ __nv_fp8x2_e4m3::operator float2() const
-
Conversion operator to
float2data type. - __host__ __device__ __nv_fp8x2_e5m2::__nv_fp8x2_e5m2(const __nv_bfloat162 f)
-
Constructor from
__nv_bfloat162data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x2_e5m2::__nv_fp8x2_e5m2(const double2 f)
-
Constructor from
double2data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x2_e5m2::__nv_fp8x2_e5m2(const __half2 f)
-
Constructor from
__half2data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __nv_fp8x2_e5m2::__nv_fp8x2_e5m2()=default
-
Constructor by default.
- __host__ __device__ __nv_fp8x2_e5m2::__nv_fp8x2_e5m2(const float2 f)
-
Constructor from
float2data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x2_e5m2::operator __half2() const
-
Conversion operator to
__half2data type. - __host__ __device__ __nv_fp8x2_e5m2::operator float2() const
-
Conversion operator to
float2data type. - __host__ __device__ __nv_fp8x2_e8m0::__nv_fp8x2_e8m0(const __half2 f)
-
Constructor from
__half2data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x2_e8m0::__nv_fp8x2_e8m0(const float2 f)
-
Constructor from
float2data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x2_e8m0::__nv_fp8x2_e8m0(const __nv_bfloat162 f)
-
Constructor from
__nv_bfloat162data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x2_e8m0::__nv_fp8x2_e8m0(const double2 f)
-
Constructor from
double2data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __nv_fp8x2_e8m0::__nv_fp8x2_e8m0()=default
-
Constructor by default.
- __host__ __device__ __nv_fp8x2_e8m0::operator __half2() const
-
Conversion operator to
__half2data type. - __host__ __device__ __nv_fp8x2_e8m0::operator __nv_bfloat162() const
-
Conversion operator to
__nv_bfloat162data type. - __host__ __device__ __nv_fp8x2_e8m0::operator float2() const
-
Conversion operator to
float2data type. - __host__ __device__ __nv_fp8x4_e4m3::__nv_fp8x4_e4m3(const __nv_bfloat162 flo, const __nv_bfloat162 fhi)
-
Constructor from a pair of
__nv_bfloat162data type values, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x4_e4m3::__nv_fp8x4_e4m3(const double4 f)
-
Constructor from
double4vector data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __nv_fp8x4_e4m3::__nv_fp8x4_e4m3()=default
-
Constructor by default.
- __host__ __device__ __nv_fp8x4_e4m3::__nv_fp8x4_e4m3(const float4 f)
-
Constructor from
float4vector data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x4_e4m3::__nv_fp8x4_e4m3(const __half2 flo, const __half2 fhi)
-
Constructor from a pair of
__half2data type values, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x4_e4m3::operator float4() const
-
Conversion operator to
float4vector data type. - __nv_fp8x4_e5m2::__nv_fp8x4_e5m2()=default
-
Constructor by default.
- __host__ __device__ __nv_fp8x4_e5m2::__nv_fp8x4_e5m2(const double4 f)
-
Constructor from
double4vector data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x4_e5m2::__nv_fp8x4_e5m2(const float4 f)
-
Constructor from
float4vector data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x4_e5m2::__nv_fp8x4_e5m2(const __nv_bfloat162 flo, const __nv_bfloat162 fhi)
-
Constructor from a pair of
__nv_bfloat162data type values, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x4_e5m2::__nv_fp8x4_e5m2(const __half2 flo, const __half2 fhi)
-
Constructor from a pair of
__half2data type values, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x4_e5m2::operator float4() const
-
Conversion operator to
float4vector data type. - __host__ __device__ __nv_fp8x4_e8m0::__nv_fp8x4_e8m0(const __half2 flo, const __half2 fhi)
-
Constructor from a pair of
__half2data type values, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x4_e8m0::__nv_fp8x4_e8m0(const float4 f)
-
Constructor from
float4vector data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x4_e8m0::__nv_fp8x4_e8m0(const double4 f)
-
Constructor from
double4vector data type, relies on__NV_SATFINITEbehavior for out-of-range values. - __host__ __device__ __nv_fp8x4_e8m0::__nv_fp8x4_e8m0(const __nv_bfloat162 flo, const __nv_bfloat162 fhi)
-
Constructor from a pair of
__nv_bfloat162data type values, relies on__NV_SATFINITEbehavior for out-of-range values. - __nv_fp8x4_e8m0::__nv_fp8x4_e8m0()=default
-
Constructor by default.
- __host__ __device__ __nv_fp8x4_e8m0::operator float4() const
-
Conversion operator to
float4vector data type.
Typedefs
- __nv_fp8_storage_t
-
8-bit
unsignedintegertype abstraction used forfp8floating-point numbers storage. - __nv_fp8x2_storage_t
-
16-bit
unsignedintegertype abstraction used for storage of pairs offp8floating-point numbers. - __nv_fp8x4_storage_t
-
32-bit
unsignedintegertype abstraction used for storage of tetrads offp8floating-point numbers.
3.9.1. Enumerations
-
enum __nv_fp8_interpretation_t
-
Enumerates the possible interpretations of the 8-bit values when referring to them as
fp8types.Values:
-
enumerator __NV_E4M3
-
Stands for
fp8numbers ofe4m3kind.
-
enumerator __NV_E5M2
-
Stands for
fp8numbers ofe5m2kind.
-
enumerator __NV_E4M3
-
enum __nv_saturation_t
-
Enumerates the modes applicable when performing a narrowing conversion to
fp8destination types.Values:
-
enumerator __NV_NOSAT
-
Means no saturation to finite is performed when conversion results in rounding values outside the range of destination type.
NOTE: for fp8 type of e4m3 kind, the results that are larger than the maximum representable finite number of the target format become NaN.
-
enumerator __NV_SATFINITE
-
Means input larger than the maximum representable finite number MAXNORM of the target format round to the MAXNORM of the same sign as input.
-
enumerator __NV_NOSAT
3.9.2. Functions
-
__host__ __device__ __nv_fp8x2_storage_t __nv_cvt_bfloat162raw_to_e8m0x2(const __nv_bfloat162_raw x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
Converts a pair of
bfloat16values into a pair of scaling factors ofe8m0kind.See also
__nv_cvt_bfloat16raw_to_e8m0() for details of conversion.
- Returns
-
The
__nv_fp8x2_storage_tvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8x2_storage_t __nv_cvt_bfloat16raw2_to_fp8x2(const __nv_bfloat162_raw x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input vector of two
nv_bfloat16precision numbers packed in__nv_bfloat162_rawxinto a vector of two values offp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode.Converts input vector
xto a vector of twofp8values of the kind specified byfp8_interpretationparameter, using round-to-nearest-even rounding and saturation mode specified bysaturateparameter.- Returns
-
The
__nv_fp8x2_storage_tvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8_storage_t __nv_cvt_bfloat16raw_to_e8m0(const __nv_bfloat16_raw x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
Converts input
bfloat16input into a scaling factor ofe8m0kind.Input number’s absolute value is rounded to the closest power of two in the direction specified via
roundingparameter. Rounded results that are smaller than the smallest representable target format number 2^-127 are then clipped to 2^-127. Results that are larger than the largest representable target format number 2^127 are either clipped to 2^127 ifsaturateequals to__NV_SATFINITE, or convert toNaNotherwise.NaNinputs convert intoNaNoutput, encoded as0xFFin the target format.- Returns
-
The
__nv_fp8_storage_tvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8_storage_t __nv_cvt_bfloat16raw_to_fp8(const __nv_bfloat16_raw x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input
nv_bfloat16precisionxtofp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode.Converts input
xtofp8type of the kind specified byfp8_interpretationparameter, using round-to-nearest-even rounding and saturation mode specified bysaturateparameter.- Returns
-
The
__nv_fp8_storage_tvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8x2_storage_t __nv_cvt_double2_to_e8m0x2(const double2 x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
Converts a pair of
doublevalues into a pair of scaling factors ofe8m0kind.See also
__nv_cvt_bfloat16raw_to_e8m0() for details of conversion.
- Returns
-
The
__nv_fp8x2_storage_tvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8x2_storage_t __nv_cvt_double2_to_fp8x2(const double2 x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input vector of two
doubleprecision numbers packed indouble2xinto a vector of two values offp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode.Converts input vector
xto a vector of twofp8values of the kind specified byfp8_interpretationparameter, using round-to-nearest-even rounding and saturation mode specified bysaturateparameter.- Returns
-
The
__nv_fp8x2_storage_tvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8_storage_t __nv_cvt_double_to_e8m0(const double x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
Converts input
doublevalue into a scaling factor ofe8m0kind.See also
__nv_cvt_bfloat16raw_to_e8m0() for details of conversion.
- Returns
-
The
__nv_fp8_storage_tvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8_storage_t __nv_cvt_double_to_fp8(const double x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input
doubleprecisionxtofp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode.Converts input
xtofp8type of the kind specified byfp8_interpretationparameter, using round-to-nearest-even rounding and saturation mode specified bysaturateparameter.- Returns
-
The
__nv_fp8_storage_tvalue holds the result of conversion.
-
__host__ __device__ __nv_bfloat16_raw __nv_cvt_e8m0_to_bf16raw(const __nv_fp8_storage_t x)
-
Converts input scaling factor value of
e8m0kind intobfloat16.Input scales are exact powers of two or a
NaNvalue, also representable in the target format.- Returns
-
The
__nv_bfloat16_rawvalue holds the result of conversion.
-
__host__ __device__ __nv_bfloat162_raw __nv_cvt_e8m0x2_to_bf162raw(const __nv_fp8x2_storage_t x)
-
Converts input pair of scaling factors of
e8m0kind into a pair ofbfloat16values.- Returns
-
The
__nv_bfloat162_rawvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8x2_storage_t __nv_cvt_float2_to_e8m0x2(const float2 x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
Converts a pair of
floatvalues into a pair of scaling factors ofe8m0kind.See also
__nv_cvt_bfloat16raw_to_e8m0() for details of conversion.
- Returns
-
The
__nv_fp8x2_storage_tvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8x2_storage_t __nv_cvt_float2_to_fp8x2(const float2 x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input vector of two
singleprecision numbers packed infloat2xinto a vector of two values offp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode.Converts input vector
xto a vector of twofp8values of the kind specified byfp8_interpretationparameter, using round-to-nearest-even rounding and saturation mode specified bysaturateparameter.- Returns
-
The
__nv_fp8x2_storage_tvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8_storage_t __nv_cvt_float_to_e8m0(const float x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
Converts input
floatvalue into a scaling factor ofe8m0kind.See also
__nv_cvt_bfloat16raw_to_e8m0() for details of conversion.
- Returns
-
The
__nv_fp8_storage_tvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8_storage_t __nv_cvt_float_to_fp8(const float x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input
singleprecisionxtofp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode.Converts input
xtofp8type of the kind specified byfp8_interpretationparameter, using round-to-nearest-even rounding and saturation mode specified bysaturateparameter.- Returns
-
The
__nv_fp8_storage_tvalue holds the result of conversion.
-
__host__ __device__ __half_raw __nv_cvt_fp8_to_halfraw(const __nv_fp8_storage_t x, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input
fp8xof the specified kind tohalfprecision.Converts input
xoffp8type of the kind specified byfp8_interpretationparameter tohalfprecision.- Returns
-
The
__half_rawvalue holds the result of conversion.
-
__host__ __device__ __half2_raw __nv_cvt_fp8x2_to_halfraw2(const __nv_fp8x2_storage_t x, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input vector of two
fp8values of the specified kind to a vector of twohalfprecision values packed in__half2_rawstructure.Converts input vector
xoffp8type of the kind specified byfp8_interpretationparameter to a vector of twohalfprecision values and returns as__half2_rawstructure.- Returns
-
The
__half2_rawvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8x2_storage_t __nv_cvt_halfraw2_to_fp8x2(const __half2_raw x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input vector of two
halfprecision numbers packed in__half2_rawxinto a vector of two values offp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode.Converts input vector
xto a vector of twofp8values of the kind specified byfp8_interpretationparameter, using round-to-nearest-even rounding and saturation mode specified bysaturateparameter.- Returns
-
The
__nv_fp8x2_storage_tvalue holds the result of conversion.
-
__host__ __device__ __nv_fp8_storage_t __nv_cvt_halfraw_to_fp8(const __half_raw x, const __nv_saturation_t saturate, const __nv_fp8_interpretation_t fp8_interpretation)
-
Converts input
halfprecisionxtofp8type of the requested kind using round-to-nearest-even rounding and requested saturation mode.Converts input
xtofp8type of the kind specified byfp8_interpretationparameter, using round-to-nearest-even rounding and saturation mode specified bysaturateparameter.- Returns
-
The
__nv_fp8_storage_tvalue holds the result of conversion.
3.9.3. Typedefs
-
typedef unsigned char __nv_fp8_storage_t
-
8-bit
unsignedintegertype abstraction used forfp8floating-point numbers storage.
-
typedef unsigned short int __nv_fp8x2_storage_t
-
16-bit
unsignedintegertype abstraction used for storage of pairs offp8floating-point numbers.
-
typedef unsigned int __nv_fp8x4_storage_t
-
32-bit
unsignedintegertype abstraction used for storage of tetrads offp8floating-point numbers.