2.1. __nv_fp8_e4m3 Struct Reference
[C++ struct for handling fp8 data type of e4m3 kind.]
This structure implements the datatype for storing fp8 floating-point numbers of e4m3 kind: 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 Constructors
- __host__ __device__ __nv_fp8_e4m3 ( const long long int val )
- __host__ __device__ __nv_fp8_e4m3 ( const int val )
- __host__ __device__ __nv_fp8_e4m3 ( const short int val )
- __host__ __device__ __nv_fp8_e4m3 ( const unsigned long long int val )
- __host__ __device__ __nv_fp8_e4m3 ( const unsigned int val )
- __host__ __device__ __nv_fp8_e4m3 ( const unsigned short int val )
- __host__ __device__ __nv_fp8_e4m3 ( const double f )
- __host__ __device__ __nv_fp8_e4m3 ( const float f )
- __host__ __device__ __nv_fp8_e4m3 ( const __nv_bfloat16 f )
- __host__ __device__ __nv_fp8_e4m3 ( const __half f )
- __nv_fp8_e4m3 ( )
Public Member Functions
- __host__ __device__ operator __half ( ) const
- __host__ __device__ operator __nv_bfloat16 ( ) const
- __host__ __device__ operator bool ( ) const
- __host__ __device__ operator double ( ) const
- __host__ __device__ operator float ( ) const
- __host__ __device__ operator int ( ) const
- __host__ __device__ operator long long int ( ) const
- __host__ __device__ operator short int ( ) const
- __host__ __device__ operator signed char ( ) const
- __host__ __device__ operator unsigned char ( ) const
- __host__ __device__ operator unsigned int ( ) const
- __host__ __device__ operator unsigned long long int ( ) const
- __host__ __device__ operator unsigned short int ( ) const
Public Variables
Constructors
- __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3 ( const long long int val ) [inline, explicit]
-
Description
Constructor from longlongint data type, relies on __NV_SATFINITE behavior for out-of-range values.
- __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3 ( const int val ) [inline, explicit]
-
Description
Constructor from int data type, relies on __NV_SATFINITE behavior for out-of-range values.
- __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3 ( const short int val ) [inline, explicit]
-
Description
Constructor from shortint data type, relies on __NV_SATFINITE behavior for out-of-range values.
- __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3 ( const unsigned long long int val ) [inline, explicit]
-
Description
Constructor from unsignedlonglongint data type, relies on __NV_SATFINITE behavior for out-of-range values.
- __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3 ( const unsigned int val ) [inline, explicit]
-
Description
Constructor from unsignedint data type, relies on __NV_SATFINITE behavior for out-of-range values.
- __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3 ( const unsigned short int val ) [inline, explicit]
-
Description
Constructor from unsignedshortint data type, relies on __NV_SATFINITE behavior for out-of-range values.
- __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3 ( const double f ) [inline, explicit]
-
Description
Constructor from double data type, relies on __NV_SATFINITE behavior for out-of-range values.
- __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3 ( const float f ) [inline, explicit]
-
Description
Constructor from float data type, relies on __NV_SATFINITE behavior for out-of-range values.
- __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3 ( const __nv_bfloat16 f ) [inline, explicit]
-
Description
Constructor from __nv_bfloat16 data type, relies on __NV_SATFINITE behavior for out-of-range values.
- __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3 ( const __half f ) [inline, explicit]
-
Description
Constructor from __half data type, relies on __NV_SATFINITE behavior for out-of-range values.
- __nv_fp8_e4m3::__nv_fp8_e4m3 ( )
-
Description
Constructor by default.
Member Functions
- __host__ __device__ __nv_fp8_e4m3::operator __half ( ) const [inherited, inline]
-
Description
Conversion operator to __half data type.
- __host__ __device__ __nv_fp8_e4m3::operator __nv_bfloat16 ( ) const [inherited, inline]
-
Description
Conversion operator to __nv_bfloat16 data type.
- __host__ __device__ __nv_fp8_e4m3::operator bool ( ) const [inherited, inline]
-
Description
Conversion operator to bool data type. +0 and -0 inputs convert to false. Non-zero inputs convert to true.
- __host__ __device__ __nv_fp8_e4m3::operator double ( ) const [inherited, inline]
-
Description
Conversion operator to double data type.
- __host__ __device__ __nv_fp8_e4m3::operator float ( ) const [inherited, inline]
-
Description
Conversion operator to float data type.
- __host__ __device__ __nv_fp8_e4m3::operator int ( ) const [inherited, inline]
-
Description
Conversion operator to int data type. NaN inputs convert to zero.
- __host__ __device__ __nv_fp8_e4m3::operator long long int ( ) const [inherited, inline]
-
Description
Conversion operator to longlongint data type. NaN inputs convert to 0x8000000000000000LL.
- __host__ __device__ __nv_fp8_e4m3::operator short int ( ) const [inherited, inline]
-
Description
Conversion operator to shortint data type. NaN inputs convert to zero.
- __host__ __device__ __nv_fp8_e4m3::operator signed char ( ) const [inherited, inline]
-
Description
Conversion operator to signedchar data type. Clamps too large inputs to the output range. NaN inputs convert to zero.
- __host__ __device__ __nv_fp8_e4m3::operator unsigned char ( ) const [inherited, inline]
-
Description
Conversion operator to unsignedchar data type. Clamps negative and too large inputs to the output range. NaN inputs convert to zero.
- __host__ __device__ __nv_fp8_e4m3::operator unsigned int ( ) const [inherited, inline]
-
Description
Conversion operator to unsignedint data type. Clamps negative inputs to zero. NaN inputs convert to zero.
- __host__ __device__ __nv_fp8_e4m3::operator unsigned long long int ( ) const [inherited, inline]
-
Description
Conversion operator to unsignedlonglongint data type. Clamps negative inputs to zero. NaN inputs convert to 0x8000000000000000ULL.
- __host__ __device__ __nv_fp8_e4m3::operator unsigned short int ( ) const [inherited, inline]
-
Description
Conversion operator to unsignedshortint data type. Clamps negative inputs to zero. NaN inputs convert to zero.
Variables
- __nv_fp8_storage_t__nv_fp8_e4m3::__x [inherited]
-
Storage variable contains the fp8 floating-point data.