error: no matching function for call to 'HcclRankGraphGetTopoTypeByLayer'
note: candidate function not viable: requires 3 arguments, but 4 were provided
示例中的 HcclRankGraphGetTopoInstsByLayer 结果仅用于多传的第四个实参;按当前 API 契约修正后,这段查询和相关注释均无用途,继续保留会误导开发者认为查询层级拓扑类型前必须先查询拓扑实例。
建议删除无用途的 topoInsts 查询,并改为:
ret = HcclRankGraphGetTopoTypeByLayer(comm, 0, &topoInfo.topoType);
Document Link(文档链接)
https://gitcode.com/cann/hcomm/blob/master/docs/zh/comm_op_dev_guide/aicpu_comm_op_dev/query_topo.md
Issues Section(问题文档片段)
当前 AICPU 拓扑查询示例先获取
topoInsts,随后以 4 个参数调用HcclRankGraphGetTopoTypeByLayer:uint32_t topoInstNum = 0; uint32_t *topoInsts; ret = HcclRankGraphGetTopoInstsByLayer(comm, 0, &topoInsts, &topoInstNum); ret = HcclRankGraphGetTopoTypeByLayer(comm, 0, topoInsts[0], &topoInfo.topoType);但当前公开头文件中的函数签名只有 3 个参数,不接收
topoInst:extern HcclResult HcclRankGraphGetTopoTypeByLayer( HcclComm comm, uint32_t netLayer, CommTopo *topoType);同仓库的 API 专页、头文件示例、接口实现和 UT 也均使用 3 参数调用。
Existing Issues(存在的问题)
用户直接参考当前示例时会发生编译错误:
示例中的
HcclRankGraphGetTopoInstsByLayer结果仅用于多传的第四个实参;按当前 API 契约修正后,这段查询和相关注释均无用途,继续保留会误导开发者认为查询层级拓扑类型前必须先查询拓扑实例。建议删除无用途的
topoInsts查询,并改为:ret = HcclRankGraphGetTopoTypeByLayer(comm, 0, &topoInfo.topoType);验证信息
cann/hcomme70e7ec42a775916012ed75f9766e48a4fd076c52026-07-31