Searches Ascend C development resources with a local-first, online-fallback strategy. Indexes API docs, example code, and implementation references for the Huawei Ascend ecosystem.
Ships in ops-direct-invoke-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
本技能提供"本地优先,在线兜底"的文档搜索能力:
| 资源类型 | 路径 | 说明 |
|---|---|---|
| API 文档 | 通过 find "$ASC_DEVKIT_DIR/docs/zh/api/" -name "*.md" 智能搜索 | API 文档(不依赖具体子目录) |
| 高性能模板 | $ASC_DEVKIT_DIR/examples/01_simd_cpp_api/05_best_practices/00_vector_compute/add_high_performance/ | Add 多级性能调优(双缓冲、L2Cache bypass、Bank Conflict 优化) |
| 各类示例 | $ASC_DEVKIT_DIR/examples/01_simd_cpp_api/00_introduction/ | 入门示例(加法、矩阵乘法、融合算子等) |
| 完整文档 | $ASC_DEVKIT_DIR/docs/ | 完整开发文档 |
| Tiling 实现 | $ASC_DEVKIT_DIR/impl/adv_api/tiling/ | Tiling 参数配置参考 |
| 矢量计算 | $ASC_DEVKIT_DIR/examples/01_simd_cpp_api/03_basic_api/01_memory_vector_compute/ | 矢量 API 使用 |
| 调试示例 | $ASC_DEVKIT_DIR/examples/01_simd_cpp_api/01_utilities/00_printf/simple_printf/printf.asc | printf 调试方法 |
| HCCL 通信 API 头文件 | $ASC_DEVKIT_DIR/include/adv_api/hccl/ | HCCL 集合通信头文件(hccl.h、hccl_tiling.h 等),API 文档在 docs/zh/api/SIMD-API/adv_api/HCCL_communication/ |
0. 先查 [api-index.md](references/api-index.md) 定位 API 所属大类和子目录路径
↓
1. $ASC_DEVKIT_DIR/docs/zh/api/ 下的所有 .md 文档(按定位的子目录 find 搜索)
↓ 找不到
2. $ASC_DEVKIT_DIR/examples/ (示例代码)
↓ 找不到
3. $ASC_DEVKIT_DIR/impl/ (实现代码)
↓ 找不到
4. 在线搜索(华为昇腾社区)
使用 scripts/ 中的 Python 脚本
推荐版本:8.5.0(与当前环境一致)
问题:Ascend C 存在大量带数字后缀的 API 变体(如 Add-25.md),同名 API 的不同变体功能可能完全不同。
典型案例:
Add.md - 基础版本Add-25.md - 变体版本(支持更多功能)列出所有变体:
# 搜索某个 API 的所有变体(将 APIName 替换为实际 API 名称)
find "$ASC_DEVKIT_DIR/docs/zh/api/" -name "${APIName}*.md"
# 示例:
# APIName.md ← 基础版本
# APIName-25.md ← 变体版本
# APIName-91.md ← 变体版本
逐一确认功能:每个变体的函数签名、参数、功能可能完全不同
| 后缀 | 含义 | 示例 |
|---|---|---|
| 无后缀 | 基础版本 | Add.md |
-数字 | 变体版本(数字无语义,功能可能完全不同) | Add-25.md |
# 查找某个 API 的所有变体(强制,将 APIName 替换为实际名称)
find "$ASC_DEVKIT_DIR/docs/zh/api/" -name "${APIName}*.md"
# 在所有变体中搜索特定关键词
grep -rl "关键词" "$ASC_DEVKIT_DIR/docs/zh/api/" --include="*.md"
当前环境:A3 服务器,CANN 8.5.0
查阅资料时必须确认 API/方法适用于当前环境。
何时使用:
使用方式:
使用 Task 工具,subagent_type=Explore
提供明确的搜索目标和范围
示例提示词:
| 示例名称 | 路径 | 用途 |
|---|---|---|
| 高性能模板 | $ASC_DEVKIT_DIR/examples/01_simd_cpp_api/05_best_practices/00_vector_compute/add_high_performance/ | Add 多级性能调优(双缓冲、L2Cache bypass、Bank Conflict) |
| 矢量计算 | $ASC_DEVKIT_DIR/examples/01_simd_cpp_api/03_basic_api/01_memory_vector_compute/ | Memory 矢量计算接口(reduce、sort、transpose 等) |
| 复合计算 | $ASC_DEVKIT_DIR/examples/01_simd_cpp_api/03_basic_api/01_memory_vector_compute/element_wise_compound_compute/ | 复合计算接口(AddRelu/Axpy) |
| 基础算术 | $ASC_DEVKIT_DIR/examples/01_simd_cpp_api/03_basic_api/01_memory_vector_compute/element_wise_arithmetic/ | 基础算术类接口(基于 LeakyRelu 演示) |
| 调试打印 | $ASC_DEVKIT_DIR/examples/01_simd_cpp_api/01_utilities/00_printf/simple_printf/printf.asc | printf 调试 |
| 断言使用 | $ASC_DEVKIT_DIR/examples/01_simd_cpp_api/01_utilities/01_assert/assert.asc | 断言示例 |
| 高阶 API 数学库 | $ASC_DEVKIT_DIR/examples/01_simd_cpp_api/04_advanced_api/10_math/ | 高阶 API 数学算子(acosh、axpy、exp、fma 等) |
适用情况:
快速搜索:
# 基础搜索(推荐使用中文关键词)
python scripts/ascend_search_client.py "Ascend C 临时内存申请" --max_results 5
# 搜索 API 文档
python scripts/ascend_search_client.py "AscendC::Add 接口原型" --max_results 8
# 带版本过滤(推荐使用 8.5.0)
python scripts/ascend_search_client.py "Ascend C API" --version "8.5.0"
获取详细内容:
python scripts/ascend_content_fetcher.py <URL>
参数说明:
keyword:搜索关键词(必需),建议使用中文--max_results:返回结果数量(1-10,默认 10)--lang:语言设置(zh/en,默认 zh)--version:版本过滤字符串(如 "8.5.0")--doc_type:文档类型(DOC/API,默认 DOC)依赖安装:
pip install -r skills/ascendc-docs-search/requirements.txt
evals/evals.json (opens in a new tab)references/api-index.md (opens in a new tab)references/compatibility.md (opens in a new tab)references/example-catalog.md (opens in a new tab)requirements.txt (opens in a new tab)scripts/__init__.py (opens in a new tab)scripts/ascend_content_fetcher.py (opens in a new tab)scripts/ascend_search_client.py (opens in a new tab)scripts/ascend_search_skill.py (opens in a new tab)scripts/clean_markdown.py (opens in a new tab)scripts/find_api_doc.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ascend-c, huawei-ascend, cann, documentation-search, api-docs
2 plugins ship this exact skill · first indexed Oct 20, 2026
24 skills in this plugin
/ascendc-api-best-practicesAscend C API 使用最佳实践。提供算术、归约、数据搬运、Buffer管理、精度转换、通信接口等 API 的正确用法和限制说明。触发:用户询问具体 API 用法(如"DataCopy 怎么用"、"ReadNbi 怎么用")、遇到 API 参数错误或限制报错(如 repeatTimes、对齐问题)、需要查看 API 最佳实践或避坑指南时。/ascendc-blaze-best-practice在 Ascend 950 / DAV_3510 平台上,基于 Blaze/tensor_api 开发 Basic、Batch、Grouped、Quantized、MX 等 MatMul 类算子或相关的融合算子时使用。不适用于纯 Vector 算子或 A2/A3 平台。/ascendc-blaze-migration评估并将 ops-nn、ops-transformer 等仓中 Ascend 950 / DAV_3510 的 AscendC Kernel 分支等价迁移到 ops-tensor Blaze/Tensor API。适用于 CMCT、CGMCT、单体或自定义分层 Kernel,以及 Cube、Vector、MIX、高阶 Matmul、手工 Buffer、数据搬运、自定义调度、VF 和同步路径;在隔离迁移工程中串行完成迁移合同冻结、Blaze 开发、验证资产生成、原始基线、Blaze 验收和双仓本地提交交付。/ops-direct-invoke-skills:ascendc-docs-searchfrom ops-direct-invoke-skills
npx claudepluginhub catman626/cannbot-skills --plugin ops-direct-invoke-skillsOther plugins' skills for the same job