Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
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.
1 | aclError aclrtResetEvent(aclrtEvent event, aclrtStream stream) |
1 | ret = acl.rt.reset_event(event, stream) |
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, Stream2 waits for Stream1, set this parameter to Stream2. |
Return Value |
Description |
|---|---|
ret |
Int, error code. 0 on success; else, failure. |
Only the events created by the acl.rt.creat_event_with_flag API and flagged with ACL_EVENT_SYNC 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.
