---
title: HcclChannelGetRemoteMems
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/programug/commopdev/hcclopdevapi_07_0061.html
sourcePath: /source/zh/canncommercial/900/programug/commopdev/hcclopdevapi_07_0061.html
indexId: 72412f69ba28ba9588eed35bf9bad64076fb992bbebaae51e94164cc05a86a5b75
---
# HcclChannelGetRemoteMems

#### 产品支持情况

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


#### 功能说明

获取通信通道中交换的远端内存信息。


#### 函数原型

```
HcclResult HcclChannelGetRemoteMems(HcclComm comm, ChannelHandle channel, uint32_t *memNum, CommMem **remoteMems, char ***memTags);
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |  |  |
| --- | --- | --- | --- | --- |
| comm | 输入 | 通信域句柄。 HcclComm类型的定义如下： 1 typedef void \*HcclComm; | 1 | typedef void \*HcclComm; |
| 1 | typedef void \*HcclComm; |  |  |  |
| channel | 输入 | 通信通道句柄。 ChannelHandle类型的定义请参见ChannelHandle。 |  |  |
| memNum | 输出 | 内存数量。 |  |  |
| remoteMems | 输出 | 远端内存列表。 CommMem类型的定义请参见CommMem。 |  |  |
| memTags | 输出 | 远端内存字符串列表。 |  |  |


#### 返回值

HcclResult：接口成功返回HCCL_SUCCESS，其他失败。


#### 约束说明

仅Atlas 350 加速卡的AIV引擎支持。


#### 调用示例

```
uint32_t channelNum = 1;
std::vector<HcclChannelDesc> channelDesc(channelNum);
HcclChannelDescInit(channelDesc.data(), channelNum);

// 省略 channelDesc 配置

HcclComm comm;
CommEngine engine = CommEngine::COMM_ENGINE_AIV;
std::vector<ChannelHandle> channels(channelNum);
HcclChannelAcquire(comm, engine, channelDesc.data(), channelNum, channels.data());

uint32_t memNum = 0;
CommMem* remoteMems = nullptr;
char** memTags = nullptr;
HcclChannelGetRemoteMems(comm, channels[0], &memNum, &remoteMems, &memTags);
```
