Pull Request已成功合入, 合并人@CANN-robot
(感谢 ZhuXincheng 的贡献)变更摘要
此 PR 旨在修复编译器告警:hybrid_model_rt_v2_executor.h 头文件中多个成员函数的参数声明缺少 const 修饰,而其对应的 .cpp 实现文件中已添加了 const,导致声明与定义不一致。变更统一在头文件声明中为这些参数补齐 const,消除告警。
主要改动
- 为
size_t类型参数统一添加const:在IsHostModelInput、SetInputOnHost、SetGeTensorRtInputPlacement、SetGeTensorRtInputData、PrepareGeTensorRtInput、PrepareRtInputFromInputData、CopyGertInputToDevice、PrepareRtInputFromGertTensor等函数的input_index参数前增加const修饰(如const size_t input_index),使头文件声明与实现一致。 - 为
ge::Allocator *类型参数添加顶层const:在PrepareRtInputFromInputData、CopyGertInputToDevice、PrepareRtInputFromGertTensor、PrepareInputDataRtInputs、PrepareGertRtInputs等函数中将ge::Allocator *allocator改为ge::Allocator *const allocator,确保指针本身不可变,与实现匹配。 - 为
gert::Allocators *类型参数添加顶层const:将ExecuteRtModel的gert::Allocators *allocators改为gert::Allocators *const allocators,使声明与定义一致。


代码审查
所有修改的行均已审查完毕。以下是最终分析结果。
审查结论摘要
变更文件: runtime/v1/hybrid/executor/hybrid_model_rt_v2_executor.h(已审查)
- P0: 0 个
- P1: 0 个
- P2: 0 个
- P3: 2 个
总体风险评估: 低风险。该 PR 为头文件中的函数参数补充 const 修饰,以消除与 .cc 实现之间的声明不一致告警。所有添加的 const 均为按值传递参数的顶层 const 或指针自身的顶层 const,不影响函数类型、链接或运行时行为。但该修复不完整——在同一声明行中遗漏了 addr、size 以及三个函数中的 cur_device_id 参数的 const 修饰,导致这些位置的告警仍未消除。
⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。


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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/ge | ✅ zhanj, kobemini, yangyongqiang0606 (3/2) | ✅ zhanj (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
SeasonChu, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


流水线任务触发成功
任务链接 [526ae029803c41a69bdaf3bcbdf9a5b7][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_X86_compiler | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_executor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_dflow | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_dflow | ✅ SUCCESS | ||
| UT_Test_ge_common | ✅ SUCCESS | ||
| UT_Test_parser | ✅ SUCCESS | ||
| UT_Test_python | ✅ SUCCESS | >>>>> | |
| UT_Test_rt | ✅ SUCCESS | ||
| UT_Test_acl | ✅ SUCCESS | ||
| UT_Test_autofuse | ✅ SUCCESS | ||
| UT_Test_executor | ✅ SUCCESS | ||
| UT_Test_autofuse_ascendc_api | ✅ SUCCESS | ||
| ST_Test_dflow | ✅ SUCCESS | ||
| ST_Test_ge_common | ✅ SUCCESS | ||
| ST_Test_parser | ✅ SUCCESS | ||
| ST_Test_python | ✅ SUCCESS | >>>>> | |
| ST_Test_rt | ✅ SUCCESS | ||
| ST_Test_autofuse | ✅ SUCCESS | ||
| ST_Test_executor | ✅ SUCCESS | ||
| ST_Test_hetero | ✅ SUCCESS | ||
| ST_Test_autofuse_ascendc_api | ✅ SUCCESS | ||
| ST_Test_autofuse_e2e | ✅ SUCCESS | ||
| UT_Test_fe | ✅ SUCCESS | ||
| UT_Test_tefusion | ✅ SUCCESS | ||
| ST_Test_fe | ✅ SUCCESS | ||
| ST_Test_tefusion | ✅ SUCCESS | ||
| ST_Test_ge_common_atc | ✅ SUCCESS | ||
| UT_Test_Report_graphengine | ✅ SUCCESS | >>>>> | |
| UT_Test_Report_ge_executor_c | ✅ SUCCESS | >>>>> | |
| UT_Test_Report_ge_autofuse | ✅ SUCCESS | >>>>> | |
| ST_Test_Report_graphengine | ✅ SUCCESS | >>>>> | |
| ST_Test_Report_ge_executor_c | ✅ SUCCESS | >>>>> | |
| ST_Test_Report_ge_autofuse | ✅ SUCCESS | >>>>> | |
| UT_Test_Report_fe | ✅ SUCCESS | >>>>> | |
| ST_Test_Report_fe | ✅ SUCCESS | >>>>> |
[2026-07-17 16:21:54] CI执行结束


流水线任务触发成功
任务链接 [a2376cd0aa0645bdbf564623a9503194][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_ARM_compiler | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_executor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_dflow | ✅ SUCCESS | >>>>> | >>>>> |
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> |
[2026-07-17 16:14:45] CI执行结束


流水线任务触发成功
任务链接 [01b49bb274f44af6b7c390fd09c6b68b][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck_Pr | ✅ SUCCESS | ||
| codecheck | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| codecheck_dt | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ❌ FAILED | >>>>> | >>>>> |
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS |


compile


流水线任务触发成功
任务链接 [0e7c1b6935a14f8182b17d68a2ce8cf9][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_ARM_compiler | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_executor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_ARM_dflow | ✅ SUCCESS | >>>>> | >>>>> |
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> |
[2026-07-17 16:32:19] CI执行结束


流水线任务触发成功
任务链接 [e34c922b9ecd4a658b3a34bf8668f935][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_X86_compiler | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_executor | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_dflow | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_dflow | ✅ SUCCESS | ||
| UT_Test_ge_common | ✅ SUCCESS | ||
| UT_Test_parser | ✅ SUCCESS | ||
| UT_Test_python | ✅ SUCCESS | >>>>> | |
| UT_Test_rt | ✅ SUCCESS | ||
| UT_Test_acl | ✅ SUCCESS | ||
| UT_Test_autofuse | ✅ SUCCESS | ||
| UT_Test_executor | ✅ SUCCESS | ||
| UT_Test_autofuse_ascendc_api | ✅ SUCCESS | ||
| ST_Test_dflow | ✅ SUCCESS | ||
| ST_Test_ge_common | ✅ SUCCESS | ||
| ST_Test_parser | ✅ SUCCESS | ||
| ST_Test_python | ✅ SUCCESS | >>>>> | |
| ST_Test_rt | ✅ SUCCESS | ||
| ST_Test_autofuse | ✅ SUCCESS | ||
| ST_Test_executor | ✅ SUCCESS | ||
| ST_Test_hetero | ✅ SUCCESS | ||
| ST_Test_autofuse_ascendc_api | ✅ SUCCESS | ||
| ST_Test_autofuse_e2e | ✅ SUCCESS | ||
| UT_Test_fe | ✅ SUCCESS | ||
| UT_Test_tefusion | ✅ SUCCESS | ||
| ST_Test_fe | ✅ SUCCESS | ||
| ST_Test_tefusion | ✅ SUCCESS | ||
| ST_Test_ge_common_atc | ✅ SUCCESS | ||
| UT_Test_Report_graphengine | ✅ SUCCESS | >>>>> | |
| UT_Test_Report_ge_executor_c | ✅ SUCCESS | >>>>> | |
| UT_Test_Report_ge_autofuse | ✅ SUCCESS | >>>>> | |
| ST_Test_Report_graphengine | ✅ SUCCESS | >>>>> | |
| ST_Test_Report_ge_executor_c | ✅ SUCCESS | >>>>> | |
| ST_Test_Report_ge_autofuse | ✅ SUCCESS | >>>>> | |
| UT_Test_Report_fe | ✅ SUCCESS | >>>>> | |
| ST_Test_Report_fe | ✅ SUCCESS | >>>>> |
[2026-07-17 16:39:48] CI执行结束


流水线任务触发成功
任务链接 [b62af9ace6ba4d83a08d50a68a0f4001][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck_Pr | ✅ SUCCESS | ||
| codecheck | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| codecheck_dt | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS |
[2026-07-17 16:30:29] CI执行结束


/lgtm


/lgtm


/approve


Pull Request
描述
清理头文件中未用const修饰但是在实现时增加了const修饰的告警
变更类型
请选择本次引入的变更类型:
关联的Issue
如何测试
描述测试此变更的步骤和前提条件:
1.
2.
核对清单
其他信息
在此添加任何其他关于本次 PR 的说明。