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

Commit e1607bf

Browse files
authored
[SYCL] Fix host device check (#234)
Signed-off-by: Byoungro So <[email protected]>
1 parent 62b573e commit e1607bf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

SYCL/FilterSelector/select_device_cuda.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,15 @@ int main() {
4747
cout << "Expectedly, cpu device is not found." << std::endl;
4848
}
4949
}
50-
// HOST device is always available regardless of SYCL_DEVICE_FILTER
5150
{
5251
host_selector hs;
53-
device d = hs.select_device();
54-
cout << "HOST device is found: " << d.is_host() << std::endl;
52+
try {
53+
device d = hs.select_device();
54+
cerr << "HOST device is found in error: " << d.is_host() << std::endl;
55+
return -1;
56+
} catch (...) {
57+
cout << "Expectedly, HOST device is not found." << std::endl;
58+
}
5559
}
5660
{
5761
accelerator_selector as;

0 commit comments

Comments
 (0)