Function: synchronize_event_with_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

√

Atlas 200I/500 A2 inference products

√

Description

Blocks the current thread until all tasks captured by the event are complete. For details, see the event capture details in acl.rt.record_event.

This API is enhanced based on acl.rt.synchronize_event. You can set permanent waiting or a specific timeout period. If a specific timeout period is configured, the application automatically exits when an exception occurs.

Prototype

  • C Prototype
    1
    aclError aclrtSynchronizeEventWithTimeout(aclrtEvent event, int32_t timeout)
    
  • Python Function
    1
    ret = acl.rt.synchronize_event_with_timeout(event, timeout)
    

Parameters

Parameter

Description

event

Int, event object pointer address to be waited for.

timeout

Int, API timeout interval.

The options are as follows:

  • -1: waits permanently, which functions equivalently as acl.rt.synchronize_event.
  • > 0: specific timeout interval, in ms.

Return Values

Return Value

Description

ret

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

Reference

For the API call example, see Event Synchronization.