@@ -280,44 +280,46 @@ std::vector<int> platform_impl::filterDeviceFilter(
280
280
// Next, match the device_type entry
281
281
if (FilterDevType == info::device_type::all) {
282
282
// Last, match the device_num entry
283
- if (!Filter.DeviceNum || DeviceNum == Filter.DeviceNum .value ()) {
284
- if constexpr (is_ods_target) { // dealing with ODS filters
285
- if (!Blacklist[DeviceNum]) { // ensure it is not blacklisted
286
- if (!Filter.IsNegativeTarget ) { // is filter positive?
287
- PiDevices[InsertIDx++] = Device;
288
- original_indices.push_back (DeviceNum);
289
- } else {
290
- // Filter is negative and the device matches the filter so
291
- // blacklist the device.
292
- Blacklist[DeviceNum] = true ;
293
- }
283
+ if (Filter.DeviceNum && DeviceNum != Filter.DeviceNum .value ())
284
+ continue ;
285
+
286
+ if constexpr (is_ods_target) { // dealing with ODS filters
287
+ if (!Blacklist[DeviceNum]) { // ensure it is not blacklisted
288
+ if (!Filter.IsNegativeTarget ) { // is filter positive?
289
+ PiDevices[InsertIDx++] = Device;
290
+ original_indices.push_back (DeviceNum);
291
+ } else {
292
+ // Filter is negative and the device matches the filter so
293
+ // blacklist the device.
294
+ Blacklist[DeviceNum] = true ;
294
295
}
295
- } else { // dealing with SYCL_DEVICE_FILTER
296
- PiDevices[InsertIDx++] = Device;
297
- original_indices.push_back (DeviceNum);
298
296
}
299
- break ;
297
+ } else { // dealing with SYCL_DEVICE_FILTER
298
+ PiDevices[InsertIDx++] = Device;
299
+ original_indices.push_back (DeviceNum);
300
300
}
301
+ break ;
302
+ }
303
+ if (FilterDevType == DeviceType) {
304
+ if (Filter.DeviceNum && DeviceNum != Filter.DeviceNum .value ())
305
+ continue ;
301
306
302
- } else if (FilterDevType == DeviceType) {
303
- if (!Filter.DeviceNum || DeviceNum == Filter.DeviceNum .value ()) {
304
- if constexpr (is_ods_target) {
305
- if (!Blacklist[DeviceNum]) {
306
- if (!Filter.IsNegativeTarget ) {
307
- PiDevices[InsertIDx++] = Device;
308
- original_indices.push_back (DeviceNum);
309
- } else {
310
- // Filter is negative and the device matches the filter so
311
- // blacklist the device.
312
- Blacklist[DeviceNum] = true ;
313
- }
307
+ if constexpr (is_ods_target) {
308
+ if (!Blacklist[DeviceNum]) {
309
+ if (!Filter.IsNegativeTarget ) {
310
+ PiDevices[InsertIDx++] = Device;
311
+ original_indices.push_back (DeviceNum);
312
+ } else {
313
+ // Filter is negative and the device matches the filter so
314
+ // blacklist the device.
315
+ Blacklist[DeviceNum] = true ;
314
316
}
315
- } else {
316
- PiDevices[InsertIDx++] = Device;
317
- original_indices.push_back (DeviceNum);
318
317
}
319
- break ;
318
+ } else {
319
+ PiDevices[InsertIDx++] = Device;
320
+ original_indices.push_back (DeviceNum);
320
321
}
322
+ break ;
321
323
}
322
324
}
323
325
DeviceNum++;
0 commit comments