aclrtIpcMemSetAttr

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 the attribute for IPC-based memory sharing.

For the Atlas A3 training products/Atlas A3 inference products, if you need to set the attribute for IPC-based memory sharing, call aclrtIpcMemSetAttr and then aclrtIpcMemGetExportKey in the process that calls aclrtIpcMemGetExportKey. The keys in the two APIs must be the same.

Prototype

1
aclError aclrtIpcMemSetAttr(const char *key, aclrtIpcMemAttrType type, uint64_t attr)

Parameters

Parameter

Input/Output

Description

key

Input

Key of the shared memory.

type

Input

Memory mapping type. For details about the type definition, see aclrtIpcMemAttrType.

Currently, the value can be ACL_RT_IPC_MEM_ATTR_ACCESS_LINK to specify whether the serial input/output (SIO) channel or Huawei Cache Coherence System (HCCS) channel is used between two dies during cross-chip access.

attr

Input

Attribute.

The following macros are supported:

  • ACL_RT_IPC_MEM_ATTR_ACCESS_LINK_SIO: SIO channel (default)
  • ACL_RT_IPC_MEM_ATTR_ACCESS_LINK_HCCS: HCCS channel

The macros are defined as follows:

#define ACL_RT_IPC_MEM_ATTR_ACCESS_LINK_SIO 0
#define ACL_RT_IPC_MEM_ATTR_ACCESS_LINK_HCCS 1

Returns

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