-
Notifications
You must be signed in to change notification settings - Fork 199
Add ldexp math built-in #962
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
Can you elaborate on what your concern is here? You have the two overloads once for genint and once for int as required by the spec. Is it because there might be a collision between the explicit int overload and the genint overload in case it's called with int argument? |
Yeah, if we template the second argument then, e.g. on calls where both the floating-point and the integer arguments are scalars, there’d a collision and the compiler would complain of ambiguity. Like this, that risk doesn’t exist because the compiler will always choose the most specialised template. It wasn’t so much a concern, but rather me pointing out a design choice, so you could double check it. :) You are right this covers the spec, that’s no accident. :) But I’ve noticed that sometimes we’re a bit more lenient and allow generic integral types, not just int. |
Do you think it would make sense to also add a test case here? |
1e8e7a0
to
8086b08
Compare
Done. |
Seems like there is an issue with vector types? https://github.com/OpenSYCL/OpenSYCL/actions/runs/4872132257/jobs/8689939849?pr=962 |
0e86555
to
ff62c56
Compare
Co-authored-by: Aksel Alpay <[email protected]>
Thanks, yes, this was caused by 20043bd and I adopted the suggested change there of using an explicit cast. |
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, thanks! :)
Hi @illuhad,
I think the only hard decision I had to make here has to do with the definition of
HIPSYCL_BUILTIN_GENERATOR_BINARY_T_INT
.I did not template the second argument and instead explicitly locked it to
int
to avoid collision/ambiguity withHIPSYCL_BUILTIN_GENERATOR_BINARY_T_GENINT
.Let me know if you have something better in mind. :)
Cheers,
Nuno