---
title: 函数：get_devices_topo
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclpythondevg_01_1035.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclpythondevg_01_1035.html
indexId: bf97bb584689dfcfa60f6e8aaa7d44fc552b334b5896b378571b845292b321b571
---
# 函数：get_devices_topo

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |


对于 Atlas 200I/500 A2 推理产品 ，本接口不支持在 Ascend RC 形态下调用。


#### 功能说明

获取两个Device之间的网络拓扑关系。


#### 函数原型

- C函数原型

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


- python函数
  1 value, ret = acl.rt.get_devices_topo(device_id, other_device_id)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| device\_id | int，Device ID。 |
| other\_device\_id | int，Device ID。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| ret | int，返回0表示成功，返回其它值表示失败。 |
| value | int，两个Device之间互联的拓扑关系。 \#define ACL\_RT\_DEVS\_TOPOLOGY\_HCCS 0x01ULL \# 通过HCCS连接，HCCS是Huawei Cache Coherence System（华为缓存一致性系统），用于CPU/NPU之间的高速互联 \#define ACL\_RT\_DEVS\_TOPOLOGY\_PIX 0x02ULL \# 通过同一个PCIe Switch连接 \#define ACL\_RT\_DEVS\_TOPOLOGY\_PIB 0x04ULL \# 预留值 \#define ACL\_RT\_DEVS\_TOPOLOGY\_PHB 0x08ULL \# 通过PCIe Host Bridge连接 \#define ACL\_RT\_DEVS\_TOPOLOGY\_SYS 0x10ULL \# 通过SMP（Symmetric Multiprocessing）连接，NUMA节点之间通过SMP互连 \#define ACL\_RT\_DEVS\_TOPOLOGY\_SIO 0x20ULL \# 片内连接方式，两个DIE之间通过该方式连接 \#define ACL\_RT\_DEVS\_TOPOLOGY\_HCCS\_SW 0x40ULL \# 通过HCCS Switch连接 |
