已关闭
[Bug-Report|缺陷反馈]: kirin不支持__host__修饰符,编译会报错 #1239
zengjuan创建于  7月9日关闭于  7月10日
zengjuan
zengjuan成员
7月9日 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

/home/jenkins/Ascend/cann-9.1.0/x86_64-linux/asc/include/adv_api/../utils/std/algorithm.h:30:
[2026/07/08 19:35:38.071 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] /home/jenkins/Ascend/cann-9.1.0/x86_64-linux/asc/impl/utils/std/algorithm/min.h:21:10: error: use of undeclared identifier 'aicore'
[2026/07/08 19:35:38.071 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:36] In file included from /home/jenkins/Ascend/cann-9.1.0/x86_64-linux/asc/include/adv_api/../utils/std/algorithm.h:30:
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] host aicore inline constexpr auto min(const T& src0, const U& src1)
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] /home/jenkins/Ascend/cann-9.1.0/x86_64-linux/asc/impl/utils/std/algorithm/min.h:21:1: error: a type specifier is required for all declarations
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] ^
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] host aicore inline constexpr auto min(const T& src0, const U& src1)
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] ***//scripts/kernel/binary_script/kernel_meta_UpsampleBilinear2dAA_597c82ab077f33d09ddeb750572998c8_high_performance/kernel_meta/UpsampleBilinear2dAA_597c82ab077f33d09ddeb750572998c8_high_performance_tiling_data.h:9:21: note: expanded from macro 'aicore'
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] ^
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] #define aicore [aicore]
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] /home/jenkins/Ascend/cann-9.1.0/x86_64-linux/asc/impl/utils/std/algorithm/min.h:21:20: error: expected ';' at end of declaration
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] ^
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:38] [2026-07-08 19:35:37] host aicore inline constexpr auto min(const T& src0, const U& src1)
[2026/07/08 19:35:38.072 GMT+08:00] gmake[3]: *** [CMakeFiles/exe_compile_kirinx90_5.dir/build.make:70: CMakeFiles/exe_compile_kirinx90_5] Error 1
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:38] [2026-07-08 19:35:37] In file included from ***//scripts/kernel/binary_script/kernel_meta_UpsampleBilinear2dAA_597c82ab077f33d09ddeb750572998c8_high_performance/kernel_meta/UpsampleBilinear2dAA_597c82ab077f33d09ddeb750572998c8_high_performance_kernel.cpp:6:
[2026/07/08 19:35:38.072 GMT+08:00] gmake[2]: *** [CMakeFiles/Makefile2:6821: CMakeFiles/exe_compile_kirinx90_5.dir/all] Error 2

Environment / 环境信息 (Mandatory / 必填)

kirin

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

编译kirin算子

Describe the expected behavior / 预期结果 (Mandatory / 必填)

编译成功

/home/jenkins/Ascend/cann-9.1.0/x86_64-linux/asc/include/adv_api/../utils/std/algorithm.h:30:
[2026/07/08 19:35:38.071 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] /home/jenkins/Ascend/cann-9.1.0/x86_64-linux/asc/impl/utils/std/algorithm/min.h:21:10: error: use of undeclared identifier 'aicore'
[2026/07/08 19:35:38.071 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:36] In file included from /home/jenkins/Ascend/cann-9.1.0/x86_64-linux/asc/include/adv_api/../utils/std/algorithm.h:30:
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] host aicore inline constexpr auto min(const T& src0, const U& src1)
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] /home/jenkins/Ascend/cann-9.1.0/x86_64-linux/asc/impl/utils/std/algorithm/min.h:21:1: error: a type specifier is required for all declarations
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] ^
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] host aicore inline constexpr auto min(const T& src0, const U& src1)
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] ***//scripts/kernel/binary_script/kernel_meta_UpsampleBilinear2dAA_597c82ab077f33d09ddeb750572998c8_high_performance/kernel_meta/UpsampleBilinear2dAA_597c82ab077f33d09ddeb750572998c8_high_performance_tiling_data.h:9:21: note: expanded from macro 'aicore'
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] ^
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] #define aicore [aicore]
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] /home/jenkins/Ascend/cann-9.1.0/x86_64-linux/asc/impl/utils/std/algorithm/min.h:21:20: error: expected ';' at end of declaration
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:37] [2026-07-08 19:35:37] ^
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:38] [2026-07-08 19:35:37] host aicore inline constexpr auto min(const T& src0, const U& src1)
[2026/07/08 19:35:38.072 GMT+08:00] gmake[3]: *** [CMakeFiles/exe_compile_kirinx90_5.dir/build.make:70: CMakeFiles/exe_compile_kirinx90_5] Error 1
[2026/07/08 19:35:38.072 GMT+08:00] [2026-07-08 19:35:38] [2026-07-08 19:35:37] In file included from ***//scripts/kernel/binary_script/kernel_meta_UpsampleBilinear2dAA_597c82ab077f33d09ddeb750572998c8_high_performance/kernel_meta/UpsampleBilinear2dAA_597c82ab077f33d09ddeb750572998c8_high_performance_kernel.cpp:6:
[2026/07/08 19:35:38.072 GMT+08:00] gmake[2]: *** [CMakeFiles/Makefile2:6821: CMakeFiles/exe_compile_kirinx90_5.dir/all] Error 2

Special notes for this issue/备注 (Optional / 选填)

likedislike
zengjuanzengjuan成员
7月9日 添加了label:bug-report
zengjuanzengjuan成员
7月9日 将 zengjuan 设为负责人
zengjuanzengjuan成员
7月9日 关联了pull request:kirin fix __host__ error
zengjuanzengjuan成员
7月9日 修改标题为 “[Bug-Report|缺陷反馈]: kirin不支持__host__修饰符,编译会报错”,原标题为“[Bug-Report|缺陷反馈]: kirin不支持__host__修饰符,变异会报错”
CANN-robotCANN-robot成员
7月10日 关闭了 issue
CANN-robotCANN-robot成员
7月10日 添加了label:resolved