aclrtIpcGetEventHandle

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Description

Sets a specified event in the current process as an inter-process communication (IPC) event and returns the event handle. Synchronizes tasks among processes on the same device or across devices.

This API must be used with the following key APIs. Processes A and B are used as an example.

  1. In process A:
    1. Call aclrtCreateEventExWithFlag to create an event with the flag ACL_EVENT_IPC.
    2. Call aclrtIpcGetEventHandle to obtain an IPC event handle.
    3. Call aclrtRecordEvent to insert the event created in 1.a into a stream.
  2. In process B:
    1. Call aclrtIpcOpenEventHandle to obtain the event handle information in process A and return the event pointer that can be used by the current process.
    2. Call aclrtStreamWaitEvent to make a stream wait on an event.
    3. After the event is used, call aclrtDestroyEvent to destroy it.

Prototype

aclError aclrtIpcGetEventHandle(aclrtEvent event, aclrtIpcEventHandle *handle)

Parameters

Parameter

Input/Output

Description

event

Input

Event.

Only an event created by the aclrtCreateEventExWithFlag API and flagged with ACL_EVENT_IPC is supported.

handle

Output

IPC event handle.

Returns

0 on success; else, failure. For details, see aclError.