Pull Request已成功合入, 合并人@CANN-robot
(感谢 yanmingxiang 的贡献)变更摘要
此 PR 回退了 PR !3807 的变更,恢复 aclrtDim3 类型的定义与使用。PR !3807 曾删除 aclrtDim3 并统一替换为 dim3(含 C++ 构造函数支持),但出于需保留 aclrtDim3 类型的原因,本次回退将所有 dim3 引用还原为 aclrtDim3,同时移除 dim3 的构造函数及条件编译保护,并删除对应的构造行为单元测试。
主要改动
- 恢复
aclrtDim3类型定义:在include/external/acl/acl_rt.h中,删除带 C++ 构造函数与#ifndef __BISHENG_CCEC__条件编译的dim3结构体,恢复为无构造函数的aclrtDim3结构体(含x、y、z三个uint32_t成员)。 - 恢复 SIMT 内核 API 参数类型:在
acl_rt_wrapper.h的宏定义和kernel.cpp的实现中,将aclrtLaunchSIMTKernelWithArgsArray和aclrtLaunchSIMTKernelWithHostArgs的gridDim、blockDim参数类型从dim3还原为aclrtDim3。 - 修复单元测试:在
acl_runtime_unittest.cpp中,将所有 SIMT 内核测试用例中的dim3变量声明替换回aclrtDim3,并移除针对dim3默认构造函数、部分参数构造函数和全参数构造函数的三项测试用例。 - 恢复 API 参考文档:在
docs/zh/api_ref/14_kerne_loading_and_execution.md和docs/zh/api_ref/25-04_Structs.md中恢复与aclrtDim3相关的文档内容。


代码审查
经过全面审查,所有 6 个变更文件均已检查完毕。以下是我的分析:
逐文件审查结果
1. include/external/acl/acl_rt.h
dim3→aclrtDim3类型定义恢复正确,移除了__BISHENG_CCEC__守卫和 C++ 构造函数(恢复至 C 语言纯结构体形态)- 两个 SIMT API 函数签名中
dim3→aclrtDim3参数类型恢复正确 aclrtPlaceHolderInfo结构体定义未变更,仍位于第 749-752 行- 所有变更与其余文件一致
结论:无问题。
2. src/acl/aclrt_impl/acl_rt_wrapper.h
- wrapper 宏中
dim3→aclrtDim3类型替换正确 - 两个 SIMT API 的宏定义与头文件声明一致
结论:无问题。
3. src/acl/aclrt_impl/kernel.cpp
aclrtLaunchSIMTKernelWithArgsArrayImpl和aclrtLaunchSIMTKernelWithHostArgsImpl两个实现函数签名中dim3→aclrtDim3替换正确- 函数体内部的
gridDim.x/y/z、blockDim.x/y/z字段访问无需变更(结构体成员名相同) static_cast<uint32_t>(argsSize)和static_cast<uint32_t>(placeHolderNum)是已有的窄化转换,不在本次 diff 变更范围内
结论:无问题。
4. tests/ut/acl/testcase/acl_runtime_unittest.cpp
- 所有 SIMT kernel 测试用例中
dim3→aclrtDim3替换正确 - 移除了三个
dim3构造函数测试(dim3_default_constructor_initializes_to_one、dim3_partial_args_constructor、dim3_full_args_constructor),因为aclrtDim3是纯 C 结构体,无构造函数 - 测试调用处的类型与函数签名完全匹配
结论:无问题。
5. docs/zh/api_ref/14_kerne_loading_and_execution.md
- TOC 中移除了两个 SIMT API 条目
launch_kernel_comparison锚点和 SIMT 行已移除- 各 Launch 接口的"参考资源"小节中,跨引用恢复为内联对比表(去除了 SIMT 行),语义一致
aclrtLaunchKernelWithHostArgs的placeHolderArray参数,aclrtPlaceHolderInfo文档恢复为内联定义- 两个 SIMT API 的完整文档章节(
aclrtLaunchSIMTKernelWithArgsArray、aclrtLaunchSIMTKernelWithHostArgs)已移除 - 无悬空的跨引用(已确认
launch_kernel_comparison、25-04_Structs.md#dim3、25-04_Structs.md#aclrtPlaceHolderInfo均无残留引用)
结论:无问题。
6. docs/zh/api_ref/25-04_Structs.md
- TOC 中移除了
aclrtPlaceHolderInfo和dim3 - 两个结构体的完整文档条目已移除
- 文件以
aclrtUuid正常结束
结论:无问题。
关闭摘要
- P0:0 个
- P1:0 个
- P2:0 个
- P3:0 个
整体风险判断:低。 这是一次干净的回退操作,所有类型名称从 dim3 恢复到 aclrtDim3,所有文档、实现和测试一致。SIMT API 文档被移除(这些文档原本就是被回退的 PR 新增的),API 声明和实现仍然保留。跨文件引用和类型一致性均已验证,未发现任何正确性、安全性或可靠性问题。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 1 |
💬 仅评论


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 |
|---|---|---|
| docs | ✅ 卢煜坤, 王涛 (2/2) | ✅ 王涛, 卢煜坤 (2/1) |
| include/external/acl | ✅ shikai-1, 卢煜坤 (2/2) | ✅ shikai-1 (1/1) |
| src/acl | ✅ 卢煜坤, 王涛 (2/2) | ✅ 王涛, 卢煜坤 (2/1) |
| tests/ut/acl | ✅ 卢煜坤, 王涛 (2/2) | ✅ 王涛, 卢煜坤 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
yanmingxiang, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/compile


流水线任务触发成功
任务链接 [16a63a751ceb4a6aa60e15285da555a6][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_acl | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_v201 | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_c | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_david | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_910b | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_common | ✅ SUCCESS | >>>>> | |
| UT_Test_platform | ✅ SUCCESS | >>>>> | |
| UT_Test_qs | ✅ SUCCESS | >>>>> | |
| UT_Test_aicpusd | ✅ SUCCESS | >>>>> | |
| UT_Test_tsd | ✅ SUCCESS | >>>>> | |
| UT_Test_error_manager | ✅ SUCCESS | >>>>> | |
| UT_Test_slog | ✅ SUCCESS | >>>>> | |
| UT_Test_atrace | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof_part2 | ✅ SUCCESS | ||
| UT_Test_adump | ✅ SUCCESS | >>>>> | |
| UT_Test_mmpa | ✅ SUCCESS | >>>>> | |
| UT_Test_camodel_check | ✅ SUCCESS | ||
| API_Check | ⚠️ WARNING | >>>>> | |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> |
[2026-07-29 21:07:43] CI执行结束


流水线任务触发成功
任务链接 [5375942ec8c44f32a94102f6ccfd3008][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Check_Pr | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS |
[2026-07-29 20:40:22] CI执行结束


/approve
/lgtm


🟡 Medium Priority
变更行:diff 中删除了 docs/zh/api_ref/14_kerne_loading_and_execution.md 中 aclrtLaunchSIMTKernelWithArgsArray 和 aclrtLaunchSIMTKernelWithHostArgs 两个 API 的完整参考文档章节(含功能说明、参数说明、返回值说明、约束说明、参考资源),同时从文件顶部的接口列表和 Launch 接口对比表中移除了这两个 API 的条目。
影响:这两个 API 仍然作为公开接口存在于 include/external/acl/acl_rt.h 中(带有 ACL_FUNC_VISIBILITY 和 doxygen 注释),但在 docs/zh/api_ref/ 下的接口参考文档中已无任何说明。用户查阅《核函数加载与执行》文档时将找不到这两个 API 的用法、参数约束和返回值说明,仅能依赖头文件中的简要 doxygen 注释。
触发条件:用户通过文档了解 AscendCL Runtime 核函数启动 API 时,会遗漏这两个 SIMT 专用接口。
建议:如果确认这两个 SIMT API 应保留文档,则恢复其参考章节并将类型从 dim3 改为 aclrtDim3;如果当前有意不公开文档(例如 API 仍为实验性),则无需修改。


/compile


流水线任务触发成功
任务链接 [a84787bee65b4b28a1bc0b9f7dd724fb][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_acl | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_v201 | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_c | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_david | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_910b | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_common | ✅ SUCCESS | >>>>> | |
| UT_Test_platform | ✅ SUCCESS | >>>>> | |
| UT_Test_qs | ✅ SUCCESS | >>>>> | |
| UT_Test_aicpusd | ✅ SUCCESS | >>>>> | |
| UT_Test_tsd | ✅ SUCCESS | >>>>> | |
| UT_Test_error_manager | ✅ SUCCESS | >>>>> | |
| UT_Test_slog | ✅ SUCCESS | >>>>> | |
| UT_Test_atrace | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof_part1 | ✅ SUCCESS | ||
| UT_Test_msprof_part2 | ✅ SUCCESS | ||
| UT_Test_adump | ✅ SUCCESS | >>>>> | |
| UT_Test_mmpa | ✅ SUCCESS | >>>>> | |
| UT_Test_camodel_check | ✅ SUCCESS | ||
| API_Check | ⚠️ WARNING | >>>>> | |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_report | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof_report | ✅ SUCCESS | >>>>> |
[2026-07-29 21:19:03] CI执行结束


流水线任务触发成功
任务链接 [7c5ac59573b64b69abdc1ca129d7228b][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Check_Pr | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS |
[2026-07-29 21:10:46] CI执行结束


Pull Request
描述
回退 PR !3807(
refactor: 删除 aclrtDim3 统一使用 dim3,新增 SIMT API 参考文档,commit f5a5243a2)。该 PR 删除了
aclrtDim3类型定义并统一使用dim3,同时新增了 SIMT API 参考文档。由于需要保留aclrtDim3类型,现回退此变更。回退涉及 6 个文件:
include/external/acl/acl_rt.h:恢复aclrtDim3定义src/acl/aclrt_impl/acl_rt_wrapper.h:恢复dim3→aclrtDim3src/acl/aclrt_impl/kernel.cpp:恢复dim3→aclrtDim3tests/ut/acl/testcase/acl_runtime_unittest.cpp:恢复aclrtDim3相关 UTdocs/zh/api_ref/14_kerne_loading_and_execution.md:恢复文档docs/zh/api_ref/25-04_Structs.md:恢复文档变更类型
关联的Issue
如何测试
核对清单