Skip to content

Commit d97d989

Browse files
Hoist common early continues
1 parent f951846 commit d97d989

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

sycl/source/detail/platform_impl.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,13 @@ std::vector<int> platform_impl::filterDeviceFilter(
277277
continue;
278278
info::device_type FilterDevType =
279279
Filter.DeviceType.value_or(info::device_type::all);
280+
281+
// match the device_num entry
282+
if (Filter.DeviceNum && DeviceNum != Filter.DeviceNum.value())
283+
continue;
284+
280285
// Next, match the device_type entry
281286
if (FilterDevType == info::device_type::all) {
282-
// Last, match the device_num entry
283-
if (Filter.DeviceNum && DeviceNum != Filter.DeviceNum.value())
284-
continue;
285-
286287
if constexpr (is_ods_target) { // dealing with ODS filters
287288
if (!Blacklist[DeviceNum]) { // ensure it is not blacklisted
288289
if (!Filter.IsNegativeTarget) { // is filter positive?
@@ -301,9 +302,6 @@ std::vector<int> platform_impl::filterDeviceFilter(
301302
break;
302303
}
303304
if (FilterDevType == DeviceType) {
304-
if (Filter.DeviceNum && DeviceNum != Filter.DeviceNum.value())
305-
continue;
306-
307305
if constexpr (is_ods_target) {
308306
if (!Blacklist[DeviceNum]) {
309307
if (!Filter.IsNegativeTarget) {

0 commit comments

Comments
 (0)