Function: synchronize_stream_with_timeout

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

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

Prototype

  • C Prototype
    1
    aclError aclrtSynchronizeStreamWithTimeout(aclrtStream stream, int32_t timeout)
    
  • Python Function
    1
    ret = acl.rt.synchronize_stream_with_timeout(stream, timeout)
    

Parameter Description

Parameter

Description

stream

Int, pointer address of the stream object that needs to complete all tasks.

timeout

Int, API timeout interval. The options are as follows:

  • -1: waits forever, which functions equivalently as acl.rt.synchronize_stream.
  • > 0: specific timeout interval, in milliseconds.

Return Value Description

Return Value

Description

ret

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