已合并
修改 helloworld 样例/资料 #6507
louyuxuan创建于 20 天前
修改 helloworld 样例/资料 #6507
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 louyuxuan 的贡献)atomgit-bot
20 天前 评论:
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 描述,同步更新配套资料以补充完整的代码实现(该部分未在提供的补丁中展开)。


不准确?
atomgit-bot
20 天前 评论:
20 天前 评论:
20 天前 添加了label:cann-cla/yes
CANN-robot
20 天前 评论:
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
/approveor/lgtm- Commenting
/approveimplies 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. 👍


此处折叠了48条消息 查看更多
12 天前 删除了label:ci-pipeline-failed
12 天前 添加了label:ci-pipeline-running
12 天前 删除了label:ci-pipeline-running
12 天前 添加了label:ci-pipeline-passed
12 天前 合入了pull request
描述
修改 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
类型标签