Closed
PyACL Profiling `range_stop` 文档原型参数错误 #1189
KaranocaVeAdd on  Oct 21Closed at  Oct 23
KaranocaVe
KaranocaVe
Oct 21 Create

PyACL Profiling range_stop 文档原型参数错误

现象

固定版本 cann/runtime@a57f46573ce412214b0ba34895f55ff8214735c9 的 Python API 页面 python/docs/zh/api_ref/runtime/Profiling/function-range_stop.md 将 C 原型写为 aclprofRangeStop(uint32_t *rangeId)。公开头文件和实现均声明并接收 uint32_t rangeId 值。使用文档原型编写 C++ 调用会因指针不能转换为整数而编译失败。

证据

  • 页面第 35 行将 rangeId 写成指针。
  • include/external/acl/acl_prof.h 声明 aclprofRangeStop(uint32_t rangeId);同仓库 C API 参考 docs/zh/api_ref/19-02_msproftx_extension_apis.md 也采用值参数。
  • python/pyACL/prof/prof_wrap.cpp 以 uint32_t 解析 Python 参数,并将该整数按值传入 C API。

修复

仅将 Python Profiling API 页面 C 原型中的 uint32_t *rangeId 改为 uint32_t rangeId。Python 调用形式和运行时代码无需修改。

验证

  • 文档签名与头文件、绑定及 C API 参考不一致;错误签名可稳定导致 C++ 示例编译失败。

关联 PR: https://gitcode.com/cann/runtime/merge_requests/5716

likedislike
KaranocaVeKaranocaVe
Oct 21 Associated pull request
KaranocaVeKaranocaVe
Oct 21 Modify description of issue
wuqifan
wuqifan
Oct 21 Comments:

/assign

likedislike
CANN-robotCANN-robotCollaborators
Oct 21 Assign weixin_46600764 as responsible person
wuqifan
wuqifan
Oct 21 Comments:

感谢反馈!您所提的pyacl文档问题已收到,根据提供的信息核实:function-range_stop.md 的 C 原型确实写成了 aclprofRangeStop(uint32_t *rangeId),与 acl_prof.h 中的 aclprofRangeStop(uint32_t rangeId) 不一致;同目录 range_start 的指针参数与头文件一致,无需调整。我们会尽快推进合入!

likedislike
ykl999
ykl999Collaborators
Oct 23 Comments:

pr已合入,issue关闭处理

likedislike
ykl999ykl999Collaborators
Oct 23 changed custom state from 进行中 to 已解决
ykl999ykl999Collaborators
Oct 23 Close issue
CANN-robotCANN-robotCollaborators
Oct 23 Added label: resolved