Function: reset_event

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Description

Resets an event. Resets the event only after all tasks in the stream are completely executed. This API is asynchronous.

Prototype

  • C Prototype
    1
    aclError aclrtResetEvent(aclrtEvent event, aclrtStream stream)
    
  • Python Function
    1
    ret = acl.rt.reset_event(event, stream)
    

Parameters

Parameter

Description

event

Int, pointer address of the event object to be reset.

stream

Int, pointer address of the stream object where the event is located.

Return Value

Return Value

Description

ret

Int, error code. 0 on success; else, failure.

Restrictions

Only events with the ACL_EVENT_SYNC flag created by the acl.rt.create_event_with_flag API can be reset.

Note: If tasks in multiple streams need to wait for the same event, calling this API to reset the event is not recommended. As shown in the figure, if aclrtResetEvent is called after aclrtStreamWaitEvent in stream 2, the event will be reset. As a result, aclrtStreamWaitEvent in stream 3 will fail.