已合并
修复SIMT协作组接口返回类型错误 #5329
louyuxuan创建于 8月25日
修复SIMT协作组接口返回类型错误 #5329
已合并
louyuxuan创建于 8月25日
louyuxuan成员
8月25日

描述

修复SIMT协作组接口返回类型错误,将相关接口原型及示例变量类型由 unsigned long long 调整为 unsigned int。

关联的Issue

#1582

测试

SIMT 二级冒烟测试

文档更新

coalesced_group:

  • docs/zh/api/SIMT-API/cooperative_groups/coalesced_group/coalesced_group_intro.md
  • docs/zh/api/SIMT-API/cooperative_groups/coalesced_group/num_threads.md
  • docs/zh/api/SIMT-API/cooperative_groups/coalesced_group/size.md
  • docs/zh/api/SIMT-API/cooperative_groups/coalesced_group/thread_rank.md
  • docs/zh/api/SIMT-API/cooperative_groups/coalesced_group/all.md
  • docs/zh/api/SIMT-API/cooperative_groups/coalesced_group/any.md

thread_block_tile:

  • docs/zh/api/SIMT-API/cooperative_groups/thread_block_tile/thread_block_tile_intro.md
  • docs/zh/api/SIMT-API/cooperative_groups/thread_block_tile/num_threads.md
  • docs/zh/api/SIMT-API/cooperative_groups/thread_block_tile/size.md
  • docs/zh/api/SIMT-API/cooperative_groups/thread_block_tile/thread_rank.md
  • docs/zh/api/SIMT-API/cooperative_groups/thread_block_tile/all.md
  • docs/zh/api/SIMT-API/cooperative_groups/thread_block_tile/any.md

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 louyuxuan 的贡献)
Llouyuxuan成员
8月25日 创建了 pull request,commit 3f7c8272
atomgit-bot
atomgit-bot
8月25日 评论:

变更摘要

该 PR 修复 SIMT 协作组接口的返回类型错误,将 cooperative_groups 相关接口(num_threads()、size()、thread_rank()、meta_group_size()、meta_group_rank())的返回类型由 unsigned long long 统一调整为 unsigned int,并同步更新测试断言及 coalesced_group、thread_block_tile 相关文档中的示例变量类型。

主要改动

  • 接口声明与实现返回类型调整:在 include/simt_api/cooperative_groups.h 与 impl/simt_api/cooperative_groups_impl.h 中,将 tiled_group、coalesced_group、single_warp_thread_block_tile_base、multi_warp_thread_block_tile_base 的 num_threads()、size()、thread_rank()(及 coalesced_group 的 meta_group_size()、meta_group_rank())返回类型由 unsigned long long 改为 unsigned int,并移除实现中的 static_cast<unsigned long long> 转换,直接返回底层 _tiled_info 字段。

  • 测试断言同步更新:在 tests/api/simt_api/ascendc_case_ascend950pr_9599_simt/test_operator_simt_c_cooperative_groups.cpp 中,将 size()、num_threads()、thread_rank() 的期望值由 4ull/8ull/0ull 调整为 4u/8u/0u,与新的返回类型保持一致。

  • 文档更新:更新 coalesced_group 与 thread_block_tile 的接口文档(coalesced_group_intro.md、num_threads.md、size.md、thread_rank.md、thread_block_tile_intro.md),将接口原型及示例变量类型由 unsigned long long 调整为 unsigned int。

likedislike
不准确?
atomgit-bot
atomgit-bot
8月25日 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
8月25日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
8月25日 评论:

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, zhanghao_0689 (3/2) ✅ ai_xin (1/1)
impl/simt_api ✅ wulinyu, zhanghao_0689 (2/2) ✅ wulinyu (1/1)
include/simt_api ✅ zhanghao_0689, wulinyu (2/2) ✅ zhanghao_0689 (1/1)
repo-cann/asc-devkit ✅ zhanghao_0689, wulinyu (2/2) ✅ wulinyu, zhanghao_0689 (2/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
CANN-robotCANN-robot成员
8月25日 将zengjuan,zhanghao_0689,suqwe,wulinyu,kong0808,dengjing_aoe,YeZZzzz1,bluesky901,yangbinhua,zhudi22,chenyiyuan,xun_zhuge,XuebinYang,sjtulxh,bianque,houyuyang,Lycheeeee,YANXI_ZHAO,chentianyu19,shi_nanxiang,wuyang_hw,jiangxinyu3,munanhw,ai_xin,ascendhjh,hujiawen_kaven,wangxiaozhi,DragonBornHD84,hyolee,yukangchen设为评审人
CANN-robotCANN-robot成员
8月25日 将zengjuan,zhanghao_0689,suqwe,wulinyu,kong0808,dengjing_aoe,YeZZzzz1,bluesky901,yangbinhua,zhudi22,chenyiyuan,xun_zhuge,XuebinYang,sjtulxh,bianque,houyuyang,Lycheeeee,YANXI_ZHAO,chentianyu19,shi_nanxiang,wuyang_hw,jiangxinyu3,munanhw,ai_xin,ascendhjh,hujiawen_kaven,wangxiaozhi,DragonBornHD84,hyolee,yukangchen设为审查人
Llouyuxuan成员
8月25日 修改了pull request 的描述
louyuxuan成员
8月25日 评论:

compile

likedislike
Llouyuxuan成员
8月25日 预合并成功(commit_id: faac8a8e00c67602709a55829bf374bc4b36368c)
CANN-robotCANN-robot成员
8月25日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
8月25日 评论:

流水线任务触发成功
任务链接 [5b4cfc278ec84a51bf4dbe7cf092f75b][流水线指导]

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
pre_comment ✅ SUCCESS >>>>>
codecheck_codestyle ❌ FAILED Backend unavailable
codecheck_precommit ✅ SUCCESS >>>>>
StaticCheck_md ✅ SUCCESS
likedislike
CANN-robot
CANN-robot成员
8月25日 评论:

流水线任务触发成功
任务链接 [a6cd0a5ad2c641aeb9c500bd4db5fbc7][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
PreSmoke_A900_npupool ✅ SUCCESS >>>>>

[2026-08-25 16:46:22]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
8月25日 评论:

流水线任务触发成功
任务链接 [d026089f55474e39be8231b914c78f00][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
pre_comment ✅ SUCCESS >>>>>
UT_Test_adv_test_one ✅ SUCCESS
UT_Test_adv_test_two ✅ SUCCESS
UT_Test_basic_test_one ✅ 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
API_Check ⚠️ WARNING >>>>>
UT_Test_report ✅ SUCCESS >>>>>

[2026-08-25 16:35:27]    CI执行结束

likedislike
gao_dafa成员
8月25日 评论:

louyuxuan,感谢您的提交,建议在完成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的社区贡献。

likedislike
CANN-robotCANN-robot成员
8月25日 添加了label:api-check-failed
此处折叠了7条事件消息 查看更多
CANN-robotCANN-robot成员
8月25日 添加了label:ci-pipeline-failed
louyuxuan成员
8月25日 评论:

compile

likedislike
Llouyuxuan成员
8月25日 预合并成功(commit_id: 155bff13fd6d6d1f5a2abb295f81e6bfbaba6dd2)
此处折叠了5条事件消息 查看更多
Llouyuxuan成员
8月26日 修改了pull request 的描述
wulinyu成员8月26日进行代码检视2
docs/zh/api/SIMT-API/cooperative_groups/coalesced_group/all.md
@@ -61,3 +61,3 @@
6161 if (threadIdx.x % 2 == 0) {
6262 coalesced_group active = coalesced_threads();
63- uint32_t result = active.all(1); // 返回1
63+ int result = active.all(1); // 返回1
wulinyu8月26日评论:

修改涉及到API对外返回值的变动 需要和算子确认下,当前是否有使用

likedislike
louyuxuan成员
8月26日 评论:

all、any 这两个接口 uint32_t 改成 int 只是调用示例写错了,代码和资料是对的

ai_xin成员
8月26日 评论:

/approve

likedislike
wulinyu成员
8月26日 评论:

/lgtm
/approve

likedislike
Llouyuxuan成员
8月26日 解决了最后一个问题
zhanghao_0689
zhanghao_0689成员
8月26日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
8月26日 添加了label:lgtmapproved
此处折叠了7条事件消息 查看更多
CANN-robotCANN-robot成员
9月4日 删除了label:ci-pipeline-passed