Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Fix host device check #234

Merged
merged 2 commits into from
Apr 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions SYCL/FilterSelector/select_device_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ int main() {
cout << "Expectedly, cpu device is not found." << std::endl;
}
}
// HOST device is always available regardless of SYCL_DEVICE_FILTER
{
host_selector hs;
device d = hs.select_device();
cout << "HOST device is found: " << d.is_host() << std::endl;
try {
device d = hs.select_device();
cerr << "HOST device is found in error: " << d.is_host() << std::endl;
return -1;
} catch (...) {
cout << "Expectedly, HOST device is not found." << std::endl;
}
}
{
accelerator_selector as;
Expand Down