-
Notifications
You must be signed in to change notification settings - Fork 772
[SYCL] Isolate OpenCL types and enums #6261
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
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.
sycl/plugins/esimd_emulator/pi_esimd_emulator.cpp LGTM
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.
Thanks a lot for doing this clean-up!
Finally! 🥳 🎉
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.
Overall I think the changes look good. I would however like if we could have some comments for the various enums specifying where the enum values come from. That should hopefully help prevent people from adding values in the future that conflict with missing and future OpenCL enum values.
Co-authored-by: Alexey Bader <[email protected]>
I agree that it might be more dangerous to tinker with the enums now, would you be ok with a note in the file, something along the lines of this: https://github.com/jchlanda/llvm/blob/jakub/opencl_headers/sycl/include/CL/sycl/detail/pi.h#L59 |
I really think we should completely untie PI enums from OpenCL, not only drop use of OpenCL names, see #6261 (comment) |
I don't share that view, there is no hiding away from the fact that PI's interface is a direct copy of OpenCL's (albeit extended in places), coming up with a different values for effectively exactly the same enums (semantically) only to translate them back to OpenCL (even in one backend) doesn't seem like a task worth doing. |
This is not to "hide away" the fact that the PI is borrowing OpenCL model, but to:
|
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!
I understand your point now, thank you. I'm not sure if I agree though :) seems like every time OpenCL's |
/verify with intel/llvm-test-suite#1048 |
I agree there is value in this PR as it is, but please retain the comment llvm/sycl/include/CL/sycl/detail/pi.h Line 58 in c76ef5c
|
Done in: e948928 |
The failures should be addressed by intel/llvm-test-suite#1048, seems like the |
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.
Thanks for doing this!
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.
The failures should be addressed by intel/llvm-test-suite#1048, seems like the
/verify with
didn't do the trick.
It did - I see the tests pass.
@@ -420,6 +423,16 @@ template <class To, class From> inline To cast(From value) { | |||
return (To)(value); | |||
} | |||
|
|||
template <class To, class From> inline To cast(std::vector<From> value) { |
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.
@jchlanda, post-commit failed with:
/home/runner/work/llvm/llvm/src/sycl/include/CL/sycl/detail/pi.hpp:426:66: error: unused parameter 'value' [-Werror,-Wunused-parameter]
template <class To, class From> inline To cast(std::vector<From> value) {
Could you fix this, please?
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.
My bad sorry, should be fixed in: #6276
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.
No problem. Thanks for contributions!
This PR populates PI enums and typedefs with values taken from the OpenCL equivalents; it also makes sure that all uses of the system OpenCL header
cl.h
are channelled throughinclude/CL/sycl/detail/cl.h
. Finally,pi.h
andpi.hpp
would only tap into the systemcl.h
for OpenCL backend (guarded byPI_OPENCL_AVAILABLE
compiler definition), which allowed a removal of all OpenCL types and enums from other PI backends.Fixes: #1265