aclrtGetDevicesTopo

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

√

Note: This API cannot be called for the Atlas 200I/500 A2 inference products in Ascend RC form.

Function

Obtains the network topology between two devices.

Prototype

1
aclError aclrtGetDevicesTopo(uint32_t deviceId, uint32_t otherDeviceId, uint64_t *value)

Parameters

Parameter

Input/Output

Description

deviceId

Input

Device ID.

The value must be in the range of [0, (Available device count – 1)]. Call aclrtGetDeviceCount to obtain the device count.

otherDeviceId

Input

Device ID.

The value must be in the range of [0, (Available device count – 1)]. Call aclrtGetDeviceCount to obtain the device count.

value

Output

Topology between two devices.

  • ACL_RT_DEVS_TOPOLOGY_HCCS: connected through HCCS. Huawei Cache Coherence System (HCCS) is used for high-speed interconnection across CPUs and NPUs.
  • ACL_RT_DEVS_TOPOLOGY_PIX: connected through the same PCIe switch.
  • ACL_RT_DEVS_TOPOLOGY_PHB: connected through the PCIe host bridge.
  • ACL_RT_DEVS_TOPOLOGY_SYS: connected through Symmetric Multiprocessing (SMP). NUMA nodes are interconnected through SMP.
  • ACL_RT_DEVS_TOPOLOGY_SIO: intra-chip connection. Two dies are connected through this mode.
  • ACL_RT_DEVS_TOPOLOGY_HCCS_SW: connected through the HCCS switch.
  • ACL_RT_DEVS_TOPOLOGY_PIB: reserved value, not supported currently.

The macros are defined as follows:

#define ACL_RT_DEVS_TOPOLOGY_HCCS     0x01ULL
#define ACL_RT_DEVS_TOPOLOGY_PIX      0x02ULL
#define ACL_RT_DEVS_TOPOLOGY_PHB      0x08ULL
#define ACL_RT_DEVS_TOPOLOGY_SYS      0x10ULL
#define ACL_RT_DEVS_TOPOLOGY_SIO      0x20ULL
#define ACL_RT_DEVS_TOPOLOGY_HCCS_SW  0x40ULL
#define ACL_RT_DEVS_TOPOLOGY_PIB      0x04ULL

Returns

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