aclrtStreamWaitEvent

Applicable Products

Product

Supported

Ascend 950PR / Ascend 950DT

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Function

Blocks a specified stream or multiple streams until the specified event is complete. This is an asynchronous API.

All subsequent tasks submitted to the stream can be executed only after all tasks captured by the event are complete. For more details, see aclrtRecordEvent.

Prototype

1
aclError aclrtStreamWaitEvent(aclrtStream stream, aclrtEvent event)

Parameters

Parameter

Input/Output

Description

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.

event

Input

Event to wait on. For details about the type definition, see aclrtEvent.

Returns

0 on success; otherwise, failure. For details, see aclError.

Restrictions

After initialization by calling aclInit in a process, you can call aclrtSetOpWaitTimeout to set the timeout. Tasks delivered by calling aclrtStreamWaitEvent in the process can wait within the configured timeout. If the wait time exceeds the configured timeout, an error will be returned after a synchronization API (for example, aclrtSynchronizeStream) is called.

API Call Example

For the API call example, see Event Waiting.