-
Notifications
You must be signed in to change notification settings - Fork 738
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
[SYCL] Implement get_backend_info() #12906
Conversation
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
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.
Tests are missing. We should at least add some to sycl/test
which would check that we can compile code using new API and/or there could be tests in sycl/test-e2e
which would check that the new API behaves as expected
…-coded return types with ones associated with traits Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Fixed! Added the new e2e test case sycl/test-e2e/backend_info.cpp for this purpose. |
…nst non-OpenCL backends Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
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.
One known concern: it seems that sycl::platform, sycl::context and sycl::kernel may have multiple associated device, but according to the spec the return type for sycl::xxx::get_backend_infoinfo::device::version() should be std::string (i.e. a single device version) so I'm just returning the version of the first associated device in the list. Is this OK?
info::device::version
is the information descriptor of the sycl::device
. Do we have to actually support it for all other classes sycl::platform
, sycl::context
and sycl::kernel
? Maybe it's enough to support it only for sycl::device.
@againull Hi! Thanks for reviewing the code. And about the question you have, the thing is that the SYCL specification for (all variations of) get_backend_info() says "The type alias Param::return_type must be defined in accordance with the SYCL backend specification.", while the SYCL backend spec (for OpenCL, link here https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_backend_specific_information_descriptors) suggest that both info::platform::version and info::device::version are backend-specific info descriptors. I think this means that we should allow the user to query them using all variations of get_backend_info(), including the ones you mentioned such as sycl::context::get_backend_info(). |
In such case probably we can return the version of the default/selected device. But maybe it worth discussing with language group. |
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Implementing the get_backend_info() functions for our SYCL implementation based on SYCL 2020 spec. (Link here: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html you may search for "get_backend_info()" there for the spec for these functions)
There're six groups of variations for this function, namely
sycl::platform::get_backend_info()
,sycl::context::get_backend_info()
,sycl::device::get_backend_info()
,sycl::queue::get_backend_info()
,sycl::eventv::get_backend_info()
, andsycl::kernel::get_backend_info()
One known concern: it seems that sycl::platform, sycl::context and sycl::kernel may have multiple associated device, but according to the spec the return type for
sycl::xxx::get_backend_info<info::device::version>()
should be std::string (i.e. a single device version) so I'm just returning the version of the first associated device in the list. Is this OK?