Skip to content

Commit b217bc5

Browse files
authored
[SYCL] Change priority of devices in default_selector (#1264)
Make the override always win Signed-off-by: James Brodman <james.brodman@intel.com>
1 parent ee21d66 commit b217bc5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sycl/source/device_selector.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#include <CL/sycl/detail/force_device.hpp>
910
#include <CL/sycl/device.hpp>
1011
#include <CL/sycl/device_selector.hpp>
1112
#include <CL/sycl/exception.hpp>
@@ -54,12 +55,13 @@ int default_selector::operator()(const device &dev) const {
5455
}
5556
}
5657

58+
// override always wins
59+
if (dev.get_info<info::device::device_type>() == detail::get_forced_type())
60+
return 1000;
61+
5762
if (dev.is_gpu())
5863
return 500;
5964

60-
if (dev.is_accelerator())
61-
return 400;
62-
6365
if (dev.is_cpu())
6466
return 300;
6567

0 commit comments

Comments
 (0)