imate
C++/CUDA Reference
Loading...
Searching...
No Matches
_cu_is_equal.h File Reference
#include <cmath>
#include <limits>
#include "../_cu_definitions/cu_types.h"
#include <cassert>
Include dependency graph for _cu_is_equal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

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 >
bool cu_arithmetics::is_equal (DataType x, DataType y)
 Check if two floating point numbers are equal within a tolerance.
 
template<>
bool cu_arithmetics::is_equal (float x, float y)
 Check if two floating point numbers are equal within a tolerance for __nv_fp8_e5m2 type.
 
template<>
bool cu_arithmetics::is_equal (double x, double y)
 Check if two floating point numbers are equal within a tolerance for double type.