Skip to content

[SYCL] Move called function declaration to avoid recursion #10652

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

Merged

Conversation

steffenlarsen
Copy link
Contributor

__vSignBitSet for float will in certain cases, due to a bug in GCC, convert its argument to double and call the corresponding function. To avoid recursion, the called double overload needs to be defined before the caller.

__vSignBitSet for float will in certain cases, due to a bug in GCC,
convert its argument to double and call the corresponding function. To
avoid recursion, the called double overload needs to be defined before
the caller.

Signed-off-by: Larsen, Steffen <[email protected]>
@steffenlarsen steffenlarsen requested a review from a team as a code owner August 2, 2023 09:39
@steffenlarsen steffenlarsen temporarily deployed to aws August 2, 2023 09:54 — with GitHub Actions Inactive
@steffenlarsen steffenlarsen temporarily deployed to aws August 2, 2023 10:35 — with GitHub Actions Inactive
Comment on lines +461 to +463
__SYCL_EXPORT s::cl_long __vSignBitSet(s::cl_double x) __NOEXC {
return -static_cast<s::cl_long>(std::signbit(x));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about calling std::signbit(static_cast<s::cl_double>(x) at line 470 as an alternative. Either way is fine.

@aelovikov-intel
Copy link
Contributor

I don't see how

FAIL: SYCL :: ESIMD/api/functional/operators/operator_assignment_glb_mask.cpp (443 of 1590)
...
$ "env" "ONEAPI_DEVICE_SELECTOR=ext_oneapi_level_zero:gpu" "D:\github\_work\llvm\llvm\build-e2e\ESIMD\api\functional\operators\Output\operator_assignment_glb_mask.cpp.tmp.out"
# command output:
Running on Intel(R) Iris(R) Xe Graphics
SYCL exception caught: Native API failed. Native API returns: -2 (PI_ERROR_DEVICE_NOT_AVAILABLE) -2 (PI_ERROR_DEVICE_NOT_AVAILABLE)

error: command failed with exit status: 1

can be related to this.

@aelovikov-intel aelovikov-intel merged commit 07c60c8 into intel:sycl Aug 2, 2023
mdtoguchi pushed a commit to mdtoguchi/llvm that referenced this pull request Oct 18, 2023
__vSignBitSet for float will in certain cases, due to a bug in GCC,
convert its argument to double and call the corresponding function. To
avoid recursion, the called double overload needs to be defined before
the caller.

Signed-off-by: Larsen, Steffen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants