Skip to content

Commit c4acc54

Browse files
author
Diptorup Deb
committed
Merge branch 'feature/backend_specific_queues_v2' of github.com:diptorupd/dpctl into feature/backend_specific_queues_v2
2 parents 772b97d + 7629342 commit c4acc54

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

backends/source/dppl_sycl_queue_manager.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,24 @@ class QMgrHelper
6565
if (Devices.size() == 1) {
6666
auto d = Devices[0];
6767
auto devty = d.get_info<info::device::device_type>();
68-
auto Ctx = context(d);
6968
if(devty == DTy && be == BE) {
70-
queues->emplace_back(Ctx, d);
69+
auto Ctx = context(d);
70+
queues->emplace_back(Ctx, d);
7171
break;
7272
}
7373
}
7474
else {
75-
auto Ctx = context(Devices);
76-
for(auto &d : Devices) {
75+
vector_class<device> SelectedDevices;
76+
for(auto &d : Devices) {
7777
auto devty = d.get_info<info::device::device_type>();
78-
if(devty == DTy && be == BE) {
79-
queues->emplace_back(Ctx, d);
80-
break;
81-
}
82-
}
78+
if(devty == DTy && be == BE)
79+
SelectedDevices.push_back(d);
80+
}
81+
if (SelectedDevices.size() > 0) {
82+
auto Ctx = context(SelectedDevices);
83+
auto d = SelectedDevices[0];
84+
queues->emplace_back(Ctx, d);
85+
}
8386
}
8487
}
8588
return queues;

0 commit comments

Comments
 (0)