3.9. FP8 转换和数据移动
要使用这些函数,请在您的程序中包含头文件 cuda_fp8.h。
枚举
- __nv_fp8_interpretation_t
-
枚举将 8 位值作为
fp8类型引用时可能的解释。 - __nv_saturation_t
-
枚举执行到
fp8目标类型的窄化转换时适用的模式。
函数
- __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)
-
将一对
bfloat16值转换为一对e8m0类型的比例因子。 - __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)
-
将打包在
__nv_bfloat162_rawx中的两个nv_bfloat16精度数字的输入向量转换为使用舍入到最近偶数和请求的饱和模式的请求类型的两个fp8类型值的向量。 - __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)
-
将
bfloat16输入转换为e8m0类型的比例因子。 - __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)
-
将
nv_bfloat16精度x转换为使用舍入到最近偶数和请求的饱和模式的请求类型的fp8类型。 - __host__ __device__ __nv_fp8x2_storage_t __nv_cvt_double2_to_e8m0x2(const double2 x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
将一对
double值转换为一对e8m0类型的比例因子。 - __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)
-
将打包在
double2x中的两个double精度数字的输入向量转换为使用舍入到最近偶数和请求的饱和模式的请求类型的两个fp8类型值的向量。 - __host__ __device__ __nv_fp8_storage_t __nv_cvt_double_to_e8m0(const double x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
将
double值输入转换为e8m0类型的比例因子。 - __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)
-
将
double精度x转换为使用舍入到最近偶数和请求的饱和模式的请求类型的fp8类型。 - __host__ __device__ __nv_bfloat16_raw __nv_cvt_e8m0_to_bf16raw(const __nv_fp8_storage_t x)
-
将
e8m0类型的输入比例因子值转换为bfloat16。 - __host__ __device__ __nv_bfloat162_raw __nv_cvt_e8m0x2_to_bf162raw(const __nv_fp8x2_storage_t x)
-
将一对
e8m0类型的输入比例因子转换为一对bfloat16值。 - __host__ __device__ __nv_fp8x2_storage_t __nv_cvt_float2_to_e8m0x2(const float2 x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
将一对
float值转换为一对e8m0类型的比例因子。 - __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)
-
将打包在
float2x中的两个single精度数字的输入向量转换为使用舍入到最近偶数和请求的饱和模式的请求类型的两个fp8类型值的向量。 - __host__ __device__ __nv_fp8_storage_t __nv_cvt_float_to_e8m0(const float x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
将
float值输入转换为e8m0类型的比例因子。 - __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)
-
将
single精度x转换为使用舍入到最近偶数和请求的饱和模式的请求类型的fp8类型。 - __host__ __device__ __half_raw __nv_cvt_fp8_to_halfraw(const __nv_fp8_storage_t x, const __nv_fp8_interpretation_t fp8_interpretation)
-
将指定类型的输入
fp8x转换为half精度。 - __host__ __device__ __half2_raw __nv_cvt_fp8x2_to_halfraw2(const __nv_fp8x2_storage_t x, const __nv_fp8_interpretation_t fp8_interpretation)
-
将指定类型的两个
fp8值的输入向量转换为打包在__half2_raw结构体中的两个half精度值的向量。 - __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)
-
将打包在
__half2_rawx中的两个half精度数字的输入向量转换为使用舍入到最近偶数和请求的饱和模式的请求类型的两个fp8类型值的向量。 - __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)
-
将
half精度x转换为使用舍入到最近偶数和请求的饱和模式的请求类型的fp8类型。 - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const int val)
-
从
int数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const unsigned long long int val)
-
从
unsignedlonglongint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const __nv_bfloat16 f)
-
从
__nv_bfloat16数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const long int val)
-
从
longint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const long long int val)
-
从
longlongint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __nv_fp8_e4m3::__nv_fp8_e4m3()=default
-
默认构造函数。
- __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const unsigned short int val)
-
从
unsignedshortint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const float f)
-
从
float数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const __half f)
-
从
__half数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const unsigned long int val)
-
从
unsignedlongint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const double f)
-
从
double数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const short int val)
-
从
shortint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e4m3::__nv_fp8_e4m3(const unsigned int val)
-
从
unsignedint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e4m3::operator __half() const
-
到
__half数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator __nv_bfloat16() const
-
到
__nv_bfloat16数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator bool() const
-
到
bool数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator char() const
-
到实现定义的
char数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator double() const
-
到
double数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator float() const
-
到
float数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator int() const
-
到
int数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator long int() const
-
到
longint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator long long int() const
-
到
longlongint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator short int() const
-
到
shortint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator signed char() const
-
到
signedchar数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator unsigned char() const
-
到
unsignedchar数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator unsigned int() const
-
到
unsignedint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator unsigned long int() const
-
到
unsignedlongint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator unsigned long long int() const
-
到
unsignedlonglongint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e4m3::operator unsigned short int() const
-
到
unsignedshortint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const __half f)
-
从
__half数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const long long int val)
-
从
longlongint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const unsigned int val)
-
从
unsignedint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const float f)
-
从
float数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const unsigned short int val)
-
从
unsignedshortint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __nv_fp8_e5m2::__nv_fp8_e5m2()=default
-
默认构造函数。
- __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const int val)
-
从
int数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const long int val)
-
从
longint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const double f)
-
从
double数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const unsigned long int val)
-
从
unsignedlongint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const short int val)
-
从
shortint数据类型构造。 - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const __nv_bfloat16 f)
-
从
__nv_bfloat16数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e5m2::__nv_fp8_e5m2(const unsigned long long int val)
-
从
unsignedlonglongint数据类型构造,依赖于超出范围值的__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8_e5m2::operator __half() const
-
到
__half数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator __nv_bfloat16() const
-
到
__nv_bfloat16数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator bool() const
-
到
bool数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator char() const
-
到实现定义的
char数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator double() const
-
到
double数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator float() const
-
到
float数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator int() const
-
到
int数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator long int() const
-
到
longint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator long long int() const
-
到
longlongint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator short int() const
-
到
shortint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator signed char() const
-
到
signedchar数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator unsigned char() const
-
到
unsignedchar数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator unsigned int() const
-
到
unsignedint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator unsigned long int() const
-
到
unsignedlongint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator unsigned long long int() const
-
到
unsignedlonglongint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e5m2::operator unsigned short int() const
-
到
unsignedshortint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const long int val)
-
从
longint数据类型构造,依赖于cudaRoundZero舍入。 - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const int val)
-
从
int数据类型构造,依赖于cudaRoundZero舍入。 - __nv_fp8_e8m0::__nv_fp8_e8m0()=default
-
默认构造函数。
- __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const unsigned int val)
-
从
unsignedint数据类型构造,依赖于cudaRoundZero舍入。 - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const float f)
-
从
float数据类型构造,对于大的输入值,依赖于__NV_SATFINITE行为,对于舍入,依赖于cudaRoundZero。 - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const unsigned long long int val)
-
从
unsignedlonglongint数据类型构造,依赖于cudaRoundZero舍入。 - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const double f)
-
从
double数据类型构造,对于大的输入值,依赖于__NV_SATFINITE行为,对于舍入,依赖于cudaRoundZero。 - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const __half f)
-
从
__half数据类型构造,对于大的输入值,依赖于__NV_SATFINITE行为,对于舍入,依赖于cudaRoundZero。 - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const __nv_bfloat16 f)
-
从
__nv_bfloat16数据类型构造,对于大的输入值,依赖于__NV_SATFINITE行为,对于舍入,依赖于cudaRoundZero。 - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const unsigned long int val)
-
从
unsignedlongint数据类型构造,依赖于cudaRoundZero舍入。 - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const unsigned short int val)
-
从
unsignedshortint数据类型构造,依赖于cudaRoundZero舍入。 - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const long long int val)
-
从
longlongint数据类型构造,依赖于cudaRoundZero舍入。 - __host__ __device__ __nv_fp8_e8m0::__nv_fp8_e8m0(const short int val)
-
从
shortint数据类型构造,依赖于cudaRoundZero舍入。 - __host__ __device__ __nv_fp8_e8m0::operator __half() const
-
到
__half数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator __nv_bfloat16() const
-
到
__nv_bfloat16数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator bool() const
-
到
bool数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator char() const
-
到实现定义的
char数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator double() const
-
到
double数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator float() const
-
到
float数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator int() const
-
到
int数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator long int() const
-
到
longint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator long long int() const
-
到
longlongint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator short int() const
-
到
shortint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator signed char() const
-
到
signedchar数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator unsigned char() const
-
到
unsignedchar数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator unsigned int() const
-
到
unsignedint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator unsigned long int() const
-
到
unsignedlongint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator unsigned long long int() const
-
到
unsignedlonglongint数据类型的转换运算符。 - __host__ __device__ __nv_fp8_e8m0::operator unsigned short int() const
-
到
unsignedshortint数据类型的转换运算符。 - __nv_fp8x2_e4m3::__nv_fp8x2_e4m3()=default
-
默认构造函数。
- __host__ __device__ __nv_fp8x2_e4m3::__nv_fp8x2_e4m3(const __nv_bfloat162 f)
-
从
__nv_bfloat162数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x2_e4m3::__nv_fp8x2_e4m3(const double2 f)
-
从
double2数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x2_e4m3::__nv_fp8x2_e4m3(const __half2 f)
-
从
__half2数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x2_e4m3::__nv_fp8x2_e4m3(const float2 f)
-
从
float2数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x2_e4m3::operator __half2() const
-
转换为
__half2数据类型的转换运算符。 - __host__ __device__ __nv_fp8x2_e4m3::operator float2() const
-
转换为
float2数据类型的转换运算符。 - __host__ __device__ __nv_fp8x2_e5m2::__nv_fp8x2_e5m2(const __nv_bfloat162 f)
-
从
__nv_bfloat162数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x2_e5m2::__nv_fp8x2_e5m2(const double2 f)
-
从
double2数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x2_e5m2::__nv_fp8x2_e5m2(const __half2 f)
-
从
__half2数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __nv_fp8x2_e5m2::__nv_fp8x2_e5m2()=default
-
默认构造函数。
- __host__ __device__ __nv_fp8x2_e5m2::__nv_fp8x2_e5m2(const float2 f)
-
从
float2数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x2_e5m2::operator __half2() const
-
转换为
__half2数据类型的转换运算符。 - __host__ __device__ __nv_fp8x2_e5m2::operator float2() const
-
转换为
float2数据类型的转换运算符。 - __host__ __device__ __nv_fp8x2_e8m0::__nv_fp8x2_e8m0(const __half2 f)
-
从
__half2数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x2_e8m0::__nv_fp8x2_e8m0(const float2 f)
-
从
float2数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x2_e8m0::__nv_fp8x2_e8m0(const __nv_bfloat162 f)
-
从
__nv_bfloat162数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x2_e8m0::__nv_fp8x2_e8m0(const double2 f)
-
从
double2数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __nv_fp8x2_e8m0::__nv_fp8x2_e8m0()=default
-
默认构造函数。
- __host__ __device__ __nv_fp8x2_e8m0::operator __half2() const
-
转换为
__half2数据类型的转换运算符。 - __host__ __device__ __nv_fp8x2_e8m0::operator __nv_bfloat162() const
-
转换为
__nv_bfloat162数据类型的转换运算符。 - __host__ __device__ __nv_fp8x2_e8m0::operator float2() const
-
转换为
float2数据类型的转换运算符。 - __host__ __device__ __nv_fp8x4_e4m3::__nv_fp8x4_e4m3(const __nv_bfloat162 flo, const __nv_bfloat162 fhi)
-
从一对
__nv_bfloat162数据类型值构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x4_e4m3::__nv_fp8x4_e4m3(const double4 f)
-
从
double4向量数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __nv_fp8x4_e4m3::__nv_fp8x4_e4m3()=default
-
默认构造函数。
- __host__ __device__ __nv_fp8x4_e4m3::__nv_fp8x4_e4m3(const float4 f)
-
从
float4向量数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x4_e4m3::__nv_fp8x4_e4m3(const __half2 flo, const __half2 fhi)
-
从一对
__half2数据类型值构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x4_e4m3::operator float4() const
-
转换为
float4向量数据类型的转换运算符。 - __nv_fp8x4_e5m2::__nv_fp8x4_e5m2()=default
-
默认构造函数。
- __host__ __device__ __nv_fp8x4_e5m2::__nv_fp8x4_e5m2(const double4 f)
-
从
double4向量数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x4_e5m2::__nv_fp8x4_e5m2(const float4 f)
-
从
float4向量数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x4_e5m2::__nv_fp8x4_e5m2(const __nv_bfloat162 flo, const __nv_bfloat162 fhi)
-
从一对
__nv_bfloat162数据类型值构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x4_e5m2::__nv_fp8x4_e5m2(const __half2 flo, const __half2 fhi)
-
从一对
__half2数据类型值构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x4_e5m2::operator float4() const
-
转换为
float4向量数据类型的转换运算符。 - __host__ __device__ __nv_fp8x4_e8m0::__nv_fp8x4_e8m0(const __half2 flo, const __half2 fhi)
-
从一对
__half2数据类型值构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x4_e8m0::__nv_fp8x4_e8m0(const float4 f)
-
从
float4向量数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x4_e8m0::__nv_fp8x4_e8m0(const double4 f)
-
从
double4向量数据类型构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __host__ __device__ __nv_fp8x4_e8m0::__nv_fp8x4_e8m0(const __nv_bfloat162 flo, const __nv_bfloat162 fhi)
-
从一对
__nv_bfloat162数据类型值构造,对于超出范围的值,依赖于__NV_SATFINITE行为。 - __nv_fp8x4_e8m0::__nv_fp8x4_e8m0()=default
-
默认构造函数。
- __host__ __device__ __nv_fp8x4_e8m0::operator float4() const
-
转换为
float4向量数据类型的转换运算符。
类型定义
- __nv_fp8_storage_t
-
用于
fp8浮点数存储的 8 位unsignedinteger类型抽象。 - __nv_fp8x2_storage_t
-
用于存储
fp8浮点数对的 16 位unsignedinteger类型抽象。 - __nv_fp8x4_storage_t
-
用于存储
fp8浮点数四元组的 32 位unsignedinteger类型抽象。
3.9.1. 枚举
3.9.2. 函数
-
__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)
-
将一对
bfloat16值转换为一对e8m0类型的比例因子。另请参阅
__nv_cvt_bfloat16raw_to_e8m0() 以获取转换的详细信息。
- 返回值
-
__nv_fp8x2_storage_t值保存转换结果。
-
__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)
-
将打包在
__nv_bfloat162_rawx中的两个nv_bfloat16精度数字的输入向量,转换为所需类型的fp8类型的两个值的向量,使用舍入到最接近的偶数舍入和请求的饱和模式。将输入向量
x转换为由fp8_interpretation参数指定的类型的两个fp8值的向量,使用舍入到最接近的偶数舍入和由saturate参数指定的饱和模式。- 返回值
-
__nv_fp8x2_storage_t值保存转换结果。
-
__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)
-
将
bfloat16输入转换为e8m0类型的比例因子。输入数字的绝对值被舍入到最接近的 2 的幂,方向由
rounding参数指定。小于最小可表示目标格式数字 2^-127 的舍入结果将被裁剪为 2^-127。大于最大可表示目标格式数字 2^127 的结果,如果saturate等于__NV_SATFINITE,则裁剪为 2^127,否则转换为NaN。NaN输入转换为NaN输出,在目标格式中编码为0xFF。- 返回值
-
__nv_fp8_storage_t值保存转换结果。
-
__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)
-
将
nv_bfloat16精度x转换为使用舍入到最近偶数和请求的饱和模式的请求类型的fp8类型。将输入
x转换为由fp8_interpretation参数指定的类型的fp8类型,使用舍入到最接近的偶数舍入和由saturate参数指定的饱和模式。- 返回值
-
__nv_fp8_storage_t值保存转换结果。
-
__host__ __device__ __nv_fp8x2_storage_t __nv_cvt_double2_to_e8m0x2(const double2 x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
将一对
double值转换为一对e8m0类型的比例因子。另请参阅
__nv_cvt_bfloat16raw_to_e8m0() 以获取转换的详细信息。
- 返回值
-
__nv_fp8x2_storage_t值保存转换结果。
-
__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)
-
将打包在
double2x中的两个double精度数字的输入向量转换为使用舍入到最近偶数和请求的饱和模式的请求类型的两个fp8类型值的向量。将输入向量
x转换为由fp8_interpretation参数指定的类型的两个fp8值的向量,使用舍入到最接近的偶数舍入和由saturate参数指定的饱和模式。- 返回值
-
__nv_fp8x2_storage_t值保存转换结果。
-
__host__ __device__ __nv_fp8_storage_t __nv_cvt_double_to_e8m0(const double x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
将
double值输入转换为e8m0类型的比例因子。另请参阅
__nv_cvt_bfloat16raw_to_e8m0() 以获取转换的详细信息。
- 返回值
-
__nv_fp8_storage_t值保存转换结果。
-
__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)
-
将
double精度x转换为使用舍入到最近偶数和请求的饱和模式的请求类型的fp8类型。将输入
x转换为由fp8_interpretation参数指定的类型的fp8类型,使用舍入到最接近的偶数舍入和由saturate参数指定的饱和模式。- 返回值
-
__nv_fp8_storage_t值保存转换结果。
-
__host__ __device__ __nv_bfloat16_raw __nv_cvt_e8m0_to_bf16raw(const __nv_fp8_storage_t x)
-
将
e8m0类型的输入缩放因子值转换为bfloat16。输入比例是 2 的精确幂或
NaN值,也可以在目标格式中表示。- 返回值
-
__nv_bfloat16_raw值保存转换结果。
-
__host__ __device__ __nv_bfloat162_raw __nv_cvt_e8m0x2_to_bf162raw(const __nv_fp8x2_storage_t x)
-
将一对
e8m0类型的输入比例因子转换为一对bfloat16值。- 返回值
-
__nv_bfloat162_raw值保存转换的结果。
-
__host__ __device__ __nv_fp8x2_storage_t __nv_cvt_float2_to_e8m0x2(const float2 x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
将一对
float值转换为一对e8m0类型的比例因子。另请参阅
__nv_cvt_bfloat16raw_to_e8m0() 以获取转换的详细信息。
- 返回值
-
__nv_fp8x2_storage_t值保存转换结果。
-
__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)
-
将打包在
float2x中的两个single精度数字的输入向量转换为使用舍入到最近偶数和请求的饱和模式的请求类型的两个fp8类型值的向量。将输入向量
x转换为由fp8_interpretation参数指定的类型的两个fp8值的向量,使用舍入到最接近的偶数舍入和由saturate参数指定的饱和模式。- 返回值
-
__nv_fp8x2_storage_t值保存转换结果。
-
__host__ __device__ __nv_fp8_storage_t __nv_cvt_float_to_e8m0(const float x, const __nv_saturation_t saturate, const enum cudaRoundMode rounding)
-
将
float值输入转换为e8m0类型的比例因子。另请参阅
__nv_cvt_bfloat16raw_to_e8m0() 以获取转换的详细信息。
- 返回值
-
__nv_fp8_storage_t值保存转换结果。
-
__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)
-
将
single精度x转换为使用舍入到最近偶数和请求的饱和模式的请求类型的fp8类型。将输入
x转换为由fp8_interpretation参数指定的类型的fp8类型,使用舍入到最接近的偶数舍入和由saturate参数指定的饱和模式。- 返回值
-
__nv_fp8_storage_t值保存转换结果。
-
__host__ __device__ __half_raw __nv_cvt_fp8_to_halfraw(const __nv_fp8_storage_t x, const __nv_fp8_interpretation_t fp8_interpretation)
-
将指定类型的输入
fp8x转换为half精度。将输入
x从fp8类型(类型种类由fp8_interpretation参数指定)转换为half精度。- 返回值
-
__half_raw值保存转换的结果。
-
__host__ __device__ __half2_raw __nv_cvt_fp8x2_to_halfraw2(const __nv_fp8x2_storage_t x, const __nv_fp8_interpretation_t fp8_interpretation)
-
将指定类型的两个
fp8值组成的输入向量,转换为两个half精度值组成的向量,并打包在__half2_raw结构中。将输入向量
x从fp8类型(类型种类由fp8_interpretation参数指定)转换为两个half精度值组成的向量,并作为__half2_raw结构返回。- 返回值
-
__half2_raw值保存转换的结果。
-
__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)
-
将打包在
__half2_rawx中的两个half精度数字组成的输入向量,转换为所需类型的两个fp8类型值组成的向量,使用舍入到最近的偶数的方式进行舍入,并应用请求的饱和模式。将输入向量
x转换为由fp8_interpretation参数指定的类型的两个fp8值的向量,使用舍入到最接近的偶数舍入和由saturate参数指定的饱和模式。- 返回值
-
__nv_fp8x2_storage_t值保存转换结果。
-
__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)
-
将
half精度x转换为使用舍入到最近偶数和请求的饱和模式的请求类型的fp8类型。将输入
x转换为由fp8_interpretation参数指定的类型的fp8类型,使用舍入到最接近的偶数舍入和由saturate参数指定的饱和模式。- 返回值
-
__nv_fp8_storage_t值保存转换结果。
3.9.3. 类型定义
-
typedef unsigned char __nv_fp8_storage_t
-
用于
fp8浮点数存储的 8 位unsignedinteger类型抽象。
-
typedef unsigned short int __nv_fp8x2_storage_t
-
用于存储
fp8浮点数对的 16 位unsignedinteger类型抽象。
-
typedef unsigned int __nv_fp8x4_storage_t
-
用于存储
fp8浮点数四元组的 32 位unsignedinteger类型抽象。