已合并
【质量加固】修改若干符合规则要求的代码规范问题 #4639
zlp1703创建于 6 天前
【质量加固】修改若干符合规则要求的代码规范问题 #4639
已合并
zlp1703创建于 6 天前
zlp1703
6 天前

修改若干符合规则要求的代码规范问题

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 zlp1703 的贡献)
Zzlp1703
6 天前 添加了label:enhancement
Zzlp1703
6 天前 创建了 pull request,commit 2d529238
atomgit-bot
atomgit-bot
6 天前 评论:

变更摘要

本 PR 旨在进行代码规范加固,修正若干不符合规则要求的代码规范问题,核心内容是围绕 const 正确性(const-correctness)的调整,涉及 compiler/graph 下多个模块:为函数参数补充 const 限定、修正成员函数的 const 修饰符与声明保持一致,以及将局部静态容器声明为 const。这些改动均为纯规范修正,不改变既有逻辑与业务行为。

主要改动

  • node_matcher.cc 参数 const 化: 为融合节点张量比较函数 IsTensorDataEqualWithIsTensorEqualWith 的参数 a_tensor 补充 const 限定,使 ConstGeTensorPtr 形参符合只读语义。
  • GraphManager 接口 const 修正: 将 GetGraphOptions 声明为 const 成员函数、为 SetExternalGraphRebuildStateCtrlstd::shared_ptr<GraphRebuildStateCtrl> 参数补充 const,并将 IsCheckpointGraph 移除多余的 const 修饰,graph_manager.cc 实现与 graph_manager.h 声明同步修改。
  • 静态容器 const 化: 将 notask_pass_base.ccIsPreNodeTypeValid 内的 not_support_type 集合和 graph_prepare.ccCheckRefInputNode 内的 block_list 集合由 static std::set 改为 static const std::set,避免静态数据被意外修改。
likedislike
atomgit-bot
atomgit-bot
6 天前 评论:

代码审查

✅ 未发现问题

likedislike
CANN-robot
CANN-robot成员
6 天前 评论:

Hi @zlp1703, welcome to submitting your first PR to ge!

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.

likedislike
此处折叠了85条消息 查看更多
CANN-robotCANN-robot成员
2 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
2 天前 添加了label:ci-pipeline-passed
yangyongqiang
yangyongqiang成员
23 小时前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
23 小时前 添加了label:approved
CANN-robotCANN-robot成员
23 小时前 合入了pull request