15.20. __nv_fp8_e8m0
-
struct __nv_fp8_e8m0
-
__nv_fp8_e8m0 数据类型
该结构实现了用于处理
e8m0类型的8位比例因子的数据类型:将其解释为带偏置指数的二的幂次方。偏置值为127,因此数值0到254表示2^-127到2^127。数值0xFF= 255保留用于NaN。该结构实现了转换构造函数和运算符。
公共函数
-
__nv_fp8_e8m0() = default
-
默认构造函数。
-
__host__ __device__ inline explicit __nv_fp8_e8m0(const __half f)
-
从
__half数据类型的构造函数,对于大输入值依赖于__NV_SATFINITE的行为,并使用cudaRoundZero进行舍入。另请参阅
-
__host__ __device__ inline explicit __nv_fp8_e8m0(const __nv_bfloat16 f)
-
从
__nv_bfloat16数据类型构造,对于大输入值依赖__NV_SATFINITE行为,并使用cudaRoundZero进行舍入。另请参阅
-
__host__ __device__ inline explicit __nv_fp8_e8m0(const double f)
-
从
double数据类型构造,对于大输入值依赖__NV_SATFINITE行为,并使用cudaRoundZero进行舍入。另请参阅
-
__host__ __device__ inline explicit __nv_fp8_e8m0(const float f)
-
从
float数据类型构造,对于大输入值依赖于__NV_SATFINITE的行为特性,并使用cudaRoundZero进行舍入。另请参阅
-
__host__ __device__ inline explicit __nv_fp8_e8m0(const int val)
-
从
int数据类型构造,依赖于cudaRoundZero舍入方式。
-
__host__ __device__ inline explicit __nv_fp8_e8m0(const long int val)
-
从
longint数据类型构造,依赖于cudaRoundZero舍入方式。
-
__host__ __device__ inline explicit __nv_fp8_e8m0(const long long int val)
-
从
longlongint数据类型的构造函数,依赖于cudaRoundZero舍入方式。
-
__host__ __device__ inline explicit __nv_fp8_e8m0(const short int val)
-
从
shortint数据类型构造,依赖cudaRoundZero舍入方式。
-
__host__ __device__ inline explicit __nv_fp8_e8m0(const unsigned int val)
-
从
unsignedint数据类型的构造函数,依赖于cudaRoundZero舍入方式。
-
__host__ __device__ inline explicit __nv_fp8_e8m0(const unsigned long int val)
-
从
unsignedlongint数据类型构造,依赖于cudaRoundZero舍入方式。
-
__host__ __device__ inline explicit __nv_fp8_e8m0(const unsigned long long int val)
-
从
unsignedlonglongint数据类型的构造函数,依赖于cudaRoundZero舍入方式。
-
__host__ __device__ inline explicit __nv_fp8_e8m0(const unsigned short int val)
-
从
unsignedshortint数据类型构造,依赖于cudaRoundZero舍入方式。
-
__host__ __device__ inline explicit operator __nv_bfloat16() const
-
转换为
__nv_bfloat16数据类型的转换运算符。
-
__host__ __device__ inline explicit operator bool() const
-
转换为
bool数据类型的转换运算符。输入范围内的所有值均为非零,因此结果始终为
true。
-
__host__ __device__ inline explicit operator char() const
-
转换为实现定义的
char数据类型的转换运算符。检测
char类型的有符号性并相应处理,更多细节请参阅有符号和无符号char运算符。将输入值限制在输出范围内。
NaN输入会转换为零。
-
__host__ __device__ inline explicit operator double() const
-
转换为
double数据类型的转换运算符。
-
__host__ __device__ inline explicit operator float() const
-
转换为
float数据类型的转换运算符。
-
__host__ __device__ inline explicit operator int() const
-
转换为
int数据类型的转换运算符。将过大的输入限制在输出范围内。
NaN输入会转换为zero。
-
__host__ __device__ inline explicit operator long int() const
-
转换为
longint数据类型的转换运算符。将过大的输入限制在输出范围内。如果输出类型为32位,
NaN输入将转换为zero。如果输出类型为64位,NaN输入将转换为0x8000000000000000ULL。
-
__host__ __device__ inline explicit operator long long int() const
-
转换为
longlongint数据类型的转换运算符。将过大的输入限制在输出范围内。
NaN输入会转换为0x8000000000000000LL。
-
__host__ __device__ inline explicit operator short int() const
-
转换为
shortint数据类型的转换运算符。将过大的输入限制在输出范围内。
NaN输入会转换为zero。
-
__host__ __device__ inline explicit operator signed char() const
-
转换为
signedchar数据类型的转换运算符。将过大的输入限制在输出范围内。
NaN输入会转换为zero。
-
__host__ __device__ inline explicit operator unsigned char() const
-
转换为
unsignedchar数据类型的转换运算符。将过大的输入限制在输出范围内。
NaN输入会转换为zero。
-
__host__ __device__ inline explicit operator unsigned int() const
-
转换为
unsignedint数据类型的转换运算符。将过大的输入限制在输出范围内。
NaN输入会转换为zero。
-
__host__ __device__ inline explicit operator unsigned long int() const
-
转换为
unsignedlongint数据类型的转换运算符。将过大的输入限制在输出范围内。如果输出类型为32位,
NaN输入将转换为zero。如果输出类型为64位,NaN输入将转换为0x8000000000000000ULL。
-
__host__ __device__ inline explicit operator unsigned long long int() const
-
转换为
unsignedlonglongint数据类型的转换运算符。将过大的输入限制在输出范围内。
NaN输入会被转换为0x8000000000000000ULL。
-
__host__ __device__ inline explicit operator unsigned short int() const
-
转换为
unsignedshortint数据类型的转换运算符。将过大的输入限制在输出范围内。
NaN输入会转换为zero。
公共成员
-
__nv_fp8_storage_t __x
-
存储变量包含8位比例数据。
-
__nv_fp8_e8m0() = default