KhronosGroup / KhronosGroup/OpenCL-CTS
Question about copysign testcase in math_brute_froce
- Dominant language
- C++
- Stars
- 232
- Forks
- 235
- Avg merge
- 8d 7h
- Merged PRs (30d)
- 18
Description
Hi all,
I’m running OpenCL-CTS testcases using a RISCV simulator as host and device. I encountered an error in copysign test in “test_conformance/math_brute_froce”.
I checked the answer from device and figured it was actually correct. The problem is on the reference answer. I traced the code and found that the error is caused by the reference_copysignl.
```
long double reference_copysignl( long double x, long double y )
{
// We hope that the long double to double conversion proceeds with sign fidelity,
// even for zeros and NaNs
union{ double d; cl_ulong u;}u; u.d = (double) y;
x = reference_fabsl(x);
if( u.u >> 63 )
x = -x;
return x;
}
```
I think the error result from copying the sign of NaN value. The comment in the function states that it will only work if the sign is carried over to the converted value even for zeros and NaNs. However, I think there is only one representation of NaN in my simulator while converting long double type to double which means there is no sign fidelity during the conversion for NaNs.
Can I just ignore this error or there is any option I can use to make my simulator pass this testcase.
Thanks!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in test_conformance/math_brute_froce and inspect reference_copysignl, then compare its expected result with the simulator's handling of NaN sign conversion. Done means establishing whether the reference testcase or the simulator behavior is responsible for the reported mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100