aclrtResetEvent

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Description

Resets an event to its initial state so that the event object can be reused. This API is asynchronous.

For stream synchronization, the event is reset after the aclrtStreamWaitEvent API is called.

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.

In multiple stream synchronization scenarios, for example, if a task in Stream2 depends on a task in Stream1, set this parameter to Stream2.

Returns

0 on success; else, 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.