aclrtStreamWaitEvent

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

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

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.