-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Added support for get_backend() API. #1879
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
This API returns the backend associated with a platform. A LIT test has also been added. Signed-off-by: Gail Lyons <[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.
Just a few comments :-)
<< plt.get_info<info::platform::name>() << ": " | ||
<< plt.get_info<info::platform::version>(); | ||
if (!plt.is_host()) { | ||
std::cout << " BE: " << get_string(plt.get_backend()); |
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.
If this is related somehow to the SYCL 2020 proposal, the host is also a backend.
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.
It is not. The L0 PI knows the BE, and it returning it.
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.
Done.
<< dev.get_info<info::device::name>() | ||
<< " (" << dev.get_info<info::device::driver_version>() << "): " | ||
<< dev.get_info<info::device::version>() | ||
<< std::endl; |
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.
This is not really testing anything, but you could try to match testing for "OpenCL" with returning at least the "OpenCL" backend.
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.
It checks for "opencl", which is the what the test prints for OpenCL backend.
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.
Refactored the test.
A LIT test has also been added. Incorporated code review comments. Signed-off-by: Gail Lyons <[email protected]>
Signed-off-by: Gail Lyons <[email protected]>
Signed-off-by: Gail Lyons <[email protected]>
default: | ||
Out << std::string("unknown"); |
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'm afraid, this can trigger -Wcovered-switch-default
warning on newer compilers as you've already covered all of enum values:
enum class backend : char { host, opencl, level0, cuda }; |
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.
Done.
Signed-off-by: Gail Lyons <[email protected]>
Windows build failed with error:
Perhaps, adding will fix that. |
Signed-off-by: Gail Lyons <[email protected]>
Signed-off-by: Gail Lyons <[email protected]>
This API returns the backend associated with a platform.
A LIT test has also been added.
Signed-off-by: Gail Lyons [email protected]