The nextafter(x, y) operation provides the nearest distinct representable floating point value to x between x and y. In CUDA these are obtained with the builtins nextafter and nextafterf.
In PyTorch, the torch.nextafter function is defined for any pair of arguments which would normally be promoted to either float32 or float64. So arguments which are both ints, bools, complex, or half-precision floats are not supported. This PR implements a binary op macro with a TypePromotionConfig that enforces that rule.
The
nextafter(x, y)
operation provides the nearest distinct representable floating point value tox
betweenx
andy
. In CUDA these are obtained with the builtinsnextafter
andnextafterf
.In PyTorch, the
torch.nextafter
function is defined for any pair of arguments which would normally be promoted to eitherfloat32
orfloat64
. So arguments which are both ints, bools, complex, or half-precision floats are not supported. This PR implements a binary op macro with aTypePromotionConfig
that enforces that rule.