已合并
【质量加固】补充 const 修饰、参数 const 修饰 #4611
cnsd_turtle创建于 5 天前
【质量加固】补充 const 修饰、参数 const 修饰 #4611
已合并
cnsd_turtle创建于 5 天前
cnsd_turtle
cnsd_turtle
5 天前

补充 const 修饰、参数 const 修饰

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 cnsd_turtle 的贡献)
cnsd_turtlecnsd_turtle
5 天前 添加了label:enhancement
cnsd_turtlecnsd_turtle
5 天前 创建了 pull request,commit 1baee73a
atomgit-bot
atomgit-bot
5 天前 评论:

变更摘要

本 PR 为质量加固类改动,主要针对编译图构建与内存管理相关模块补充成员函数的 const 修饰以及参数的 const 修饰,提升接口语义的准确性与代码健壮性。改动覆盖 CompiledGraphSummary::SummaryDataLabelAllocatorDependencyAnalyzerStreamAllocatorGraphRebuildStateCtrl 等类的若干访问器与工具方法,均为纯签名层面的修饰补充,不改变原有业务逻辑。

主要改动

  • CompiledGraphSummary::SummaryData 访问器补充 const:为 GetStreamAllocationSummary()GetOutputShapes()GetOutputDtypes() 三个成员函数添加 const 修饰,明确只读语义。
  • LabelAllocator::CollectFunctionalNode 参数补充 const:在 label_allocator.hlabel_allocator.cc 中将形参由 ComputeGraphPtr &graph 改为 const ComputeGraphPtr &graph,声明对传入图对象只读。
  • DependencyAnalyzer::WhyACannotReuseB 补充 const:在 dependency_analyzer.hdependency_analyzer.cc 中将该成员函数标记为 const
  • StreamAllocator::GetSplitStreamToLogicStream 补充 const:在 graph_stream_allocator.h 中将该成员函数标记为 const
  • GraphRebuildStateCtrl::IsVarPermitToChangeFormats 补充 const:在 graph_rebuild_state_ctrl.hgraph_rebuild_state_ctrl.cc 中将该成员函数标记为 const
likedislike
CANN-robot
CANN-robot成员
5 天前 评论:

Hi @cnsd_turtle, 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
atomgit-bot
atomgit-bot
5 天前 评论:

代码审查

✅ 未发现问题

likedislike
此处折叠了107条消息 查看更多
zhanj
zhanj成员
5 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
5 天前 添加了label:lgtm
张德鹏成员
3 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
3 天前 添加了label:approved
CANN-robotCANN-robot成员
3 天前 合入了pull request