Principles

Synchronization Mechanisms

The following synchronization mechanisms are supported:

  • Event synchronization waiting: Call the acl.rt.synchronize_event API to block the application running and wait until the event is complete.
  • Synchronization of tasks in the stream: Call the acl.rt.synchronize_stream API to block the running of the application until all tasks in the specified stream are complete.
  • Task synchronization between streams: Call the acl.rt.stream_wait_event API to block the running of a specified stream until the specified event is complete. It allows multiple streams to wait for the same event to complete. For the API call sequence, see Synchronous Wait of Tasks Between Streams (Implemented Using Events).
  • Device synchronization waiting: Call the acl.rt.synchronize_device API to block the running of the application until the device that is being operated completes the operation. Waits for the device of the current context in the multi-device scenario.