Closed
[Requirement|需求建议]: 【AscendC样例】SIMT特性:线程同步和内存屏障的资料和样例 #430
wulinyuAdd on Apr 9Closed at May 11
Apr 9 Added label: requirement
wulinyu
Apr 9 Comments:
Apr 9 Comments:
/assign @shaonaite


CANN-robot
Apr 9 Comments:
Apr 9 Comments:
Apr 15 Assign shaonaite as responsible person
Apr 15 Modify description of issue
Apr 21 Associated milestone: Ascend C Release Plan 2026Q2
Apr 24 Modify description of issue
Apr 24 Modify description of issue
shaonaite
Apr 27 Comments:
Apr 27 Comments:
闭环时间:5.15


May 7 Associated pull request
May 11 Modify description of issue
May 11 changed custom state from 待办的 to 已完成
May 11 Close issue
May 11 Added label: Accepted
May 12 Added label: resolved
Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
Backgroud(背景信息)
补充资料样例, 介绍SIMT线程同步和内存屏障相关特性,同步补充资料描述相关调特性,配合样例一起发布。
Origin(信息来源)
无
Benefit / Necessity (价值/作用)
指导用户了解SIMT同步和内存屏障的应用场景,及在实际算子中的性能影响,结合样例,指导用户后续的算子开发及性能优化。
Design(设计方案)
核内执行同步(syncthreads):介绍SIMT的线程块内同步,当前线程块内所有线程代码都执行到该函数位置后再继续执行,通过构造输入shape为1024,核数为1,每核线程数为1024,通过规约算法在一个线程快内求输入数据的和来完成此样例。
核间访问同步(threadfence):线程的写操作对全局可见,重点说明asc_threadfence接口执行顺序的确定性,保证GM访问时写数据有效性。通过构造输入shape为1024 * 1024,核数为1024,每核线程数为1024 * 1024,通过核间规约求输入数据的核来完成此样例
3.总结同步及屏障接口的使用场景及作用,明确接口对整体算子性能的影响,支撑开发者完整详细的了解接口功能。