How to best check whether a half-precision value is finite, in CUDA?
07:49 07 May 2026

CUDA offers a (NVIDIA GPU) function for checking whether a half-precision value is infinite: __hisinf(). But - there is no corresponding __hisfinite() function (like int isfinite(double x), which does exist).

How would I best implement an bool isfinite(half x) function? Specifically, should I perform bit operations to ensure the exponent component is not all-ones, or is there a better approach?

floating-point cuda half-precision-float