aclrtResetEvent
Applicable Products
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function
Resets an event to its initial state so that the event can be reused. This is an asynchronous API.
For stream synchronization, this API is called after an aclrtStreamWaitEvent call.
Prototype
1 | aclError aclrtResetEvent(aclrtEvent event, aclrtStream stream) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
event |
Input |
Event to reset. For details about the type definition, see aclrtEvent. |
stream |
Input |
Stream. For details about the type definition, see aclrtStream. For stream synchronization, for example, Stream2 waits for Stream1, set this parameter to Stream2. |
Returns
0 on success; otherwise, failure. For details, see aclError.
Restrictions
Only the events created by the aclrtCreateEventWithFlag 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 the aclrtResetEvent API is called after the aclrtStreamWaitEvent API in Stream2, the event will be reset. As a result, the aclrtStreamWaitEvent API in Stream3 will fail.
