Pull Request已成功合入, 合并人@CANN-robot
(感谢 gcw_fHR9mxR5 的贡献)变更摘要
本 PR 依据 Issue #238 质量加固活动规则,针对 autofuse 下 11 处代码规范问题做纯风格修复,不改变运行时行为:一方面为 7 个只读成员函数补充 const 限定符以完善 const 正确性,另一方面将 4 处 lambda 的默认捕获 [&] 改为显式捕获列表。所有改动均通过 Git Hooks 检查。
主要改动
- 只读成员函数补充
const限定符(micro_api_call.h):MicroApiCall的GetInputSize、GetInputTensorIdByIndex、GetOutputTensorIdByIndex、GetMicroApiName四个访问器由非 const 改为 const 成员函数,使只读查询可作用于 const 对象。 - 其余访问器补充
const限定符:tuning_space.h的Container::GetCoTensors、lowering_global_data.h的LoweringGlobalData::GetHostResourceCenter、node_impl.h的Node::NodeImpl::GetOrigNode均改为 const 成员函数,仅返回内部成员值、不改状态。 - lambda 显式捕获(
codegen_api_param_dump.cpp):DumpMergeAxesInfo中dump_expr_veclambda 的捕获由[&]改为[&ss, &indent],仅捕获实际使用的两个局部变量。 - lambda 显式捕获(
tiling_code_gen_impl.cpp):GenFillOtherGroupsGetTiling中emit_get_tilinglambda 由[&]改为显式列出所捕获的成员与this;GenConflictExprContextCode中两处find_if/any_of的 lambda 由[&]改为[&name],仅捕获比较目标变量。


Hi @gcw_fHR9mxR5, welcome to submitting your first PR to graph-autofusion!
PR Merge Steps
1. CLA Signing
If the current PR label includes cann-cla/yes, it means you have signed the CLA and can proceed to the next step. If the label includes cann-cla/no, please sign the CLA first. If you have any questions, please refer to the FAQ.
2. CI Check
Please comment /compile to trigger the CI pipeline check. If the CI run is successful, the PR will be tagged with ci-pipeline-passed and you can proceed to the next step. If the CI run fails, the PR will be tagged with ci-pipeline-failed, please check the CI logs to fix the issues in the PR. If you have any questions, please refer to the FAQ.
3. Code Review
After CI passes, please refer to the PR Approval Progress and proactively @ the committers in the table to review the code. After approval, committers will comment /lgtm and /approve. Once the lgtm and approved labels are successfully added, the PR will be merged automatically.


依据 Issue #238 质量加固活动规则,修复 autofuse 下 10 处代码规范问题,不改变运行时行为。
规则1 · 只读成员函数补充 const 限定符(7 处)
规则9 · lambda 默认捕获改为显式捕获(3 处)
5. codegen_api_param_dump.cpp:77 [&] -> [&ss, &indent]
6. tiling_code_gen_impl.cpp:5194/5208 两处 [&] -> [&name]
7. tiling_code_gen_impl.cpp:3945 [&] -> 显式列出所捕获的成员与 this
以上改动均为 const 正确性补充与 lambda 显式捕获,已通过 Git Hooks 检查。
实际改动对照(11 处 diff,描述中合并表述)