已关闭
[Bug-Report|缺陷反馈]: GCC升级不兼容变更致MakeLayoutByFormat的constexpr修饰编译失败 #4963
景明创建于 22 天前关闭于 22 天前
22 天前 修改标题为 “[Bug-Report|缺陷反馈]: GCC升级不兼容变更致MakeLayoutByFormat的constexpr修饰编译失败”,原标题为“[Bug-Report|缺陷反馈]: MakeLayoutByFormat的constexpr修饰导致GCC升级后编译失败”
22 天前 修改标题为 “[Bug-Report|缺陷反馈]: GCC升级不兼容变更致MakeLayoutByFormat的constexpr修饰编译失败”,原标题为“[Bug-Report|缺陷反馈]: MakeLayoutByFormat的constexpr修饰导致GCC升级后编译失败”
22 天前 修改了issue 的描述
游震
22 天前 评论:
22 天前 评论:
/assign @gitcode_lijd


22 天前 将 gitcode_lijd 设为负责人
22 天前 关闭了 issue
22 天前 添加了label:resolved
问题描述
GCC 新版本引入不兼容变更:constexpr 函数体内不允许调用非 constexpr 函数。
MakeLayoutByFormat函数签名带有constexpr修饰,函数体内调用了AscendC::MakeLayout/MakeShape/MakeStride等非 constexpr 接口,属于调用栈上层的 constexpr,需要删除(在变更前该 constexpr 实际也不生效,无法在编译期求值,删除无语义影响)。涉及文件(同名副本函数):
experimental/ffn/swiglu_gated_mlp/op_kernel/common/matmul_act/utils/layout_utils.hgmm/common/cgmct/utils/cgmct_layout_utils.h期望结果
删除
constexpr修饰,适配 GCC 升级。