Skip to content

Commit 2e21f59

Browse files
committed
Fix L0 picking multiple devices for default
Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 82e46f2 commit 2e21f59

File tree

1 file changed

+6
-1
lines changed
  • unified-runtime/source/adapters/level_zero

1 file changed

+6
-1
lines changed

unified-runtime/source/adapters/level_zero/device.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,13 @@ ur_result_t urDeviceGet(
155155
bool isComposite =
156156
isCombinedMode && (D->ZeDeviceProperties->flags &
157157
ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE) == 0;
158-
if (!isComposite)
158+
if (!isComposite) {
159159
MatchedDevices.push_back(D.get());
160+
// For UR_DEVICE_TYPE_DEFAULT only a single device should be returned,
161+
// so exit the loop after first proper match.
162+
if (DeviceType == UR_DEVICE_TYPE_DEFAULT)
163+
break;
164+
}
160165
}
161166
}
162167

0 commit comments

Comments
 (0)