Skip to content

Commit fdd75f0

Browse files
nrspruitcperkinsintel
authored andcommitted
Fix l0 teardown and sycl windows teardown (#17869)
Signed-off-by: Neil R. Spruit <[email protected]> Co-authored-by: Chris Perkins <[email protected]>
1 parent 5db30f7 commit fdd75f0

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

source/adapters/level_zero/event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ ur_result_t urEventGetInfo(
496496
auto HostVisibleEvent = Event->HostVisibleEvent;
497497
if (Event->Completed) {
498498
Result = UR_EVENT_STATUS_COMPLETE;
499-
} else if (HostVisibleEvent) {
499+
} else if (HostVisibleEvent && checkL0LoaderTeardown()) {
500500
ze_result_t ZeResult;
501501
ZeResult =
502502
ZE_CALL_NOCHECK(zeEventQueryStatus, (HostVisibleEvent->ZeEvent));

source/adapters/level_zero/queue.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,9 @@ ur_result_t urQueueRetain(
599599
ur_result_t urQueueRelease(
600600
/// [in] handle of the queue object to release
601601
ur_queue_handle_t Queue) {
602+
if (!checkL0LoaderTeardown())
603+
return UR_RESULT_SUCCESS;
604+
602605
std::vector<ur_event_handle_t> EventListToCleanup;
603606
{
604607
std::scoped_lock<ur_shared_mutex> Lock(Queue->Mutex);

source/adapters/opencl/event.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventGetInfo(ur_event_handle_t hEvent,
181181
size_t CheckPropSize = 0;
182182
cl_int RetErr = clGetEventInfo(hEvent->CLEvent, CLEventInfo, propSize,
183183
pPropValue, &CheckPropSize);
184-
if (pPropValue && CheckPropSize != propSize) {
184+
if (pPropValue && CheckPropSize != propSize &&
185+
propName != UR_EVENT_INFO_COMMAND_EXECUTION_STATUS) {
186+
// Opencl:cpu may (incorrectly) return 0 for propSize when checking
187+
// execution status when status is CL_COMPLETE.
185188
return UR_RESULT_ERROR_INVALID_SIZE;
186189
}
187190
CL_RETURN_ON_FAILURE(RetErr);

0 commit comments

Comments
 (0)