Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhangpengpeng8 的贡献)变更摘要
本 PR 旨在解除 Runtime::InitApiImplies() 对具体 ApiImplMbuf 类型的直接依赖,将 Mbuf 实现的创建逻辑下沉到 api_impl_mbuf.cc。通过新增 IsImplMbufSupported() 能力探针(当前所有平台均返回 true),runtime.cc 仅依据该探针决定是否创建 Mbuf 实现,不再包含 api_impl_mbuf.hpp,也不再直接使用 sizeof(ApiImplMbuf);Mbuf 的分配、失败日志和大小日志统一移至 api_impl_mbuf.cc 中的 CreateImplMbufAndGet() 内,为后续 arch5162 隔离 Mbuf 组件保留扩展点。
主要改动
- 新增能力探针
IsImplMbufSupported(): 在api_impl_creator.hpp中声明、在api_impl_mbuf.cc中定义为始终返回true,当前不改变任何平台的 Mbuf 能力。 - 移动
CreateImplMbufAndGet()实现: 将其从api_impl_creator.cc移到api_impl_mbuf.cc,并在该函数内完成ApiImplMbuf分配、nullptr失败日志(EE1013)以及Runtime_alloc_size大小日志。 runtime.cc不再直接依赖ApiImplMbuf: 移除api_impl_mbuf.hpp头文件引用,改用IsImplMbufSupported()条件包裹CreateImplMbufAndGet()调用,失败时仅返回RT_ERROR_API_NEW,原失败/大小日志逻辑交由api_impl_mbuf.cc处理。api_impl_creator.cc精简依赖: 删除api_impl_mbuf.hpp头文件及 Mbuf 创建函数,api_impl_creator不再感知具体 Mbuf 实现类型。- 收尾规范化:
api_impl_mbuf.cc末尾补充换行,并新增api_impl_creator.hpp头文件以声明工厂接口。


Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| src/runtime | ✅ Henry_ascend, YzQnWyx (2/2) | ✅ Henry_ascend (1/1) |
| tests/ut/runtime | ✅ Henry_ascend, YzQnWyx (2/2) | ✅ Henry_ascend (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhangpengpeng8, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/lgtm


/lgtm
/approve


Pull Request
描述
在最新
master基线上,结合 PR4254 已验证的实现方式,解除 Runtime 生命周期对具体ApiImplMbuf类型的直接依赖:api_impl_creator.hpp仅前置声明ApiMbuf,不再包含api_mbuf.hpp,并提供统一的创建/销毁接口声明。CreateImplMbufAndGet()、DestroyImplMbuf()、能力探针及ApiImplMbuf分配日志收敛到src/runtime/api/impl/api_impl_mbuf.cc。runtime.cc通过工厂创建和销毁 Mbuf 实现,不再包含api_impl_mbuf.hpp,也不再使用sizeof(ApiImplMbuf)。runtime_adapt.cc均通过DestroyImplMbuf()完成销毁,不再依赖具体 Mbuf 实现头文件。IsImplMbufSupported()当前仍返回true,所有平台继续编译并创建完整 Mbuf 实现,本 PR 不改变现有功能和路由行为。ApiMbuf::Instance()继续保留在 API 侧api.cc,不改变单例符号归属。NpuDriver::GetIpcNotifyPeerPhyDevId声明和实现,同时删除仅直接验证该冗余入口的 910B UT。本 PR 是 arch5162 隔离 Mbuf 组件的第 2 步:只建立 Runtime 与可选 Mbuf 实现之间的工厂边界,不在本步骤关闭任何平台能力。该变更不依赖 Mbuf driver 源文件拆分,可以独立合入和独立回退。
变更类型
关联的Issue
无。
如何测试
当前补丁集:
7b7b869c3e13977f6eb1b2e74f3e061f38055956,已合入master@e17790bf85dc2d2275784975c9cd2bbaf60702b3。runtime、runtime_v200、runtime_utest、runtime_utest_api_910B、runtime_utest_task_910B、runtime_utest_xpu_910B编译通过。runtime、runtime_utest_arch5162编译通过;该 target 仍编译 Mbuf API、实现和 driver,符合本步骤边界。RuntimeTest.*:74/74 通过。CloudV2IpcApiTest.*:删除冗余入口 UT 后,剩余 22/22 通过。libruntime.so、libruntime_v200.so和 arch5162libruntime.so执行ldd -r,无未解析符号。runtime.cc、v100/v200runtime_adapt.cc均不再依赖api_impl_mbuf.hpp。66e0f329f3ad4a5dbbe9b2b37fd74d58:27/27 成功,其中UT_Test_rts_common、UT_Test_camodel_check、UT_Test_rts_report均通过。2a217099f0cb4caba9a77e047e690ca6:11/11 成功。核对清单
其他信息
master@e17790bf8,当前 PR 无冲突。ApiImplMbuf生命周期的原逻辑,不影响 driver 文件拆分。false,并从其 target 中移除 Mbuf API、实现和 driver 源文件。