aclrtIpcGetEventHandle

Applicable Products

Product

Supported

Ascend 950PR

Ascend 950DT

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

Function

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

This API must be used with the key APIs below. 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 no longer used, call aclrtDestroyEvent to destroy it.

Prototype

1
aclError aclrtIpcGetEventHandle(aclrtEvent event, aclrtIpcEventHandle *handle)

Parameters

Parameter

Input/Output

Description

event

Input

Event. For details about the type definition, see aclrtEvent.

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

handle

Output

IPC event handle. For details about the type definition, see aclrtIpcEventHandle.

Returns

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

API Call Example

For the API call example, see Inter-Process Communication.