-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Make host device and host platform always available, even when forcin… #992
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
…g a device type with SYCL_DEVICE_TYPE Signed-off-by: James Brodman <[email protected]>
Please add LIT test following example in the PR description. |
Signed-off-by: James Brodman <[email protected]>
Signed-off-by: James Brodman <[email protected]>
Added a test for host device and another for host platform. |
Signed-off-by: James Brodman <[email protected]>
if (plt.is_host()) { | ||
vector_class<device> host_device( | ||
plt.get_devices(info::device_type::host)); | ||
if (!host_device.empty()) |
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.
Isn't this if redundant? I think insert will correctly handle case when begin iterator == end iterator.
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 - get_devices is supposed to only return devices of the passed type, hence the special casing for host devices.
Signed-off-by: James Brodman <[email protected]>
fd977d2
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!
👍 |
…g a device type with SYCL_DEVICE_TYPE
The current behavior violates the SYCL Specification. The host device/platform should always be available.
int main() {
device myHost(host_selector{});
return 0;
}
That fails when run with SYCL_DEVICE_TYPE=CPU/GPU/ACC and it shouldn't.
Signed-off-by: James Brodman [email protected]