Closed kgryte closed 4 months ago
I am a bit concerned about mentioning subnormal here. In CuPy we always set the compiler flag -ftz=true
which would flush all denormals to zero. This helps significantly with floating point operations on GPU. Would this PR imply that we can no longer do this?
Q: I forgot what conclusion we had on this API, @kgryte do we plan to target v2023?
@leofang I've added a note concerning subnormal behavior and the fact that actual hardware support may vary. Does this allay your concerns?
Great, looks like everyone is happy now - let's hit the green button. Thanks @kgryte & reviewers!
This PR
+-infinity
, the result is infinity, regardless of whether the other operand isNaN
. Intentionally, this deviates from a naivesqrt(x**2 + y**2)
implementation.sqrt
in requiring floating-point data types. The guidance uses "should", not "must", to allow implementations to support non-floating-point data types. The reason for the floating-point restriction is that the output data type must be a real-valued floating-point data type and promoting from, e.g., an integral to a floating-point data type is implementation-defined. For defined promotion semantics, a consumer should provide input arrays having floating-point data types.