Skip to content

Commit 54cd00d

Browse files
authored
[SYCL] Return Success in USM Mem Free if L0 driver is already released (#11075)
Signed-off-by: Spruit, Neil R <[email protected]>
1 parent eca0bf3 commit 54cd00d

File tree

1 file changed

+7
-2
lines changed
  • sycl/plugins/unified_runtime/ur/adapters/level_zero

1 file changed

+7
-2
lines changed

sycl/plugins/unified_runtime/ur/adapters/level_zero/usm.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMGetMemAllocInfo(
607607
}
608608

609609
static ur_result_t USMFreeImpl(ur_context_handle_t Context, void *Ptr) {
610-
ZE2UR_CALL(zeMemFree, (Context->ZeContext, Ptr));
611-
return UR_RESULT_SUCCESS;
610+
auto ZeResult = ZE_CALL_NOCHECK(zeMemFree, (Context->ZeContext, Ptr));
611+
// Handle When the driver is already released
612+
if (ZeResult == ZE_RESULT_ERROR_UNINITIALIZED) {
613+
return UR_RESULT_SUCCESS;
614+
} else {
615+
return ze2urResult(ZeResult);
616+
}
612617
}
613618

614619
static ur_result_t USMQueryPageSize(ur_context_handle_t Context, void *Ptr,

0 commit comments

Comments
 (0)