Closed
[Documentation|文档反馈]: 文档中的代码片段使用已经日落的SIMT API接口 #7093
wulinyuAdd on  27 days agoClosed at  19 days ago
wulinyu
wulinyu
27 days ago Create

Document Link(文档链接)

https://gitcode.com/cann/ops-transformer/blob/master/docs/zh/develop/cross_platform_migration_guide.md

Issues Section(问题文档片段)

image.png

Existing Issues(存在的问题)

对外资料中使用的代码片段,使用的是已日落的SIMT老接口

请参考最新 整改相关接口使用。

比如:
Simt::GetThreadIdx() --> threadIdx.x
Simt::GetThreadNum() -- > blockDim.x
Simt::UintDiv --> asc_uintdiv

混合编程场景下,
更多SIMT内置变量见:https://asc.gitcode.com/api/SIMT-API/SIMD_SIMT_hybrid_programming_intro/extended_syntax/builtin_variables.html
其他C风格API列表见:https://asc.gitcode.com/api/SIMT-API/SIMT_programming_intro/api_list.html

likedislike
周云飞
周云飞Collaborators
27 days ago Comments:

感谢反馈,也感谢提供新旧接口的对应关系和参考文档。

您指出的是跨平台迁移指南中 SIMT 示例的接口更新问题。若示例仍使用已日落的接口,读者直接照用时可能遇到与新版开发环境不兼容的情况;具体受影响的版本范围还需确认。

针对您列出的用法,可以考虑按以下方向调整示例及相关说明:

  • 将 Simt::GetThreadIdx() 改为 threadIdx.x,表示线程在块内的 x 维索引。
  • 将 Simt::GetThreadNum() 改为 blockDim.x,表示线程块在 x 维的线程数。
  • 将 Simt::UintDiv 的调用迁移至 asc_uintdiv,同时核对参数类型和返回值用法。

调整时需结合您提供的混合编程内置变量文档和 C 风格 API 列表,确认示例的编程模式、线程配置及目标版本要求,避免仅替换名称后仍无法使用。我们会继续确认该文档片段的接口适用范围及更新方式。

likedislike
周云飞周云飞Collaborators
27 days ago Assign zzzzzzyf_ as responsible person
周云飞周云飞Collaborators
19 days ago Associated pull request
CANN-robotCANN-robotCollaborators
19 days ago Close issue
CANN-robotCANN-robotCollaborators
19 days ago changed custom state from 进行中 to 已完成
CANN-robotCANN-robotCollaborators
18 days ago Added label: resolved
周云飞
周云飞Collaborators
18 days ago Comments:

PR #15794 更新了跨平台迁移指南中的 Gather SIMT 示例:将旧接口替换为 threadIdx.x、blockDim.x 和 asc_uintdiv,并调整线程数限定符;同时补充快除参数预计算说明,明确 yIndex 与循环索引的关系。

关联 PR:PR #15794

likedislike