aclrtSetOpWaitTimeout

Description

Sets the timeout interval for waiting for the completion of a specified event.

Restrictions

  • If this API is not called, no timeout occurs by default. If this API is called for multiple times in a process, the last configured interval is used.
  • After AscendCL is initialized by calling aclInit in a process, you can call this API to set the timeout interval. Tasks delivered by calling aclrtStreamWaitEvent in the process can wait within the configured timeout interval.

    The aclrtStreamWaitEvent API is an asynchronous API. Successful API calling only indicates that the task is successfully delivered but not executed. Therefore, if the wait time exceeds the configured timeout interval, an error is reported after the aclrtSynchronizeStream API is called.

Prototype

aclError aclrtSetOpWaitTimeout(uint32_t timeout)

Parameters

Parameter

Input/Output

Description

timeout

Input

Timeout interval, in seconds.

The value 0 indicates no timeout.

Returns

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