1.3. Bfloat16 Precision Intrinsics

This section describes nv_bfloat16 precision intrinsic functions that are only supported in device code. To use these functions, include the header file cuda_bf16.h in your program. The following macros are available to help users selectively enable/disable various definitions present in the header file:

  • CUDA_NO_BFLOAT16 - If defined, this macro will prevent the definition of additional type aliases in the global namespace, helping to avoid potential conflicts with symbols defined in the user program.

  • __CUDA_NO_BFLOAT16_CONVERSIONS__ - If defined, this macro will prevent the use of the C++ type conversions (converting constructors and conversion operators) that are common for built-in floating-point types, but may be undesirable for __nv_bfloat16 which is essentially a user-defined type.

  • __CUDA_NO_BFLOAT16_OPERATORS__ and __CUDA_NO_BFLOAT162_OPERATORS__ - If defined, these macros will prevent the inadvertent use of usual arithmetic and comparison operators. This enforces the storage-only type semantics and prevents C++ style computations on __nv_bfloat16 and __nv_bfloat162 types.

Modules

 
 
 
 
 
 
 

Bfloat16 Arithmetic Functions

Bfloat162 Arithmetic Functions

Bfloat16 Comparison Functions

Bfloat162 Comparison Functions

Bfloat16 Precision Conversion and Data Movement

Bfloat16 Math Functions

Bfloat162 Math Functions