开发者
资源

HcommEndpointCreate

产品支持情况

产品

是否支持

Atlas 350 加速卡

Atlas A3 训练系列产品/Atlas A3 推理系列产品

Atlas A2 训练系列产品/Atlas A2 推理系列产品

Atlas 200I/500 A2 推理产品

Atlas 推理系列产品

Atlas 训练系列产品

功能说明

创建通信设备Endpoint。

函数原型

1
HcclResult HcommEndpointCreate(const EndpointDesc *endpoint, EndpointHandle *endpointHandle)

参数说明

参数名

输入/输出

说明

endpoint

输入

Endpoint初始化配置信息。

EndpointDesc类型的定义请参见EndPointDesc

endpointHandle

输出

返回的Endpoint句柄。

EndpointHandle类型的定义请参见EndpointHandle

返回值

HcclResult:接口成功返回HCCL_SUCCESS,其他失败。

约束说明

调用示例

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
const EndpointDesc endpointDesc = {
    .protocol = COMM_PROTOCOL_UBC_TP,
    .commAddr = {
        .type = COMM_ADDR_TYPE_IP_V4,
        .addr = {{192, 168, 1, 100}}
    },
    .loc = {
        .locType = ENDPOINT_LOC_TYPE_DEVICE,
        .device = {
            .devPhyId = 0,
            .superDevId = 0,
            .serverIdx = 0,
            .superPodIdx = 0
        }
    },
    .raws = {0}
};
EndpointHandle endpointHandle = nullptr;
HcclResult result = HcommEndpointCreate(&endpointDesc, &endpointHandle);