Skip to content

Commit 040d81b

Browse files
committed
retain pi_device when reusing sub-device
Signed-off-by: Byoungro So <[email protected]>
1 parent 74a98d1 commit 040d81b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,8 @@ pi_result piDevicePartition(pi_device Device,
18091809
if (OutDevices && NumDevices <= Device->SubDevices.size()) {
18101810
for (uint32_t I = 0; I < NumDevices; I++) {
18111811
OutDevices[I] = Device->SubDevices[I];
1812+
// reusing the same pi_device needs to increment the reference count
1813+
piDeviceRetain(OutDevices[I]);
18121814
}
18131815
if (OutNumDevices)
18141816
*OutNumDevices = NumDevices;

0 commit comments

Comments
 (0)