Pull Request已成功合入, 合并人@CANN-robot
(感谢 小白学习者 的贡献)变更摘要
本 PR 属于 issue #238 “质量加固”活动的一部分,核心目标是在 autofuse 目录内消除 C++ lambda 的 [&] 默认捕获模式,改为显式声明捕获列表,使 lambda 对外部变量的依赖关系更加清晰、可读且更易于维护。改动涉及 arg_list_reorder.cpp、tiling_code_gen_impl.cpp、codegen.cpp、static_ub_template_filter.cpp、recompute_case_generator.cpp 共 5 个文件,均为捕获列表的显式化调整,不改变原有业务逻辑。
主要改动
-
arg_list_reorder.cpp显式捕获成员与局部变量:将IsReduceInputTensor的 lambda 捕获改为[this, reduce_axis, &reduce_axis_ori_axes_set],IsReduceTailTileAxis改为[tail_axis],MakeSureLoadStoreInnerestSameOrder改为[this],显式区分值捕获与引用捕获。 -
tiling_code_gen_impl.cpp显式捕获比较参数与引用变量:将TryGenPGOByCoreNumReuseTiling中find_if的 lambda 捕获改为[asc_graph_id, impl_graph_id, group_id],并将GenConflictExprContextCode中emit_decl的捕获改为[&code, &declared_symbols]。 -
codegen.cpp显式捕获this与引用参数:将GenerateForInductor内generate_tiling_without_pgolambda 的捕获改为[this, &fused_schedule_result, &result],明确对成员及输出参数的引用依赖。 -
static_ub_template_filter.cpp显式捕获可变状态与索引:将两处remove_iflambda 分别改为[&schedule_group, &impl_idx, &state, node_idx, result_idx, group_idx]和[&state, node_idx, &result_idx],明确其读写的外部状态。 -
recompute_case_generator.cpp显式捕获检查函数:将IsRecomputableNode中两处all_oflambda 分别改为[&check_static_tensor]和[&check_dynamic_tensor],仅捕获实际使用的谓词函数。


Hi @wzx_0826, 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.


变更说明
本 PR 用于参与 issue #238 的“质量加固”活动。
本次在 autofuse 目录内对 10 处 C++ lambda 默认捕获进行显式捕获声明,避免使用
[&]默认捕获模式。