imate
C++/CUDA Reference
Loading...
Searching...
No Matches
_cu_epsilon.h File Reference
Include dependency graph for _cu_epsilon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  cu_arithmetic
 perform arithmetics for __half and __nv_bfloat16 types in round-to-nearest-even mode.
 
namespace  cu_arithmetics
 Cast from float to __half and __nv_bfloat16 types and vice-versa, and float to double and vice-versa.
 

Functions

template<typename DataType >
__host__ __device__ DataType cu_arithmetics::epsilon ()
 epsilon for various floating point precisions.
 
template<>
__host__ __device__ float cu_arithmetics::epsilon< float > ()
 epsilon for __nv_fp8_e5m2 type, which is equal to \( 2^{-2} \) since __nv_fp8_e5m2 has 2 bits for fraction (mantissa).
 
template<>
__host__ __device__ double cu_arithmetics::epsilon< double > ()
 epsilon for float type, which is equal to \( 2^{-52} \) since float has 52 bits for fraction (mantissa).