aclrtNotifyImportByKey

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

Obtains the key information in the current process and returns the Notify pointer that can be used by this process.

This API must be used with other APIs to synchronize tasks between processes on multiple devices. For details, see aclrtNotifyGetExportKey.

Prototype

1
aclError aclrtNotifyImportByKey(aclrtNotify *notify, const char *key, uint64_t flags)

Parameters

Parameter

Input/Output

Description

notify

Output

Notify pointer. For details about the type definition, see aclrtNotify.

key

Input

Share name of the Notify object.

First call aclrtNotifyGetExportKey to obtain the share name of the specified Notify object and then pass the share name as an input.

flags

Input

Whether to enable data exchange between two devices.

The value can be either of the following macros:

  • ACL_RT_NOTIFY_IMPORT_FLAG_DEFAULT: Default value. It means disabling data exchange between two devices.

    If you set the parameter to this value, call the aclrtDeviceEnablePeerAccess API separately to enable data exchange between two devices.

  • ACL_RT_NOTIFY_IMPORT_FLAG_ENABLE_PEER_ACCESS: It means enabling data exchange between two devices.

    If you set the parameter to this value, you do not need to call the aclrtDeviceEnablePeerAccess API.

The macros are defined as follows:

#define ACL_RT_NOTIFY_IMPORT_FLAG_DEFAULT            0x0UL
#define ACL_RT_NOTIFY_IMPORT_FLAG_ENABLE_PEER_ACCESS 0x02UL

Returns

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

Restrictions

This operation is not supported in the Ascend virtual instance scenario.

API Call Example

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