已合并
【质量加固】为只读成员函数补充 const 修饰 #4597
【质量加固】为只读成员函数补充 const 修饰 #4597
已合并
wxh456创建于 11 天前
wxh456
11 天前

关联 Issue

https://gitcode.com/cann/ge/issues/517

修改说明

面向「质量加固」任务,仅修复 const 相关问题(规则1:成员函数 const),共 10 处。目标分支:develop

本 PR 所选文件/接口与既有质量加固 PR(含此前 QWH789456 的 const 修复及其他已开 PR)不重复

序号 规则 位置 修改
1 规则1 EngineManager::GetSocVersion 成员函数补 const
2 规则1 ArgsFormatConstructor::GetArgsFormatString 成员函数补 const
3 规则1 TbeTaskBuilderAdapter::GetUnknownShapeFlag 成员函数补 const
4 规则1 OpTilingFuncInfo::IsFunctionV4 成员函数补 const
5 规则1 OpTilingFuncInfo::IsFunctionV3 成员函数补 const
6 规则1 OpTilingFuncInfo::IsFunctionV2 成员函数补 const
7 规则1 OpTilingFuncInfo::IsFunctionV1 成员函数补 const
8 规则1 CompileCacheDesc::GetTensorInfoSize 成员函数补 const
9 规则1 Configurations::GetDeployResDir 成员函数补 const
10 规则1 HybridDavinciModel::GetSessionId 成员函数补 const

验证建议

  • 编译相关模块 / 流水线
  • 确认只读 getter 语义不变
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 wxh456 的贡献)
Wwxh456
11 天前 创建了 pull request,commit 4bfe6f2f
Wwxh456
11 天前 关联了issue:GE定向“质量加固”社区有奖任务
atomgit-bot
atomgit-bot
11 天前 评论:

变更摘要

本 PR 属于「质量加固」任务(关联 issue #517 的规则1:成员函数 const),为 10 个只读 getter/判断类成员函数补充 const 修饰,涉及声明(.h)与定义(.cc)两处同步修改,不改变任何函数语义。改动覆盖编译引擎、任务构建适配、算子 tiling 注册、缓存描述、部署配置及混合模型等多个模块。

主要改动

  • EngineManager::GetSocVersionconstengine_manager.ccengine_manager.h 中将 GetSocVersion() 声明和定义同步改为 const 成员函数,仅返回成员 soc_version_,语义不变。
  • ArgsFormatConstructor::GetArgsFormatStringTbeTaskBuilderAdapter::GetUnknownShapeFlagconst:分别位于 args_format_constructor.cc/htbe_task_builder_adapter.cc/h,将只读字符串格式化与未知 shape 判断接口改为 const,其中 GetUnknownShapeFlag 内部仍通过 ge::AttrUtils::GetBool 读取 op_desc_ 属性。
  • OpTilingFuncInfo::IsFunctionV1/IsFunctionV2/IsFunctionV3/IsFunctionV4constop_tiling_registry.ccinc/graph_metadef/external/register/op_tiling_registry.h 中 4 个判断 tiling 函数是否注册的接口统一加上 const,仅判空成员指针。
  • CompileCacheDesc::GetTensorInfoSizeconstcompile_cache_desc.cc/h 中将返回 tensor_info_args_vec_.size() 的接口改为 const 成员函数。
  • Configurations::GetDeployResDirHybridDavinciModel::GetSessionIdconstconfigurations.cc/h 中返回部署资源目录路径的接口、hybrid_davinci_model.cc/h 中获取会话 ID(内部经 GE_CHECK_NOTNULL(impl_) 后调用 impl_->GetSessionId())的接口均补充 const 修饰。
likedislike
不准确?
atomgit-bot
atomgit-bot
11 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
11 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
11 天前 评论:

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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
compiler/engines/ffts_engine 张德鹏, zhanj, Mexyy (3/2) 张德鹏 (1/1)
compiler/engines/nn_engine Mexyy, zhanj, 张德鹏 (3/2) 张德鹏 (1/1)
repo-cann/ge 张德鹏, Mexyy, zhanj (3/2) 张德鹏 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

wxh456, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
11 天前 将yangyongqiang0606,kobemini,ClarkXie,tangqunzhang,xchu42,hugo111,lining23666,fu-jun2,depeng1994,wqtshg_wt,peiyang,shengnan666,zhangfan_hanq,arthur_morgan_hw,zhanj,zhujingjing,jason_yuan_ye,Mexyy,lijunyu_111,wangxiaotian995,stevenaw0,yuht9设为评审人
CANN-robotCANN-robot成员
11 天前 将yangyongqiang0606,kobemini,ClarkXie,tangqunzhang,xchu42,hugo111,lining23666,fu-jun2,depeng1994,wqtshg_wt,peiyang,shengnan666,zhangfan_hanq,arthur_morgan_hw,zhanj,zhujingjing,jason_yuan_ye,Mexyy,lijunyu_111,wangxiaotian995,stevenaw0,yuht9设为审查人
wxh456
11 天前 评论:

/check-cla

likedislike
wxh456
11 天前 评论:

compile

likedislike
Wwxh456
11 天前 update merge request[project id: 8824148, iid: 4597, commit_id: e9b53af383cb304a2cbeee60bc6473c11ad4da00] virtual merging success
CANN-robotCANN-robot成员
11 天前 删除了label:cann-cla/yes
CANN-robotCANN-robot成员
11 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
11 天前 评论:

CLA检查已通过,详情可参考这里

likedislike
CANN-robotCANN-robot成员
11 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
11 天前 评论:

流水线任务触发成功
任务链接 [56ad7694e05147f99d99a0edc119a482][流水线指导]

任务名称状态日志下载链接
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 ❌ FAILED >>>>>
ST_Test_Report_ge_executor_c ✅ SUCCESS >>>>>
ST_Test_Report_ge_autofuse ✅ SUCCESS >>>>>
UT_Test_Report_fe ✅ SUCCESS >>>>>
ST_Test_Report_fe ✅ SUCCESS >>>>>
likedislike
CANN-robot
CANN-robot成员
11 天前 评论:

流水线任务触发成功
任务链接 [d92d413a72da4afaabebd4668bd77870][流水线指导]

任务名称状态日志下载链接
pre_comment ✅ SUCCESS >>>>>
Compile_X86_compiler_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_executor_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_dflow_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_ARM_compiler_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_ARM_executor_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_ARM_dflow_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_ARM_compiler ✅ SUCCESS >>>>> >>>>>
Compile_ARM_executor ✅ SUCCESS >>>>> >>>>>
Compile_ARM_dflow ✅ SUCCESS >>>>> >>>>>
API_Check ⚠️ WARNING >>>>>
PreSmoke_A900_npupool ✅ SUCCESS >>>>>

[2026-08-27 16:42:17]    CI执行结束

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

流水线任务触发成功
任务链接 [6242d656c90f49cd882f84268cf65b5c][流水线指导]

任务名称状态日志下载链接
codecheck_Pr ✅ 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-08-27 16:34:10]    CI执行结束

likedislike
CANN-robotCANN-robot成员
11 天前 添加了label:api-check-failed
此处折叠了6条事件消息 查看更多
CANN-robotCANN-robot成员
11 天前 删除了label:cann-cla/yes
wxh456
11 天前 评论:

已修复:撤回公开头与 ST 未覆盖改动;改为内部只读接口补 const。请重新 compile。

likedislike
wxh456
11 天前 评论:

compile

likedislike
wxh456
11 天前 评论:

/check-cla

likedislike
CANN-robotCANN-robot成员
11 天前 添加了label:stat/needs-squash
Wwxh456
11 天前 update merge request[project id: 8824148, iid: 4597, commit_id: 146d3f55f557bca605ffaa33dc3c2b7609195286] virtual merging success
CANN-robotCANN-robot成员
11 天前 添加了label:cann-cla/yes
CANN-robotCANN-robot成员
11 天前 删除了label:cann-cla/yes
CANN-robotCANN-robot成员
11 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
11 天前 评论:

CLA检查已通过,详情可参考这里

likedislike
CANN-robotCANN-robot成员
11 天前 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
11 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
11 天前 评论:

流水线任务触发成功
任务链接 [ddd2d853c3004733b5c53fc09ec751be][流水线指导]

任务名称状态日志下载链接
pre_comment ✅ SUCCESS >>>>>
Compile_X86_compiler_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_executor_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_dflow_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_ARM_compiler_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_ARM_executor_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_ARM_dflow_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_ARM_compiler ✅ SUCCESS >>>>> >>>>>
Compile_ARM_executor ✅ SUCCESS >>>>> >>>>>
Compile_ARM_dflow ✅ SUCCESS >>>>> >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_A900_npupool ✅ SUCCESS >>>>>

[2026-08-27 17:36:21]    CI执行结束

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

流水线任务触发成功
任务链接 [fb4154f83df4400c8441c599793ef99a][流水线指导]

任务名称状态日志下载链接
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-08-27 17:41:59]    CI执行结束

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

流水线任务触发成功
任务链接 [4b46af73768147488a702dab1cf5f428][流水线指导]

任务名称状态日志下载链接
codecheck_Pr ✅ 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-08-27 17:29:34]    CI执行结束

likedislike
CANN-robotCANN-robot成员
11 天前 添加了label:api-check-pass
CANN-robotCANN-robot成员
11 天前 删除了label:api-check-pass
CANN-robotCANN-robot成员
11 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
11 天前 添加了label:ci-pipeline-passed
夏国正成员
10 天前 评论:

/lgtm

likedislike
zhanj
zhanj成员
10 天前 评论:

/lgtm

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

/approve

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