Function: query_event_status

C Prototype

aclError aclrtQueryEventStatus(aclrtEvent event, aclrtEventRecordedStatus *status)

Python Function

status, ret = acl.rt.query_event_status(event)

Function Usage

Queries the execution status of all tasks captured in an event. For more details, see acl.rt.record_event.

Input Description

event: int, pointer address of the event object to be queried.

Return Value

status: int, pointer address of the event status.

  • ACL_EVENT_RECORDED_STATUS_NOT_READY = 0: The event is not recorded in the stream, or the event recorded in the stream is not executed or fails to be executed.
  • ACL_EVENT_RECORDED_STATUS_COMPLETE = 1: The event recorded in the stream is successfully executed.

ret: int, error code.

Restrictions

If acl.rt.record_event and acl.rt.query_event_status are called on different threads, the execution time of the two APIs may be out of order. As a result, the completion status of the queried event object does not meet the expectation.