aclrtSetOpWaitTimeout

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

Sets the timeout interval for waiting for the completion of an event.

If this API is not called, no timeout occurs by default. If this API is called multiple times in a process, the interval set in the last call applies.

Prototype

1
aclError aclrtSetOpWaitTimeout(uint32_t timeout)

Parameters

Parameter

Input/Output

Description

timeout

Input

Timeout interval, in seconds.

The value 0 indicates no timeout.

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.