15.9. __nv_fp4_e2m1
-
struct __nv_fp4_e2m1
-
__nv_fp4_e2m1 datatype
This structure implements the datatype for handling
fp4floating-point numbers ofe2m1kind: with 1 sign, 2 exponent, 1 implicit and 1 explicit mantissa bits. This encoding does not support Inf/NaN.The structure implements converting constructors and operators.
Public Functions
-
__host__ __device__ inline __nv_fp4_e2m1()
-
Constructor by default.
-
__host__ __device__ inline explicit __nv_fp4_e2m1(const __half f)
-
Constructor from
__halfdata type, relies on__NV_SATFINITEbehavior for out-of-range values andcudaRoundNearestrounding mode.
-
__host__ __device__ inline explicit __nv_fp4_e2m1(const __nv_bfloat16 f)
-
Constructor from
__nv_bfloat16data type, relies on__NV_SATFINITEbehavior for out-of-range values andcudaRoundNearestrounding mode.
-
__host__ __device__ inline explicit __nv_fp4_e2m1(const double f)
-
Constructor from
doubledata type, relies on__NV_SATFINITEbehavior for out-of-range values andcudaRoundNearestrounding mode.
-
__host__ __device__ inline explicit __nv_fp4_e2m1(const float f)
-
Constructor from
floatdata type, relies on__NV_SATFINITEbehavior for out-of-range values andcudaRoundNearestrounding mode.
-
__host__ __device__ inline explicit __nv_fp4_e2m1(const int val)
-
Constructor from
intdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
-
__host__ __device__ inline explicit __nv_fp4_e2m1(const long int val)
-
Constructor from
longintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
-
__host__ __device__ inline explicit __nv_fp4_e2m1(const long long int val)
-
Constructor from
longlongintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
-
__host__ __device__ inline explicit __nv_fp4_e2m1(const short int val)
-
Constructor from
shortintdata type.
-
__host__ __device__ inline explicit __nv_fp4_e2m1(const unsigned int val)
-
Constructor from
unsignedintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
-
__host__ __device__ inline explicit __nv_fp4_e2m1(const unsigned long int val)
-
Constructor from
unsignedlongintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
-
__host__ __device__ inline explicit __nv_fp4_e2m1(const unsigned long long int val)
-
Constructor from
unsignedlonglongintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
-
__host__ __device__ inline explicit __nv_fp4_e2m1(const unsigned short int val)
-
Constructor from
unsignedshortintdata type, relies on__NV_SATFINITEbehavior for out-of-range values.
Public Members
-
__nv_fp4_storage_t __x
-
Storage variable contains the
fp4floating-point data.
-
__host__ __device__ inline __nv_fp4_e2m1()