aclrtSynchronizeStreamWithTimeout

Description

Blocks app running until all tasks in the specified stream are complete. This API is enhanced based on aclrtSynchronizeStream and allows you to set the timeout interval for your app.

Prototype

aclError aclrtSynchronizeStreamWithTimeout(aclrtStream stream, int32_t timeout)

Parameters

Parameter

Input/Output

Description

stream

Input

Stream.

timeout

Input

API timeout interval.

The options are as follows:

  • -1: waits forever, which functions equivalently as aclrtSynchronizeStream.
  • > 0: specific timeout interval, in ms.

Returns

The value 0 indicates success, and other values indicate failure. For details, see aclError.