Skip to content

Commit b16c798

Browse files
Jaime A Arteaga Molinaagainull
authored andcommitted
Implement support for PI_MEM_ALLOC_DEVICE
1 parent 19ca8f5 commit b16c798

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4346,10 +4346,12 @@ pi_result piextUSMGetMemAllocInfo(pi_context Context, const void *Ptr,
43464346
return ReturnValue(MemAllocaType);
43474347
}
43484348
case PI_MEM_ALLOC_DEVICE: {
4349-
// TODO: this wants pi_device, but we didn't remember it, and cannot
4350-
// deduct from the Level Zero device.
4351-
die("piextUSMGetMemAllocInfo: PI_MEM_ALLOC_DEVICE not implemented");
4352-
break;
4349+
if (ZeDeviceHandle) {
4350+
if (Context->Device->ZeDevice == ZeDeviceHandle) {
4351+
return ReturnValue(Context->Device);
4352+
}
4353+
}
4354+
return PI_INVALID_VALUE;
43534355
}
43544356
case PI_MEM_ALLOC_BASE_PTR: {
43554357
void *Base;

0 commit comments

Comments
 (0)