已合并
修改 helloworld 样例/资料 #6507
louyuxuan创建于 20 天前
修改 helloworld 样例/资料 #6507
已合并
louyuxuan创建于 20 天前
louyuxuan成员
20 天前

描述

修改 helloworld 样例/资料,简化代码,资料中补充完整代码实现

关联的Issue

#1777

测试

SIMT 二级冒烟

文档更新

docs/zh/guide/getting_started/quick_start/simt_programming/hello_world.md
examples/03_simt_api/00_introduction/00_quickstart/hello_world_simt/README.md
examples/03_simt_api/00_introduction/00_quickstart/hello_world_simt/README_en.md
examples/03_simt_api/00_introduction/00_quickstart/hello_world_simt/hello_world.asc

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 louyuxuan 的贡献)
Llouyuxuan成员
20 天前 创建了 pull request,commit c923a45f
atomgit-bot
atomgit-bot
20 天前 评论:

变更摘要

本 PR 围绕 helloworld 样例/资料进行修订,目标是简化代码并在资料中补充完整代码实现(类型标签为文档更新)。从嵌入的补丁看,改动集中在 examples/03_simt_api/00_introduction/00_quickstart/hello_world_simt/hello_world.asc,主要精简了 main 函数中的设备初始化、流管理与错误处理逻辑,使 SIMT 入门样例的启动代码更简洁。

主要改动

  • 精简设备与流管理逻辑: 删除 deviceId 变量及 aclrtCreateStream/aclrtDestroyStream 调用,改为直接使用 aclrtSetDevice(0)、以 nullptr 作为流,并用 aclrtSynchronizeDevice() 完成同步。
  • 内联核函数启动参数: 移除 blocks_per_grid、threads_per_block、dyn_ubuf_size 三个 constexpr 常量,直接以 hello_world<<<2, 32, 0, nullptr>>>() 形式传入字面量参数。
  • 移除错误信息输出逻辑: 删除 aclGetRecentErrMsg 检查与 fprintf 错误打印代码块。
  • 移除无用头文件引用: 删除 #include <cstdio>。
  • 资料补充完整实现: 依据 PR 描述,同步更新配套资料以补充完整的代码实现(该部分未在提供的补丁中展开)。
likedislike
不准确?
atomgit-bot
atomgit-bot
20 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
20 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
20 天前 评论:

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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
docs ✅ ai_xin, wulinyu (2/2) ✅ ai_xin (1/1)
examples ✅ ai_xin, wulinyu (2/2) ✅ ai_xin (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

louyuxuan, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
此处折叠了48条消息 查看更多
CANN-robotCANN-robot成员
12 天前 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
12 天前 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
12 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
12 天前 添加了label:ci-pipeline-passed
CANN-robotCANN-robot成员
12 天前 合入了pull request