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 until the specified event is complete. This is an asynchronous API.

This is an encapsulated API that applies only to C++ programs. It internally calls the C API aclrtStreamWaitEventWithTimeout.

Prototype

1
aclError aclrtStreamWaitEvent(aclrtStream stream, aclrtEvent event, int32_t timeout)

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.

timeout

Input

Timeout interval.

The value can be:

  • 0: permanent waiting
  • > 0: specific timeout interval, in seconds

Returns

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