Closed
[Bug-Report|缺陷反馈]: kernel编码:使用TILING_KEY_IS宏或包含#if TILING_KEY_VAR的内联函数需添加static关键字(trans_data算子) #3550
ArtmZhouAdd on  26 days agoClosed at  24 days ago
ArtmZhou
ArtmZhou
26 days ago Create

一、问题描述 (必填)

kernel 编码中,使用了 TILING_KEY_IS 宏的内联函数,以及包含 #if TILING_KEY_VAR 的内联函数,需添加 static 关键字(内部链接)。此类内联函数依赖编译单元内的 tiling key 状态(分析),在-g 0的场景下,会进入错误的内联函数,导致精度有问题。

受影响算子:trans_data。经扫描,当前 master 命中位置如下(均为"使用 TILING_KEY_IS 宏"形态;#if TILING_KEY_VAR 形态当前未命中,修复时如有同类函数请一并按规范处理):

image.png

二、环境信息 (可选)

仓库分支:cann/ops-math master
昇腾硬件型号 / CANN 版本 / 操作系统:不涉及(纯编码规范问题)

三、重现步骤 (可选)

查看上述两个文件的对应行函数声明即可。

四、预期结果 (可选)

上述内联函数声明添加 static,形如 static aicore inline void ...,修改后编译通过、算子功能与精度不受影响。

likedislike
ArtmZhouArtmZhou
26 days ago Associated pull request
陈思
陈思Collaborators
26 days ago Comments:

/assign @artmzhou

likedislike
CANN-robotCANN-robotCollaborators
26 days ago Assign artmzhou as responsible person
ArtmZhouArtmZhou
25 days ago changed custom category from 任务 to 缺陷
CANN-robotCANN-robotCollaborators
24 days ago Close issue
CANN-robotCANN-robotCollaborators
24 days ago Added label: resolved