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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sycl/source/detail/builtins_relational.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ __SYCL_EXPORT rel_res_t sycl_host_SignBitSet(s::cl_float x) __NOEXC {
__SYCL_EXPORT rel_res_t sycl_host_SignBitSet(s::cl_double x) __NOEXC {
return std::signbit(x);
}
__SYCL_EXPORT s::cl_long __vSignBitSet(s::cl_double x) __NOEXC {
return -static_cast<s::cl_long>(std::signbit(x));
}
Comment on lines +461 to +463
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.

__SYCL_EXPORT s::cl_int __vSignBitSet(s::cl_float x) __NOEXC {
#ifdef __GNUC__
// GCC 11.3 and later is stumbling with an internal compiler error
Expand All @@ -469,9 +472,6 @@ __SYCL_EXPORT s::cl_int __vSignBitSet(s::cl_float x) __NOEXC {
return -static_cast<s::cl_int>(std::signbit(x));
#endif
}
__SYCL_EXPORT s::cl_long __vSignBitSet(s::cl_double x) __NOEXC {
return -static_cast<s::cl_long>(std::signbit(x));
}
__SYCL_EXPORT rel_res_t sycl_host_SignBitSet(s::cl_half x) __NOEXC {
return std::signbit(d::cast_if_host_half(x));
}
Expand Down