KhronosGroup / OpenCL-CTS

The OpenCL Conformance Tests
Apache License 2.0
178 stars 187 forks source link

Disable implicit conversion of copysign arguments. #1970

Closed hvdijk closed 1 week ago

hvdijk commented 1 month ago

In binary_float.cpp, copysign is special cased. All the reference functions there take double arguments, except for reference_copysign which takes float. This commit copies that approach to special case copysign in binary_double.cpp as well: all the reference functions there take long double arguments, but this commit changes reference_copysignl to take double. The rationale for this in binary_float applies equally to binary_double: conversions of NAN are not required to preserve its sign bit. On architectures where conversion of NAN resets the sign bit, copysign fp64 would return incorrect reference results.

hvdijk commented 2 weeks ago

Rebased to resolve the conflict with the fp16 merge.

bashbaug commented 1 week ago

Merging as discussed in the June 25th teleconference.