Function: reset_event
Applicable Products
- Ascend 950PR&950DT products: Supported
- Atlas A3 products: Supported
- Atlas A2 products: Supported
- Atlas 200I/500 A2 inference products: Supported
- Atlas inference products: Supported
- Atlas training products: Supported
Function
Resets an event. Resets the event only after all tasks in the stream are completely executed. This API is asynchronous.
For stream synchronization, this API is called after an acl.rt.stream_wait_event call.
Prototype
-
C Prototype
aclError aclrtResetEvent(aclrtEvent event, aclrtStream stream) -
Python Function
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. For stream synchronization, for example, if Stream2 waits for Stream1, set this parameter to Stream2. |
Return Values
| Return Value | Description |
|---|---|
| ret | Int, error code. If 0 is returned, the operation is successful. If other values are returned, the operation fails. |
Constraints
Only the events created by acl.rt.creat_event_with_flag with the ACL_EVENT_SYNC flag 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.
