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