Pull Request已成功合入, 合并人@CANN-robot
(感谢 baixueyan 的贡献)变更摘要
本次 PR 属于文档更新,主要修正了 examples/03_simt_api/ 目录下多个示例 .asc 文件中 #include 头文件的包含路径格式,将原先不带子目录前缀的简写路径统一改为带完整相对路径的格式,确保示例代码与项目实际的目录结构一致。
主要改动
asc_simt.h包含路径修正: 在hello_world.asc、printf.asc、assert.asc、clock.asc、log.asc中,将#include "asc_simt.h"改为#include "simt_api/asc_simt.h",补全了simt_api/子目录前缀。asc_printf.h包含路径修正: 在hello_world.asc、printf.asc、assert.asc、clock.asc中,将#include "asc_printf.h"改为#include "utils/debug/asc_printf.h",补全了utils/debug/子目录前缀。sincos_compute.asc中头文件路径与格式修正: 将#include <asc_simt.h>改为#include "simt_api/asc_simt.h",同时将尖括号改为双引号,并补全路径前缀。log.asc尾随空白清理: 删除了log.asc中多处行尾多余的空白字符(trailing whitespace),属于代码风格规范化。


代码审查
经过全面审查,我已逐文件检查了所有 6 个变更文件以及周围的上下文。以下是最终分析:
审查结论
变更汇总
| 文件 | 变更内容 | 审查结果 |
|---|---|---|
hello_world.asc |
"asc_simt.h" → "simt_api/asc_simt.h"; "asc_printf.h" → "utils/debug/asc_printf.h" |
✅ 无问题 |
printf.asc |
同上 | ✅ 无问题 |
assert.asc |
同上(asc_assert.h 保持原样不变) |
✅ 无问题 |
clock.asc |
同上 | ✅ 无问题 |
log.asc |
"asc_simt.h" → "simt_api/asc_simt.h";10 处行尾空白清理 |
✅ 无问题 |
sincos_compute.asc |
<asc_simt.h> → "simt_api/asc_simt.h"(同时修正了尖括号→双引号及路径) |
✅ 无问题 |
分析
-
头文件路径修正:所有
asc_simt.h和asc_printf.h的 include 路径均从裸文件名更新为项目标准格式simt_api/asc_simt.h和utils/debug/asc_printf.h。这与仓库中01_simd_cpp_api/、05_simd_simt_hybrid/等其他示例目录以及03_simt_api/已更新文件中的写法完全一致。 -
sincos_compute.asc的尖括号修正:将#include <asc_simt.h>(系统头文件风格的尖括号)改为#include "simt_api/asc_simt.h"(项目头文件风格的双引号),同时补全了路径。这是正确的修正,因为asc_simt.h是项目内部头文件而非系统头文件。 -
log.asc的尾随空白清理:10 处仅含空格的空行被清理为真正的空行,纯属格式修正,无功能影响。 -
assert.asc中asc_assert.h未更新:该文件中的#include "asc_assert.h"保持不变。这在项目中仅出现于两个文件(assert.asc和log.asc),且未找到对应的路径限定形式,因此保持不变属于合理范围。 -
未发现编译错误、逻辑错误、安全风险、可靠性问题或回归风险。
总体风险判断
零风险。 这是一次纯粹的文档/示例头文件包含格式修正,所有变更与项目既定规范一致,不涉及任何逻辑、安全或行为变更。
审查发现数量:0 — 未发现任何需要报告的问题。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 2 |
💬 仅评论


Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| ** | ✅ gcw_kUomxQ2l, wulinyu (2/2) | ✅ gcw_kUomxQ2l (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
gcw_1m54gGxh, thanks for your pull request. All authors of the commits have signed the CLA. 👍


gcw_1m54gGxh,感谢您的提交,建议在完成PR充分自验证后,再触发线上构建任务。
若您的PR已具备检视条件,可根据下表的责任田,@对应的committer进行代码检视,我们会在第一时间对您的提交进行处理。
代码责任田:
| module | committer |
|---|---|
| adv_api | chenyiyuan, wuyang_hw |
| basic_api | chenyiyuan, wuyang_hw |
| c_api | pangfd, haipingmao |
| cmake | xun_zhuge, DragonBornHD84 |
| docs | munanhw, ai_xin |
| examples | changxianyu, bianque |
| simt_api | wulinyu, zhanghao_0689 |
| scripts | xun_zhuge, kevin365 |
| tools | YANXI_ZHAO, XuebinYang, sjtulxh |
💡 如您不确定可以@谁,可以直接@我或者ascend-c sig的maintainer,xun_zhuge和ascendhjh,我们会为您分配合适的committer进行代码检视。
再次感谢您参与CANN的社区贡献。


🟡 Medium Priority
与 assert.asc 中的问题相同。log.asc 第 18 行的 #include "asc_assert.h" 使用了裸文件名,而该头文件实际位于 include/utils/debug/asc_assert.h。本次 PR 已将同目录下的 asc_printf.h 从 "asc_printf.h" 修正为 "utils/debug/asc_printf.h",但遗漏了 asc_assert.h 的同步更新。如果构建系统不将 include/utils/debug/ 加入 include 路径,该文件将编译失败。
建议:将 #include "asc_assert.h" 改为 #include "utils/debug/asc_assert.h",与其他头文件路径修复保持一致。
| 18
| - #include "asc_assert.h" |
|
18 | + #include "utils/debug/asc_assert.h" |


🟡 Medium Priority
本次 PR 将多处 #include "asc_printf.h" 修正为 #include "utils/debug/asc_printf.h",因为该头文件实际位于 include/utils/debug/asc_printf.h。然而,asc_assert.h 与 asc_printf.h 位于同一目录 include/utils/debug/asc_assert.h,且项目内部头文件(如 include/simt_api/common_functions.h、include/simt_api/cpp/kernel_simt_intf.h)均以完整路径 "utils/debug/asc_assert.h" 引用它。但以下两个文件中的 #include "asc_assert.h" 未被更新:
assert.asc第 22 行:#include "asc_assert.h"log.asc第 18 行:#include "asc_assert.h"
变更行为:PR 修复了同类头文件路径格式问题,但遗漏了 asc_assert.h。
影响:如果构建系统的 include 路径配置不包含 include/utils/debug/ 目录,则这两个文件将因找不到 asc_assert.h 而编译失败。即使当前编译通过(可能靠其他配置),这种不一致会在后续维护中造成混淆。
建议:将 #include "asc_assert.h" 改为 #include "utils/debug/asc_assert.h",与同目录下 asc_printf.h 的修复保持一致。同时需要在 log.asc 第 18 行做相同修改。
| 22
| - #include "asc_assert.h" |
|
22 | + #include "utils/debug/asc_assert.h" |


流水线任务触发成功
任务链接 [2a707ecb9254489bb2a0e206d784e8bb][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck | ✅ SUCCESS | >>>>> | |
| codecheck_Pr | ✅ SUCCESS | ||
| pre_comment | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> |
[2026-07-15 14:56:15] CI执行结束


流水线任务触发成功
任务链接 [9dfb6e4be37040e1a8b46b987bb396d9][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| pre_comment | ✅ SUCCESS | >>>>> | |
| UT_Test_adv_test_one | ✅ SUCCESS | ||
| UT_Test_adv_test_two | ✅ SUCCESS | ||
| UT_Test_basic_test_two | ✅ SUCCESS | ||
| UT_Test_basic_test_three | ✅ SUCCESS | ||
| UT_Test_basic_test_four | ✅ SUCCESS | ||
| UT_Test_basic_test_five | ✅ SUCCESS | ||
| UT_Test_arm | ✅ SUCCESS | ||
| UT_Test_report | ✅ SUCCESS | >>>>> |
[2026-07-15 15:03:21] CI执行结束


/approve


描述
修正examples文档中头文件包含格式问题
关联的Issue
测试
文档更新
类型标签