Epsilon in CUDA kernel

Been working on a numerical solver. When dealing with values close to machine epsilon (around 1.19e-7 for float32), noticing some inconsistency in results between CPU and GPU runs.

Just to clarify, epsilon and latin open E are 2 different symbols, though they look exactly same. Latin open e is also called reversed 3. But here, I’m talking about the epsilon.

Is there a way to handle comparisons near epsilon in CUDA kernel? Been using FLT_EPSILON from <float.h> but wondering if theres a pattern other use. (when dealing with denormals or flush-to-zero mode)

TIA!

Could you be more specific as to the inconsistencies? FLT_EPSILON is far from being a subnormal number, so that in itself shouldn’t cause issues.

Have you deactivated --fast_math=true, --ftz=true, --prec-div=false, --prec-sqrt=false, --fmad=true?