Closed
[Bug-Report|缺陷反馈]: pad_v2 GEIR 示例 include 路径错误及 GetSampleBuffers 声明冲突导致编译失败 #4353
tan_xinAdd on  10 days agoClosed at  10 days ago
tan_xinCollaborators
10 days ago Create

一、问题描述 (必填)

conversion/pad_v2/examples/arch35/test_geir_pad_v2.cpp(PadV2 算子 GEIR 图模式样例)存在编译问题:

  1. include 路径错误:example 位于 examples/arch35/,与 op_graph/ 相差两级目录,但 #include "../op_graph/pad_v2_proto.h" 使用了一级目录写法,无法正确找到算子 IR 头文件。
  2. linkage 冲突:GetSampleBuffers() 前置声明未带 static(std::vector<uint8_t*>& GetSampleBuffers();),与定义处的 static 声明不一致,导致编译报错。
  3. 无效 include:#include "experiment_ops.h" 未被使用,冗余引入。

二、环境信息 (可选)

  • 昇腾硬件型号:Ascend 950PR&950DT 系列、Atlas A3/A2 系列
  • CANN版本:社区版(ops-math 仓库)
  • 操作系统:Linux

三、重现步骤 (可选)

  1. 编译 conversion/pad_v2/examples/arch35/test_geir_pad_v2.cpp。
  2. 观察 include 路径错误 / linkage 冲突报错。

四、预期结果 (可选)

  • include 相对路径修正为 ../../op_graph/pad_v2_proto.h(对齐同仓 parallel_concat example 写法),可正常引用算子 IR。
  • GetSampleBuffers() 前置声明与定义均带 static,消除 linkage 冲突。
  • 移除未使用的 experiment_ops.h 后编译通过。

💡 备注(选填)

关联 PR:https://gitcode.com/cann/ops-math/pull/6915

likedislike
Ttan_xinCollaborators
10 days ago Added label: bug-report
tan_xinCollaborators
10 days ago Comments:

/assign @tan_xin

likedislike
CANN-robotCANN-robotCollaborators
10 days ago Assign tan_xin as responsible person
CANN-robotCANN-robotCollaborators
10 days ago Close issue
CANN-robotCANN-robotCollaborators
10 days ago Added label: resolved