-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][libdevice] Keep sign bit of result for std::sin(-0) #17440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi, @KornevNikita |
For input '-0', __spirv_ocl_sin returns +0 for float and returns -0 for double, although no definition exists in standard for -0 input, MSVC complex math implementation does depend on this, discarding the signbit for sin(-0) will lead to some corner case failures in exp(std::complex<float>) e2e tests. This patch is a workaround for the issue.
@jinge90 I've cherry-picked your commit to my PR, waiting for the pre-commit results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but libdevice should be reviewed by another team, not SYCL RT
There is and it should return -0, the driver has a bug. See https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_C.html#edge-case-behavior, and C99 F.9.1.6 states |
@KseniyaTikhomirova, I disagree with this statement. |
Hi, @Naghasan |
Signed-off-by: jinge90 <[email protected]>
LGTM, thanks! |
Hi, @intel/llvm-gatekeepers |
The issue was fixed by #17440 --------- Co-authored-by: jinge90 <[email protected]>
For input '-0', __spirv_ocl_sin returns +0 for float and returns -0 for double, MSVC complex math implementation does depend on this, discarding the signbit for sin(-0) will lead to some corner case failures in exp(std::complex) e2e tests. This patch is a workaround for the issue.