-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] create PI (Plugin Interface) layer and redirect there platform/device stuff. #222
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
Copying here major design comments from Ronan from previous pull request. @smaslov-intel , please, address them. +++++++++++++++++++ |
@keryell: We do want to keep the core pi.h interfaces to be C-only for greater interoperability with non-C++ environments, which is envisioned to be needed. The integration of pi.h into SYCL is done with C++ and all the good modern stuff. |
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.
A few typos.
I am understanding better what you are doing, even if I do not understand the internal reason you might have to rename "cl" to "pi_".
It might be clearer in the middle/long-term future to split the ...impl.cpp
into several files, to have for example the host
backend in some directories or files, the OpenCL in some others, the PI in some others, etc.
Thanks for pointing those out! I really feel like I need to get a better source editor, not sure that one exist though ;)
For the most part it is to decouple from OpenCL. The core of PI is still OpenCL as you can see, but it only includes a subset of OpenCL, and it also extends it with what OpenCL does not have. This, we thought, deserves a new name and also the whole SYCL is moving to untie from OpenCL, making the later just one of the possible back-ends. |
I do not know what you are using.
That makes sense. |
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.
I think description missing that:
- CNRI was removed (or replaced by PI)
platform
class implementation is refactored - host andopencl
orpi
implementations are merged into single file.
@@ -8,8 +8,9 @@ | |||
|
|||
#pragma once | |||
#include <CL/sycl/detail/common.hpp> | |||
#include <CL/sycl/detail/platform_info.hpp> | |||
#include <CL/sycl/detail/force_device.hpp> |
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.
Why did you move force_device.hpp
to the interface headers?
This is supposed to be an implementation details of SYCL runtime library only.
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.
I moved them into "detail" headers, which seemed to be consistent with the overall structure. If you inisist, I can copy back to the sources, but prefer doing so in a separate subsequent change-set. Please let me know.
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.
I think the right place for this header is source directory because it doesn't declare public interface, so SYCL library users are not supposed to include this header fie.
It must be included into sycl/source/*
files only.
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.
Nothing in the "sycl/detail" is supposed to be included directly by SYCL users, and this one is not an exception to this. If this was really the goal (not to let people see the detail) we could have gone too much further in separation, but is is the goal?
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 reason why we have "sycl/detail" sub-directory in public interface is because they contain implementation of template classes/methods, which can't be moved to the source directory, but it's not the case with force_device.hpp
.
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, we can "hide" this one and many more from sycl/detail if we wanted to.
There should be some macro defining the version of the PI interface used. I am assuming incremental changes to the API will happen and that people need to ensure the right version of the PI API is being used, or that some new API entries could be added in future versions. Simply adding |
What about using a versioning like TeX? |
@smaslov-intel, please, rebase the patch to the tip of the branch. |
18edc1d
to
7142bdc
Compare
…/device stuff. Signed-off-by: Sergey V Maslov <[email protected]>
Signed-off-by: Sergey V Maslov <[email protected]>
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.
Just a few typos.
Signed-off-by: Sergey V Maslov <[email protected]>
This incremental change on top of PI infrastructure being added in #222. It turns all of SYCL RT OpenCL calls into PI. For the time being PI implementation is still directly the OpenCL one (in pi_opencl.*), and the next step will be to run OpenCL through the PI. Signed-off-by: Sergey V Maslov <[email protected]>
Bring spirv.hpp in sync with ddf3230 ("Merge pull request intel#222 from kpet/github-actions", 2021-06-30) from github.com/KhronosGroup/SPIRV-Headers . This brings the SPV_KHR_bit_instructions and SPV_INTEL_debug_module extension enum values. Drop the internal enum value of the latter. Original commit: KhronosGroup/SPIRV-LLVM-Translator@da11807
This might look like a lot of changes but the vast majority of it is just renaming and moving (due to file renaming). The key points are:
Signed-off-by: Sergey V Maslov [email protected]