Merged
docs: 为 C API 全量接口补充 OKF 文档头与源码标注 #7313
flyingXLBAdd on 15 days ago
docs: 为 C API 全量接口补充 OKF 文档头与源码标注 #7313
Merged
flyingXLBAdd on 15 days ago
flyingXLB
flyingXLB
15 days ago

描述

本 PR 汇总 #6791–#6810 共 20 个类目 PR 的全部改动,合并为一个全量 PR(原 20 个 PR 保留不动)。内容已同步到最新 master(db4ca291e)并解决冲突。

为 C API(SIMD-API)全量接口补充 OKF 知识资产:

  • 文档 5 字段头(okftype/description/tag/dependencies/version):835 篇
  • include Doxygen 注解(@ingroup/@brief/@override_id/@archs/@param):52 个头文件
  • examples marker(//! [prototype_id]):36 个样例

覆盖类目:#6791 矩阵计算搬入、#6792 Mmad、#6793 矩阵计算搬出、#6794 Vec数据搬入、#6795 Vec数据搬出、#6796 基础算术、#6797 逻辑计算、#6798 复合计算、#6799 比较与选择、#6800 类型转换、#6801 规约计算、#6802 数据重组、#6803 排序组合、#6804 同步控制、#6805 标量计算、#6806 缓存控制、#6807 原子操作、#6808 全局变量访问、#6809 数据结构、#6810 公共。

本 PR 仅涉及文档元数据与源码注释,不改动接口声明、文档正文与样例逻辑。

冲突处理说明

  • 上游 master 已将 9 篇类目概述文档整合为各目录的 overview.md(随 1398d4bad 等提交删除),这些页面的 front matter 改动不再适用,未纳入本 PR;
  • #6802 分支对 reg_compute/compute/reg_permute_sel.h 误加的 2 行重复声明已剔除,头文件代码与上游 master 完全一致;
  • 其余文档正文、头文件代码、样例代码均以当前 upstream master(db4ca291e)为准,仅叠加新增的 front matter / 注释 / marker。

关联的Issue

无

测试

  • .agent/skills/asc-knowledge-create/scripts/controller.py check:ok(errors=0)
  • 逐文件校验(base = db4ca291e,923 个文件):
    • 改动集合均在 20 个类目 PR 的文件并集内,无越界改动;
    • 835 篇文档:front matter 与对应类目分支逐字节一致,正文与 upstream master 逐字节一致;
    • 52 个头文件:去注释后代码与 upstream master 完全一致,@override_id 注解块无丢失;
    • 36 个样例:去 marker 行后代码与 upstream master 完全一致,marker 均存在;
    • 全树无冲突标记。
  • 分支:flyingXLB/asc-devkit okf/capi-full(单个提交 5615a6010,base master@db4ca291e)
  • CI CodeCheck_precommit:clang-format 18.1.8 校验通过(53 个变更头文件按仓库 .clang-format 折行注释,去注释后代码与 upstream master 一致;3 个样例中 6 条超过 120 列的超长 //! [...] marker 行以 // clang-format off/on 保护,保持 marker 单行语法不被折行破坏)

文档更新

  • docs/zh/api/SIMD-API/c_api/**:835 篇文档增加 5 字段 front matter
  • include/c_api/**:52 个头文件增加 Doxygen 注解
  • examples/02_simd_c_api/**:36 个样例增加 marker 标注

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for flyingXLB's contribution.)
flyingXLBflyingXLB
15 days ago Created pull request, commit 85d4f93f
atomgit-bot
atomgit-bot
15 days ago Comments:

🤖 正在生成合并请求摘要,请稍候…

likedislike
Incorrect?
atomgit-bot
atomgit-bot
15 days ago Comments:

🤖 AI 代码检视正在进行中,请稍候…

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
15 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
15 days ago Comments:

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 ✅ bianque, munanhw, Lycheeeee, wuyang_hw (4/2) ✅ bianque, munanhw (2/1)
examples ✅ wuyang_hw, munanhw, bianque, Lycheeeee (4/2) ✅ munanhw, bianque (2/1)
include/c_api ✅ bianque, wuzhaolin, Lycheeeee, wuyang_hw (4/2) ✅ wuzhaolin (1/1)
include/c_api/reg_compute ✅ bianque, Lycheeeee, wuyang_hw, horming (4/2) ✅ horming (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

flyingXLB, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robotCollaborators
15 days ago updated PR
CANN-robotCANN-robotCollaborators
15 days ago Set horming,xun_zhuge,bianque,YANXI_ZHAO,munanhw,ai_xin,ascendhjh,changxianyu,wuzhaolin as approver
atomgit-bot
atomgit-bot
15 days ago Comments:

⚠️ 本次变更过大(88 个可审文件、67023 行,预估需 56 轮分片审查),已超出 AI 代码评审的处理范围,本次跳过。建议拆分为更小的 PR 以获得有效评审。

likedislike
Incorrect?
atomgit-bot
atomgit-bot
15 days ago Comments:

⚠️ 本次变更过大(88 个可审文件、67023 行,预估需 56 轮分片审查),已超出 AI 代码评审的处理范围,本次跳过。建议拆分为更小的 PR 以获得有效评审。

likedislike
Incorrect?
flyingXLB
flyingXLB
15 days ago Comments:

/compile

likedislike
flyingXLBflyingXLB
15 days ago Pre merge succeeded (commit_id: 9c618e4a30be50220fa3818cf505385461e8ad03)
CANN-robot
CANN-robotCollaborators
15 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
15 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
15 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
15 days ago Added label: ci-pipeline-failed
CANN-robot
CANN-robotCollaborators
15 days ago Comments:

流水线分析报告 — asc-devkit run#7555

流水线: https://gitcode.com/cann/asc-devkit/actions/runs/3ecd42839442444baef6c18ef5ff4b15 | PR#7313 | 2026-11-09 15:40:24 ~ 15:43:52 | 失败 Job 1 个

定界结论: 代码问题 / 代码检查错误 — clang-format 格式不合规(88 个变更文件)
  • 失败类型: 代码问题(由 PR 提交者修复)
  • 根因: CodeCheck_precommit 的 clang-format hook 检出 88 个变更的 C/C++ 源文件格式不符合仓库 .clang-format 规范(hook 报 files were modified,随后以退出码 1 失败),位于 include/c_api/(54 个 .h)与 examples/02_simd_c_api/(34 个 .asc)
  • 处置建议: 在本地对本次变更文件执行 pre-commit run clang-format --files <变更文件>(或 pre-commit run clang-format --all-files)完成格式化,确认改动后 git add 并重新推送;提交前建议整体跑一遍 pre-commit run --all-files 自查
  • 排除项: trim trailing whitespace / fix end of files / check for added large files / check for merge conflicts / detect private key / codespell / OAT Compliance Check / Markdown link check 均 Passed;ruff check、ruff format 因无 Python 变更文件 Skipped;本 run 无编译、UT/ST 类 Job 失败,失败仅此 1 个 Job

失败根因分析

根因 #1: 代码问题 / 代码检查错误 — clang-format 检查 88 个文件未格式化
  • 判据: clang-format ... Failed + - files were modified by this hook
  • 定位步骤: 3_precommit.log(clang-format 结果段,第 141–232 行)
  • 影响 Job: CodeCheck_precommit
  • 根因证据(日志原文):
clang-format.............................................................Failed
- hook id: clang-format
- files were modified by this hook

Formatting [1/4] include/c_api/experimental/asc_get_pipe_idle_slot_count.h
Formatting [2/4] include/c_api/reg_compute/scatter/ub_scatter.h
Formatting [3/4] examples/02_simd_c_api/03_c_api/00_data_movement/data_copy_l0c2ub/data_copy_l0c2ub.asc
Formatting [4/4] examples/02_simd_c_api/03_c_api/02_reg_vector_compute/gather/gather.asc
  • 涉及文件分布(共 88 个:54 个 .h + 34 个 .asc):
目录 文件数
examples/02_simd_c_api/03_c_api 33
include/c_api/reg_compute 20
include/c_api/vector_compute 11
include/c_api/composite 5
include/c_api/scalar_compute 4
include/c_api/utils 3
include/c_api/atomic 2
examples/02_simd_c_api/00_introduction 2
其余 include/c_api/*(experimental、cache_ctrl、spr、vector_datamove、cube_datamove、sync、cube_compute) 各 1
examples/02_simd_c_api/02_features 1
  • 说明: 本次 PR 变更规模较大(2769 个文件,其中 docs 2505 / include 156 / examples 108),clang-format 对 264 个 C/C++ 变更文件执行检查,其中 88 个未按规范格式化。属确定性失败,重新触发流水线不会消失,需格式化后重新提交。
结构化定界摘要
[{"repo": "asc-devkit", "run_number": 7555, "Failed_Type": "代码问题", "Failed_Sub_Type": "代码检查错误", "Failed_Reason": "CodeCheck_precommit 的 clang-format hook 检出 88 个变更 C/C++ 文件(54 个 .h、34 个 .asc)格式不符合 .clang-format 规范,hook 修改文件后退出码 1 导致 Job 失败", "evidence": "clang-format.............................................................Failed  - hook id: clang-format  - files were modified by this hook", "suggestion": "本地对变更文件执行 pre-commit run clang-format 格式化后重新推送,提交前建议整体跑 pre-commit run --all-files 自查", "jobs": "CodeCheck_precommit"}]

由门禁失败定界分析自动生成 | repo: asc-devkit | run: 3ecd42839442444baef6c18ef5ff4b15 | PR#7313

likedislike
flyingXLBflyingXLB
15 days ago Pre merge succeeded (commit_id: bbe762b4f501a40e13914cee512d7c3449c56883)
flyingXLBflyingXLB
15 days ago Modify description of pull request
flyingXLBflyingXLB
15 days ago Force-pushed 1 commits:5615a601-docs: 为 C API 全量接口补充 OKF 文档头与源码标注
flyingXLBflyingXLB
15 days ago Pre merge succeeded (commit_id: 85217673c95af0beb140289d46c6c04fe005f164)
CANN-robotCANN-robotCollaborators
15 days ago Removed label: cann-cla/yes
CANN-robotCANN-robotCollaborators
15 days ago Added label: cann-cla/yes
flyingXLB
flyingXLB
15 days ago Comments:

/compile

likedislike
flyingXLBflyingXLB
15 days ago Pre merge succeeded (commit_id: 7d9c6acbb5f9ff75bd68c3f1eba42aac958558dd)
CANN-robot
CANN-robotCollaborators
15 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
15 days ago Removed label: ci-pipeline-failed
CANN-robotCANN-robotCollaborators
15 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
15 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
15 days ago Added label: ci-pipeline-passed
bianque
bianqueCollaborators
15 days ago Comments:

/lgtm
/approve

likedislike
horming
hormingCollaborators
15 days ago Comments:

/approve

likedislike
Lycheeeee
LycheeeeeCollaborators
14 days ago Comments:

/lgtm

likedislike
CANN-robotCANN-robotCollaborators
14 days ago Added label: lgtm
munanhw
munanhwCollaborators
14 days ago Comments:

/approve

likedislike
吴洋
吴洋Collaborators
14 days ago Comments:

/lgtm
/approve

likedislike
wuzhaolin
wuzhaolinCollaborators
14 days ago Comments:

/approve

likedislike
CANN-robot
CANN-robotCollaborators
14 days ago Comments:

The following users do not have permission to comment /lgtm or /approve on any module in this PR:
/approve: wuyang_hw

likedislike
CANN-robotCANN-robotCollaborators
14 days ago Added label: approved
CANN-robotCANN-robotCollaborators
14 days ago Merged pull request