Skip to content

Commit 2c48b35

Browse files
RossBruntonbb-ur
authored andcommitted
UR_EVENT_INFO_COMMAND_EXECUTION_STATUS (#19854)
1 parent c006425 commit 2c48b35

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

source/adapters/offload/event.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ UR_APIEXPORT ur_result_t UR_APICALL urEventGetInfo(ur_event_handle_t hEvent,
3131
return ReturnValue(hEvent->Type);
3232
case UR_EVENT_INFO_REFERENCE_COUNT:
3333
return ReturnValue(hEvent->RefCount.load());
34+
case UR_EVENT_INFO_COMMAND_EXECUTION_STATUS: {
35+
bool Complete;
36+
OL_RETURN_ON_ERR(olGetEventInfo(hEvent->OffloadEvent,
37+
OL_EVENT_INFO_IS_COMPLETE, sizeof(Complete),
38+
&Complete));
39+
if (Complete) {
40+
return ReturnValue(UR_EVENT_STATUS_COMPLETE);
41+
} else {
42+
return ReturnValue(UR_EVENT_STATUS_QUEUED);
43+
}
44+
}
3445
default:
3546
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
3647
}

0 commit comments

Comments
 (0)