已关闭
[Requirement|需求建议]: 重命名 op_resource.h 为 op_resource_ras.h,消除跨仓重复头文件扫描告警 #39
LiuZonggu创建于  5 天前关闭于  5 天前
LiuZonggu成员
5 天前 创建

Backgroud(背景信息)

跨仓头文件重复扫描按**文件名(basename)**判定,与文件所在路径无关。

commit 96149df 已将 op_resource.h 从 common/inc/op_api 迁移到 common/include/static/ras(路径隔离),但文件名未变,仍与 ops-transformer(common/include/static/op_resource.h)、ops-cv(common/inc/op_api/op_resource.h)等仓同名,跨仓扫描仍判定为重复头文件。

Origin(信息来源)

跨仓头文件扫描治理结果。

Benefit / Necessity (价值/作用)

  • 消除 ops-ras 在跨仓头文件扫描中的重复告警
  • 文件名带仓名后缀 _ras,避免与其他算子仓同名头文件冲突
  • 宏定义仅在本仓静态库编译链路内使用,重命名不影响目标码

Design(设计方案)

  • 将 op_resource.h 恢复至 96149df 之前的路径 common/inc/op_api,并原地重命名为 op_resource_ras.h
  • include guard 由 COMMON_RAS_OP_RESOURCE_H 更新为 COMMON_RAS_OP_RESOURCE_RAS_H,\file 注释同步更新
  • scripts/util/modify_gen_aclnn_static.py:autogen 阶段 sed 替换目标由 op_resource.h 改为 op_resource_ras.h
  • cmake/variables.cmake:移除 96149df 新增的失效 include 路径 ${OPS_RAS_DIR}/common/include/static/ras(common/inc/op_api 原本就在 OPAPI_INCLUDE 中)

关联 PR:
https://gitcode.com/cann/ops-ras/pull/110
https://gitcode.com/cann/ops-ras/pull/111

likedislike
LLiuZonggu成员
5 天前 添加了label:requirement
LLiuZonggu成员
5 天前 将 LiuZonggu 设为负责人
LLiuZonggu成员
5 天前 关联了pull request:refactor: 重命名 op_resource.h 为 op_resource_ras.h,消除跨仓重复头文件扫描(9.2.0)
LLiuZonggu成员
5 天前 修改了issue 的描述
LLiuZonggu成员
5 天前 修改了issue 的描述
CANN-robotCANN-robot成员
5 天前 关闭了 issue
LiuZonggu成员
5 天前 评论:

已合入修改

likedislike
CANN-robotCANN-robot成员
5 天前 添加了label:resolved