Skip to content

Commit 7c311f4

Browse files
authored
Use only first device for each device type and backend (#118)
1 parent 2e25253 commit 7c311f4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

backends/source/dppl_sycl_queue_manager.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,15 @@ class QMgrHelper
7575
vector_class<device> SelectedDevices;
7676
for(auto &d : Devices) {
7777
auto devty = d.get_info<info::device::device_type>();
78-
if(devty == DTy && be == BE)
78+
if(devty == DTy && be == BE) {
7979
SelectedDevices.push_back(d);
80+
81+
// Workaround for situations when in some environments
82+
// get_devices() returns each device TWICE. Then it fails in call
83+
// for context constructor with all doubled devices.
84+
// So use only one first device.
85+
break;
86+
}
8087
}
8188
if (SelectedDevices.size() > 0) {
8289
auto Ctx = context(SelectedDevices);

0 commit comments

Comments
 (0)