Function: set_op_wait_timeout

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

Atlas inference products

x

Atlas 200I/500 A2 inference products

Description

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

Prototype

  • C Prototype
    1
    aclError aclrtSetOpWaitTimeout(uint32_t timeout)
    
  • Python Function
    1
    ret = acl.rt.set_op_wait_timeout(timeout)
    

Parameters

Parameter

Description

timeout

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

Return Values

Return Value

Description

ret

Int, error code. 0 on success; else, failure.

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.
  • You can call this API to set the timeout interval after acl.init is called for initialization in a process. 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. If the API is successfully called, the task is successfully delivered but not executed. Therefore, if the waiting time exceeds the configured timeout interval, an error is returned after the acl.rt.synchronize_stream API is called.