Function: set_op_wait_timeout

C Prototype

aclError aclrtSetOpWaitTimeout(uint32_t timeout)

Python Function

ret = acl.rt.set_op_wait_timeout(timeout)

Function Usage

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

Input Description

timeout: timeout interval, in seconds. The value 0 indicates no timeout.

Return Value

ret: int, error code.

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 pyACL is initialized by calling acl.init in a process, you can call this API to set the timeout interval. Tasks delivered by calling acl.rt.stream_wait_event in the process can wait within the configured timeout interval.

    The acl.rt.stream_wait_event 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 acl.rt.synchronize_stream API is called.