已合并
docs: 移除需要包含的头文件章节相关规范描述&优化贡献指南目录结构 #6120
munanhw创建于 9月17日
docs: 移除需要包含的头文件章节相关规范描述&优化贡献指南目录结构 #6120
已合并
共 22 个文件变更+87-102
| @@ -433,4 +433,4 @@ cd {ASC_DEVKIT_PATH}/build/tests/api/basic_api | |||
| 433 | - asc-devkit 仓库: `{ASC_DEVKIT_PATH}` | 433 | - asc-devkit 仓库: `{ASC_DEVKIT_PATH}` |
| 434 | - CANN 包路径: `{CANN_PATH}` | 434 | - CANN 包路径: `{CANN_PATH}` |
| 435 | - 环境设置脚本: `{CANN_PATH}/set_env.sh` | 435 | - 环境设置脚本: `{CANN_PATH}/set_env.sh` |
| 436 | -- 基础 API 贡献指南: `{ASC_DEVKIT_PATH}/docs/asc_basic_api_contributing.md` | 436 | +- 基础 API 贡献指南: `{ASC_DEVKIT_PATH}/docs/zh/contributing/asc_basic_api_contributing.md` |
| @@ -11,13 +11,13 @@ description: | | |||
| 11 | ## 权威资料 | 11 | ## 权威资料 |
| 12 | 12 | ||
| 13 | 开始检查前,完整读取 `docs/zh/asc_api_writing_guidelines.md`。该文件是规则的主要权威来源; | 13 | 开始检查前,完整读取 `docs/zh/asc_api_writing_guidelines.md`。该文件是规则的主要权威来源; |
| 14 | -API 页面必需与条件章节由 `docs/zh/asc_doc_contributing.md` 补充。与本技能的示例、参考资料或 | 14 | +API 页面必需与条件章节由 `docs/zh/contributing/asc_doc_contributing.md` 补充。与本技能的示例、参考资料或 |
| 15 | 现有文档存在冲突时,以这两份现行规范为准。 | 15 | 现有文档存在冲突时,以这两份现行规范为准。 |
| 16 | 16 | ||
| 17 | 按检查对象按需读取以下现行资料: | 17 | 按检查对象按需读取以下现行资料: |
| 18 | 18 | ||
| 19 | - API 内容页:`docs/zh/asc_api_writing_guidelines.md` 中对应的 `API-*` 条款。 | 19 | - API 内容页:`docs/zh/asc_api_writing_guidelines.md` 中对应的 `API-*` 条款。 |
| 20 | -- API 页面章节清单:`docs/zh/asc_doc_contributing.md` 中的“API参考页面编写规范”。 | 20 | +- API 页面章节清单:`docs/zh/contributing/asc_doc_contributing.md` 中的“API参考页面编写规范”。 |
| 21 | - 导航或索引页:`docs/zh/api/README.md` 及 `API-STRUCT-*` 条款。 | 21 | - 导航或索引页:`docs/zh/api/README.md` 及 `API-STRUCT-*` 条款。 |
| 22 | - 术语:`docs/zh/guide/technical_appendix/concepts_and_terms/glossary.md`。 | 22 | - 术语:`docs/zh/guide/technical_appendix/concepts_and_terms/glossary.md`。 |
| 23 | - 已更名接口:`docs/zh/api/appendix/interface_change_description.md`。 | 23 | - 已更名接口:`docs/zh/api/appendix/interface_change_description.md`。 |
| @@ -5,7 +5,7 @@ | |||
| 5 | | 检查范围 | 权威源 | 主要条款 | | 5 | | 检查范围 | 权威源 | 主要条款 | |
| 6 | |---|---|---| | 6 | |---|---|---| |
| 7 | | API 章节和导航 | `docs/zh/asc_api_writing_guidelines.md` | `API-STRUCT-*` | | 7 | | API 章节和导航 | `docs/zh/asc_api_writing_guidelines.md` | `API-STRUCT-*` | |
| 8 | -| API 页面必需和条件章节 | `docs/zh/asc_doc_contributing.md` | API参考页面编写规范 | | 8 | +| API 页面必需和条件章节 | `docs/zh/contributing/asc_doc_contributing.md` | API参考页面编写规范 | |
| 9 | | 产品支持和芯片标签 | `docs/zh/asc_api_writing_guidelines.md` | `API-PROD-*`、`API-CUSTOM-*` | | 9 | | 产品支持和芯片标签 | `docs/zh/asc_api_writing_guidelines.md` | `API-PROD-*`、`API-CUSTOM-*` | |
| 10 | | 功能、原型、参数、返回值、约束和示例 | `docs/zh/asc_api_writing_guidelines.md` | `API-FUNC-*`、`API-PROTO-*`、`API-PARAM-*`、`API-RET-*`、`API-CONST-*`、`API-EXAMPLE-*` | | 10 | | 功能、原型、参数、返回值、约束和示例 | `docs/zh/asc_api_writing_guidelines.md` | `API-FUNC-*`、`API-PROTO-*`、`API-PARAM-*`、`API-RET-*`、`API-CONST-*`、`API-EXAMPLE-*` | |
| 11 | | 数据类型和术语 | `docs/zh/asc_api_writing_guidelines.md` | `API-SOFTWARE-*`、`API-TERM-00` | | 11 | | 数据类型和术语 | `docs/zh/asc_api_writing_guidelines.md` | `API-SOFTWARE-*`、`API-TERM-00` | |
| @@ -16,28 +16,28 @@ | |||
| 16 | 高阶API基于单核对常见算法进行抽象和封装,实现了一些常用的计算算法,旨在提高编程开发效率。高阶API一般通过调用多种基础API实现。高阶API包括数学计算、矩阵计算、激活函数等API。 | 16 | 高阶API基于单核对常见算法进行抽象和封装,实现了一些常用的计算算法,旨在提高编程开发效率。高阶API一般通过调用多种基础API实现。高阶API包括数学计算、矩阵计算、激活函数等API。 |
| 17 | 17 | ||
| 18 | - **适用场景**:常见算法的抽象和封装,提高算子开发效率 | 18 | - **适用场景**:常见算法的抽象和封装,提高算子开发效率 |
| 19 | -- **贡献指南**:[docs/asc_adv_api_contributing.md](./docs/zh/asc_adv_api_contributing.md) | 19 | +- **贡献指南**:[docs/zh/contributing/asc_adv_api_contributing.md](./docs/zh/contributing/asc_adv_api_contributing.md) |
| 20 | 20 | ||
| 21 | ### 2. 基础API | 21 | ### 2. 基础API |
| 22 | 22 | ||
| 23 | 基础API实现对硬件能力的抽象,开放芯片的能力,保证完备性和兼容性。 | 23 | 基础API实现对硬件能力的抽象,开放芯片的能力,保证完备性和兼容性。 |
| 24 | 24 | ||
| 25 | - **适用场景**:使用C++语言编程风格的场景 | 25 | - **适用场景**:使用C++语言编程风格的场景 |
| 26 | -- **贡献指南**:[docs/asc_basic_api_contributing.md](./docs/zh/asc_basic_api_contributing.md) | 26 | +- **贡献指南**:[docs/zh/contributing/asc_basic_api_contributing.md](./docs/zh/contributing/asc_basic_api_contributing.md) |
| 27 | 27 | ||
| 28 | ### 3. C API | 28 | ### 3. C API |
| 29 | 29 | ||
| 30 | C API提供纯C风格的接口,符合C语言算子开发习惯,开放芯片完备编程能力,支持数组分配内存,一般基于指针编程。提供与业界类似的编程体验。 | 30 | C API提供纯C风格的接口,符合C语言算子开发习惯,开放芯片完备编程能力,支持数组分配内存,一般基于指针编程。提供与业界类似的编程体验。 |
| 31 | 31 | ||
| 32 | - **适用场景**:使用C语言编程风格的场景 | 32 | - **适用场景**:使用C语言编程风格的场景 |
| 33 | -- **贡献指南**:[docs/asc_c_api_contributing.md](./docs/zh/asc_c_api_contributing.md) | 33 | +- **贡献指南**:[docs/zh/contributing/asc_c_api_contributing.md](./docs/zh/contributing/asc_c_api_contributing.md) |
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | ## 资料贡献指南 | 36 | ## 资料贡献指南 |
| 37 | 37 | ||
| 38 | 本项目包含Ascend C的五份核心资料文档(入门教程、编程指南、API参考手册、算子实践参考、跨代迁移兼容性指南),开发者可以对资料内容进行纠错、补充和贡献。 | 38 | 本项目包含Ascend C的五份核心资料文档(入门教程、编程指南、API参考手册、算子实践参考、跨代迁移兼容性指南),开发者可以对资料内容进行纠错、补充和贡献。 |
| 39 | 39 | ||
| 40 | -- **资料编写规范**:[docs/asc_doc_contributing.md](./docs/zh/asc_doc_contributing.md) — 资料贡献场景、各文档编写规范、PR自检清单 | 40 | +- **资料编写规范**:[docs/zh/contributing/asc_doc_contributing.md](./docs/zh/contributing/asc_doc_contributing.md) — 资料贡献场景、各文档编写规范、PR自检清单 |
| 41 | - **资料设计原则**:[docs/asc_doc_design_rules.md](./docs/zh/asc_doc_design_rules.md) — 可获取性、可读性、完备性三维度设计规范 | 41 | - **资料设计原则**:[docs/asc_doc_design_rules.md](./docs/zh/asc_doc_design_rules.md) — 可获取性、可读性、完备性三维度设计规范 |
| 42 | 42 | ||
| 43 | ## 开发者贡献场景主要包括 | 43 | ## 开发者贡献场景主要包括 |
| @@ -1,4 +1,4 @@ | |||
| 1 | -# Contribution Guide | 1 | +# Contribution Guide |
| 2 | 2 | ||
| 3 | This project welcomes developers to experience and participate in contributions. Before participating in community contributions, see [cann-community](https://gitcode.com/cann/community) to understand the code of conduct, sign the CLA agreement, and learn about the contribution process for source code repositories. | 3 | This project welcomes developers to experience and participate in contributions. Before participating in community contributions, see [cann-community](https://gitcode.com/cann/community) to understand the code of conduct, sign the CLA agreement, and learn about the contribution process for source code repositories. |
| 4 | 4 | ||
| @@ -16,28 +16,28 @@ This project supports three types of API development, each with dedicated contri | |||
| 16 | High-level API abstracts and encapsulates common algorithms based on single-core, implementing commonly used computational algorithms to improve programming development efficiency. High-level API generally implements through calling multiple basic APIs. High-level API includes mathematical computation, matrix computation, activation function, and other APIs. | 16 | High-level API abstracts and encapsulates common algorithms based on single-core, implementing commonly used computational algorithms to improve programming development efficiency. High-level API generally implements through calling multiple basic APIs. High-level API includes mathematical computation, matrix computation, activation function, and other APIs. |
| 17 | 17 | ||
| 18 | - **Applicable Scenarios**: Abstraction and encapsulation of common algorithms, improving operator development efficiency | 18 | - **Applicable Scenarios**: Abstraction and encapsulation of common algorithms, improving operator development efficiency |
| 19 | -- **Contribution Guide**: [docs/en/asc_adv_api_contributing.md](./docs/en/asc_adv_api_contributing.md) | 19 | +- **Contribution Guide**: [docs/en/contributing/asc_adv_api_contributing.md](./docs/en/contributing/asc_adv_api_contributing.md) |
| 20 | 20 | ||
| 21 | ### 2. Basic API | 21 | ### 2. Basic API |
| 22 | 22 | ||
| 23 | Basic API implements abstraction of hardware capabilities, opening chip capabilities, ensuring completeness and compatibility. | 23 | Basic API implements abstraction of hardware capabilities, opening chip capabilities, ensuring completeness and compatibility. |
| 24 | 24 | ||
| 25 | - **Applicable Scenarios**: C++ language programming style scenarios | 25 | - **Applicable Scenarios**: C++ language programming style scenarios |
| 26 | -- **Contribution Guide**: [docs/en/asc_basic_api_contributing.md](./docs/en/asc_basic_api_contributing.md) | 26 | +- **Contribution Guide**: [docs/en/contributing/asc_basic_api_contributing.md](./docs/en/contributing/asc_basic_api_contributing.md) |
| 27 | 27 | ||
| 28 | ### 3. C API | 28 | ### 3. C API |
| 29 | 29 | ||
| 30 | C API provides pure C style interfaces, conforming to C language operator development habits, opening complete chip programming capabilities, supporting array memory allocation, generally based on pointer programming. Provides industry-similar programming experience. | 30 | C API provides pure C style interfaces, conforming to C language operator development habits, opening complete chip programming capabilities, supporting array memory allocation, generally based on pointer programming. Provides industry-similar programming experience. |
| 31 | 31 | ||
| 32 | - **Applicable Scenarios**: C language programming style scenarios | 32 | - **Applicable Scenarios**: C language programming style scenarios |
| 33 | -- **Contribution Guide**: [docs/en/asc_c_api_contributing.md](./docs/en/asc_c_api_contributing.md) | 33 | +- **Contribution Guide**: [docs/en/contributing/asc_c_api_contributing.md](./docs/en/contributing/asc_c_api_contributing.md) |
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | ## Documentation Contribution Guide | 36 | ## Documentation Contribution Guide |
| 37 | 37 | ||
| 38 | This project includes five core Ascend C documents (Getting Started Tutorial, Programming Guide, API Reference Manual, Operator Implementation Reference, and Cross-Generation Migration Compatibility Guide); developers are welcome to correct, supplement, and contribute to the content. | 38 | This project includes five core Ascend C documents (Getting Started Tutorial, Programming Guide, API Reference Manual, Operator Implementation Reference, and Cross-Generation Migration Compatibility Guide); developers are welcome to correct, supplement, and contribute to the content. |
| 39 | 39 | ||
| 40 | -- **Documentation Writing Guide**: [docs/en/asc_doc_contributing.md](./docs/en/asc_doc_contributing.md) — Contribution scenarios, writing conventions, PR checklist | 40 | +- **Documentation Writing Guide**: [docs/en/contributing/asc_doc_contributing.md](./docs/en/contributing/asc_doc_contributing.md) — Contribution scenarios, writing conventions, PR checklist |
| 41 | - **Documentation Design Principles**: [docs/en/asc_doc_design_rules.md](./docs/en/asc_doc_design_rules.md) — Discoverability, readability, completeness design specification | 41 | - **Documentation Design Principles**: [docs/en/asc_doc_design_rules.md](./docs/en/asc_doc_design_rules.md) — Discoverability, readability, completeness design specification |
| 42 | 42 | ||
| 43 | ## Developer Contribution Scenarios | 43 | ## Developer Contribution Scenarios |
| @@ -7,23 +7,15 @@ | |||
| 7 | ``` | 7 | ``` |
| 8 | ├── zh # 中文文档目录 | 8 | ├── zh # 中文文档目录 |
| 9 | │ ├── api # API文档目录 | 9 | │ ├── api # API文档目录 |
| 10 | -│ ├── contributing # 代码贡献规范目录(代码风格、接口设计、目录结构、测试等) | 10 | +│ ├── contributing # 贡献指南目录(API贡献指南、代码贡献规范等) |
| 11 | │ ├── figures # 图片目录 | 11 | │ ├── figures # 图片目录 |
| 12 | │ ├── guide # Ascend C 算子开发指南 | 12 | │ ├── guide # Ascend C 算子开发指南 |
| 13 | │ ├── vitepress # 文档构建脚本目录 | 13 | │ ├── vitepress # 文档构建脚本目录 |
| 14 | -│ ├── asc_adv_api_contributing.md # Ascend C 高阶API贡献指南 | ||
| 15 | -│ ├── asc_basic_api_contributing.md # Ascend C 基础API贡献指南 | ||
| 16 | -│ ├── asc_c_api_contributing.md # Ascend C C API贡献指南 | ||
| 17 | -│ ├── asc_doc_contributing.md # Ascend C 资料贡献指南 | ||
| 18 | │ ├── asc_doc_design_rules.md # Ascend C 资料设计规范 | 14 | │ ├── asc_doc_design_rules.md # Ascend C 资料设计规范 |
| 19 | │ ├── asc_how_to_choose_api.md # Ascend C多层级编程接口选择参考文档 | 15 | │ ├── asc_how_to_choose_api.md # Ascend C多层级编程接口选择参考文档 |
| 20 | │ └── quick_start.md # 快速入门文档 | 16 | │ └── quick_start.md # 快速入门文档 |
| 21 | ├── en # 英文文档目录 | 17 | ├── en # 英文文档目录 |
| 22 | -│ ├── contributing # 代码贡献规范目录(代码风格、接口设计、目录结构、测试等) | 18 | +│ ├── contributing # 贡献指南目录(API贡献指南、代码贡献规范等) |
| 23 | -│ ├── asc_adv_api_contributing.md # Ascend C 高阶API贡献指南 | ||
| 24 | -│ ├── asc_basic_api_contributing.md # Ascend C 基础API贡献指南 | ||
| 25 | -│ ├── asc_c_api_contributing.md # Ascend C C API贡献指南 | ||
| 26 | -│ ├── asc_doc_contributing.md # Ascend C 资料贡献指南 | ||
| 27 | │ ├── asc_doc_design_rules.md # Ascend C 资料设计规范 | 19 | │ ├── asc_doc_design_rules.md # Ascend C 资料设计规范 |
| 28 | │ ├── asc_how_to_choose_api.md # Ascend C多层级编程接口选择参考文档 | 20 | │ ├── asc_how_to_choose_api.md # Ascend C多层级编程接口选择参考文档 |
| 29 | │ └── quick_start.md # 快速入门文档 | 21 | │ └── quick_start.md # 快速入门文档 |
| @@ -38,10 +30,10 @@ | |||
| 38 | | 文档 | 面向对象 | 内容介绍 | | 30 | | 文档 | 面向对象 | 内容介绍 | |
| 39 | |---|---|---| | 31 | |---|---|---| |
| 40 | | [API列表](./zh/api/README.md) | 基于Ascend C开源仓,开发定制化API或算子的开发者。 | 介绍项目包含的所有API。 | | 32 | | [API列表](./zh/api/README.md) | 基于Ascend C开源仓,开发定制化API或算子的开发者。 | 介绍项目包含的所有API。 | |
| 41 | -| [高阶API贡献指南](./zh/asc_adv_api_contributing.md) | 基于Ascend C开源仓,开发定制化API的开发者。 | 介绍如何扩展或开发Ascend C高阶API。高阶API基于单核对常见算法进行抽象和封装,实现常用的计算算法,旨在提高算子开发效率。 | | 33 | +| [高阶API贡献指南](./zh/contributing/asc_adv_api_contributing.md) | 基于Ascend C开源仓,开发定制化API的开发者。 | 介绍如何扩展或开发Ascend C高阶API。高阶API基于单核对常见算法进行抽象和封装,实现常用的计算算法,旨在提高算子开发效率。 | |
| 42 | -| [基础API贡献指南](./zh/asc_basic_api_contributing.md) | 基于Ascend C开源仓,开发定制化API的开发者。 | 介绍如何扩展或开发Ascend C基础API。基础API实现对硬件能力的抽象,开放芯片的能力,保证完备性和兼容性。 | | 34 | +| [基础API贡献指南](./zh/contributing/asc_basic_api_contributing.md) | 基于Ascend C开源仓,开发定制化API的开发者。 | 介绍如何扩展或开发Ascend C基础API。基础API实现对硬件能力的抽象,开放芯片的能力,保证完备性和兼容性。 | |
| 43 | -| [C API贡献指南](./zh/asc_c_api_contributing.md) | 基于Ascend C开源仓,开发定制化API的开发者。 | 介绍如何扩展或开发Ascend C C API。C API提供纯C风格的接口,符合C语言算子开发习惯,开放芯片完备编程能力。 | | 35 | +| [C API贡献指南](./zh/contributing/asc_c_api_contributing.md) | 基于Ascend C开源仓,开发定制化API的开发者。 | 介绍如何扩展或开发Ascend C C API。C API提供纯C风格的接口,符合C语言算子开发习惯,开放芯片完备编程能力。 | |
| 44 | -| [资料贡献指南](./zh/asc_doc_contributing.md) | 完善Ascend C现有资料的开发者。 | 介绍Ascend C资料各大章节的编写与贡献规范。| | 36 | +| [资料贡献指南](./zh/contributing/asc_doc_contributing.md) | 完善Ascend C现有资料的开发者。 | 介绍Ascend C资料各大章节的编写与贡献规范。| |
| 45 | | [资料设计规范](./zh/asc_doc_design_rules.md) | 完善Ascend C现有资料的开发者。 | 介绍Ascend C资料体系架构与总体设计原则。| | 37 | | [资料设计规范](./zh/asc_doc_design_rules.md) | 完善Ascend C现有资料的开发者。 | 介绍Ascend C资料体系架构与总体设计原则。| |
| 46 | | [代码贡献规范](./zh/contributing/README.md) | 参与Ascend C代码贡献的开发者。 | 代码风格、接口设计、目录结构、测试等贡献规范索引。 | | 38 | | [代码贡献规范](./zh/contributing/README.md) | 参与Ascend C代码贡献的开发者。 | 代码风格、接口设计、目录结构、测试等贡献规范索引。 | |
| 47 | | [Ascend C入门教程](./zh/guide/getting_started/ascend_c_overview_and_learning_path.md) | Ascend C初学者 | 介绍算子编程基本概念与Ascend C学习路径,旨在帮助开发者快速上手算子开发。 | | 39 | | [Ascend C入门教程](./zh/guide/getting_started/ascend_c_overview_and_learning_path.md) | Ascend C初学者 | 介绍算子编程基本概念与Ascend C学习路径,旨在帮助开发者快速上手算子开发。 | |
| @@ -7,23 +7,15 @@ Key directory structure is as follows: | |||
| 7 | ``` | 7 | ``` |
| 8 | ├── zh # Chinese documentation directory | 8 | ├── zh # Chinese documentation directory |
| 9 | │ ├── api # API documentation directory | 9 | │ ├── api # API documentation directory |
| 10 | -│ ├── contributing # Code contribution standards directory (code style, API design, directory structure, testing, etc.) | 10 | +│ ├── contributing # Contribution guide directory (API contribution guides, code contribution standards, etc.) |
| 11 | │ ├── figures # Image directory | 11 | │ ├── figures # Image directory |
| 12 | │ ├── guide # Ascend C operator develop guide | 12 | │ ├── guide # Ascend C operator develop guide |
| 13 | │ ├── vitepress # docs build directory | 13 | │ ├── vitepress # docs build directory |
| 14 | -│ ├── asc_adv_api_contributing.md # Ascend C high-level API contribution guide | ||
| 15 | -│ ├── asc_basic_api_contributing.md # Ascend C basic API contribution guide | ||
| 16 | -│ ├── asc_c_api_contributing.md # Ascend C C API contribution guide | ||
| 17 | -│ ├── asc_doc_contributing.md # Ascend C documentation contribution guide | ||
| 18 | │ ├── asc_doc_design_rules.md # Ascend C documentation design rules | 14 | │ ├── asc_doc_design_rules.md # Ascend C documentation design rules |
| 19 | │ ├── asc_how_to_choose_api.md # Ascend C Multi-Level Programming Interface Selection Guide | 15 | │ ├── asc_how_to_choose_api.md # Ascend C Multi-Level Programming Interface Selection Guide |
| 20 | │ └── quick_start.md # Quick start documentation | 16 | │ └── quick_start.md # Quick start documentation |
| 21 | ├── en # English documentation directory | 17 | ├── en # English documentation directory |
| 22 | -│ ├── contributing # Code contribution standards directory (code style, API design, directory structure, testing, etc.) | 18 | +│ ├── contributing # Contribution guide directory (API contribution guides, code contribution standards, etc.) |
| 23 | -│ ├── asc_adv_api_contributing.md # Ascend C high-level API contribution guide | ||
| 24 | -│ ├── asc_basic_api_contributing.md # Ascend C basic API contribution guide | ||
| 25 | -│ ├── asc_c_api_contributing.md # Ascend C C API contribution guide | ||
| 26 | -│ ├── asc_doc_contributing.md # Ascend C documentation contribution guide | ||
| 27 | │ ├── asc_doc_design_rules.md # Ascend C documentation design rules | 19 | │ ├── asc_doc_design_rules.md # Ascend C documentation design rules |
| 28 | │ ├── asc_how_to_choose_api.md # Ascend C Multi-Level Programming Interface Selection Guide | 20 | │ ├── asc_how_to_choose_api.md # Ascend C Multi-Level Programming Interface Selection Guide |
| 29 | │ └── quick_start.md # Quick start documentation | 21 | │ └── quick_start.md # Quick start documentation |
| @@ -37,10 +29,10 @@ To help developers quickly familiarize with this project, corresponding document | |||
| 37 | | Document | Target Audience | Content Introduction | | 29 | | Document | Target Audience | Content Introduction | |
| 38 | |---|---|---| | 30 | |---|---|---| |
| 39 | | [API List](./zh/api/README.md) | Users developing customized APIs or operators based on Ascend C open source repository. | Introduces all APIs included in the project. | | 31 | | [API List](./zh/api/README.md) | Users developing customized APIs or operators based on Ascend C open source repository. | Introduces all APIs included in the project. | |
| 40 | -| [High-level API Contribution Guide](./en/asc_adv_api_contributing.md) | Users developing customized APIs based on Ascend C open source repository. | Introduces how to extend or develop Ascend C high-level API. High-level API abstracts and encapsulates common algorithms based on single-core, implementing commonly used computational algorithms to improve operator development efficiency. | | 32 | +| [High-level API Contribution Guide](./en/contributing/asc_adv_api_contributing.md) | Users developing customized APIs based on Ascend C open source repository. | Introduces how to extend or develop Ascend C high-level API. High-level API abstracts and encapsulates common algorithms based on single-core, implementing commonly used computational algorithms to improve operator development efficiency. | |
| 41 | -| [Basic API Contribution Guide](./en/asc_basic_api_contributing.md) | Users developing customized APIs based on Ascend C open source repository. | Introduces how to extend or develop Ascend C basic API. Basic API implements abstraction of hardware capabilities, opening chip capabilities, ensuring completeness and compatibility. | | 33 | +| [Basic API Contribution Guide](./en/contributing/asc_basic_api_contributing.md) | Users developing customized APIs based on Ascend C open source repository. | Introduces how to extend or develop Ascend C basic API. Basic API implements abstraction of hardware capabilities, opening chip capabilities, ensuring completeness and compatibility. | |
| 42 | -| [C API Contribution Guide](./en/asc_c_api_contributing.md) | Users developing customized APIs based on Ascend C open source repository. | Introduces how to extend or develop Ascend C C API. C API provides pure C style interfaces, conforming to C language operator development habits, opening complete chip programming capabilities. | | 34 | +| [C API Contribution Guide](./en/contributing/asc_c_api_contributing.md) | Users developing customized APIs based on Ascend C open source repository. | Introduces how to extend or develop Ascend C C API. C API provides pure C style interfaces, conforming to C language operator development habits, opening complete chip programming capabilities. | |
| 43 | -| [Documentation Contribution Guide](./en/asc_doc_contributing.md) | Developers improving existing Ascend C documentation. | Introduces the writing and contribution specifications for each chapter of Ascend C documentation. | | 35 | +| [Documentation Contribution Guide](./en/contributing/asc_doc_contributing.md) | Developers improving existing Ascend C documentation. | Introduces the writing and contribution specifications for each chapter of Ascend C documentation. | |
| 44 | | [Documentation Design Rules](./en/asc_doc_design_rules.md) | Developers improving existing Ascend C documentation. | Introduces the Ascend C documentation architecture and overall design principles. | | 36 | | [Documentation Design Rules](./en/asc_doc_design_rules.md) | Developers improving existing Ascend C documentation. | Introduces the Ascend C documentation architecture and overall design principles. | |
| 45 | | [Code Contribution Standards](./en/contributing/README.md) | Developers contributing code to Ascend C. | Index of contribution standards: code style, API design, directory structure, testing. | | 37 | | [Code Contribution Standards](./en/contributing/README.md) | Developers contributing code to Ascend C. | Index of contribution standards: code style, API design, directory structure, testing. | |
| 46 | | [Ascend C Getting Started Guide](./zh/guide/getting_started/ascend_c_overview_and_learning_path.md) | Beginners of Ascend C | Introduces basic concepts of operator programming and the Ascend C learning path, helping developers quickly get started with operator development. | | 38 | | [Ascend C Getting Started Guide](./zh/guide/getting_started/ascend_c_overview_and_learning_path.md) | Beginners of Ascend C | Introduces basic concepts of operator programming and the Ascend C learning path, helping developers quickly get started with operator development. | |
| @@ -256,7 +256,7 @@ The content of Neg_ISASI.md is as follows: | |||
| 256 | 256 | ||
| 257 | [Level] Mandatory | 257 | [Level] Mandatory |
| 258 | 258 | ||
| 259 | -[Description] The md file of each interface must organize sections in the following order (all second-level headings). The Data Type, Key Features, and Required Header Files sections are optional based on the actual interface. For example, the Sin interface in the advanced API supports the same data types across different chips, so no separate section is needed to describe the differences. The description can be included with the parameter description. For another example, the basic API uniformly describes the required header files in the function description, so the "Required Header Files" section is not needed. APIs of the same type should maintain a consistent section structure. | 259 | +[Description] The md file of each interface must organize sections in the following order (all second-level headings). The Data Type and Key Features sections are optional based on the actual interface. For example, the Sin interface in the advanced API supports the same data types across different chips, so no separate section is needed to describe the differences. The description can be included with the parameter description. APIs of the same type should maintain a consistent section structure. |
| 260 | 260 | ||
| 261 | ```text | 261 | ```text |
| 262 | Product Support | 262 | Product Support |
| @@ -266,7 +266,6 @@ Parameter Description | |||
| 266 | Data Type | 266 | Data Type |
| 267 | Return Value Description | 267 | Return Value Description |
| 268 | Constraints | 268 | Constraints |
| 269 | -Required Header Files | ||
| 270 | Key Features | 269 | Key Features |
| 271 | Usage Example | 270 | Usage Example |
| 272 | ``` | 271 | ``` |
| @@ -388,13 +387,12 @@ Obtain the preload status of ICache. | |||
| 388 | 387 | ||
| 389 | [Level] Mandatory | 388 | [Level] Mandatory |
| 390 | 389 | ||
| 391 | -[Description] The header file where the interface is located and the header files that need to be included when using the interface must be provided. If a general introduction has been provided in an earlier section by API category or in a separate section, the function description does not need to repeat this information. The header file path must be wrapped in backticks. | 390 | +[Description] The header file where the interface is located and the header files that need to be included when using the interface must be provided. If a general introduction has been provided in an earlier section by API category, the function description does not need to repeat this information. The header file path must be wrapped in backticks. |
| 392 | 391 | ||
| 393 | [Positive Example] | 392 | [Positive Example] |
| 394 | The header file path is: `"basic_api/kernel_operator_vec_binary_intf.h"`. | 393 | The header file path is: `"basic_api/kernel_operator_vec_binary_intf.h"`. |
| 395 | 394 | ||
| 396 | [Exception] | 395 | [Exception] |
| 397 | -- If a separate "Required Header Files" section exists to describe the required header files, this section is not needed. | ||
| 398 | - If the required header files for a class of interfaces have been described in an earlier section, this section is not needed. | 396 | - If the required header files for a class of interfaces have been described in an earlier section, this section is not needed. |
| 399 | 397 | ||
| 400 | ### API-FUNC-02 New Concepts Must Include Necessary Explanations or Hyperlinks | 398 | ### API-FUNC-02 New Concepts Must Include Necessary Explanations or Hyperlinks |
| @@ -23,9 +23,9 @@ | |||
| 23 | ## Related Documents | 23 | ## Related Documents |
| 24 | 24 | ||
| 25 | - [CONTRIBUTING_en.md](../../../CONTRIBUTING_en.md) — Contribution process | 25 | - [CONTRIBUTING_en.md](../../../CONTRIBUTING_en.md) — Contribution process |
| 26 | -- [asc_adv_api_contributing.md](../asc_adv_api_contributing.md) — High-level API development process | 26 | +- [asc_adv_api_contributing.md](./asc_adv_api_contributing.md) — High-level API development process |
| 27 | -- [asc_basic_api_contributing.md](../asc_basic_api_contributing.md) — Basic API development process | 27 | +- [asc_basic_api_contributing.md](./asc_basic_api_contributing.md) — Basic API development process |
| 28 | -- [asc_c_api_contributing.md](../asc_c_api_contributing.md) — C API development process | 28 | +- [asc_c_api_contributing.md](./asc_c_api_contributing.md) — C API development process |
| 29 | -- [asc_doc_contributing.md](../asc_doc_contributing.md) — Documentation contribution process | 29 | +- [asc_doc_contributing.md](./asc_doc_contributing.md) — Documentation contribution process |
| 30 | 30 | ||
| 31 | --- | 31 | --- |
| @@ -19,7 +19,7 @@ Ascend C high-level API development process mainly includes the following steps: | |||
| 19 | - Single operator testing | 19 | - Single operator testing |
| 20 | --- | 20 | --- |
| 21 | ## Custom Development of Brand-new API | 21 | ## Custom Development of Brand-new API |
| 22 | -Below uses high-level API `Axpy` as an example to introduce how to develop a high-level API from scratch. This case removes some unnecessary code. You can view all code in the repository files [axpy.h](../../include/adv_api/math/axpy.h), [axpy_tiling.h](../../include/adv_api/math/axpy_tiling.h), [axpy_tiling_intf.h](../../include/adv_api/math/axpy_tiling_intf.h), [axpy_common_impl.h](../../impl/adv_api/detail/math/axpy/axpy_common_impl.h), [axpy_tiling_impl.cpp](../../impl/adv_api/tiling/math/axpy_tiling_impl.cpp). | 22 | +Below uses high-level API `Axpy` as an example to introduce how to develop a high-level API from scratch. This case removes some unnecessary code. You can view all code in the repository files [axpy.h](../../../include/adv_api/math/axpy.h), [axpy_tiling.h](../../../include/adv_api/math/axpy_tiling.h), [axpy_tiling_intf.h](../../../include/adv_api/math/axpy_tiling_intf.h), [axpy_common_impl.h](../../../impl/adv_api/detail/math/axpy/axpy_common_impl.h), [axpy_tiling_impl.cpp](../../../impl/adv_api/tiling/math/axpy_tiling_impl.cpp). |
| 23 | ### Design API | 23 | ### Design API |
| 24 | Axpy's function is to multiply each element in source operand `srcTensor` with a scalar, then add it with the corresponding element in destination operand `dstTensor`. The calculation formula is as follows. | 24 | Axpy's function is to multiply each element in source operand `srcTensor` with a scalar, then add it with the corresponding element in destination operand `dstTensor`. The calculation formula is as follows. |
| 25 | 25 | ||
| @@ -77,7 +77,7 @@ $$ | |||
| 77 | #### Write API External Interface | 77 | #### Write API External Interface |
| 78 | - Kernel Function Side Interface | 78 | - Kernel Function Side Interface |
| 79 | 79 | ||
| 80 | - In the corresponding category directory under `include/adv_api/`, add new file [axpy.h](../../include/adv_api/math/axpy.h). Based on the above analyzed and designed API function prototype, write external interface code. Function implementation calls AxpyImpl implementation. | 80 | + In the corresponding category directory under `include/adv_api/`, add new file [axpy.h](../../../include/adv_api/math/axpy.h). Based on the above analyzed and designed API function prototype, write external interface code. Function implementation calls AxpyImpl implementation. |
| 81 | ```c++ | 81 | ```c++ |
| 82 | template <typename T, typename U, bool isReuseSource = false> | 82 | template <typename T, typename U, bool isReuseSource = false> |
| 83 | __aicore__ inline void Axpy(const LocalTensor<T>& dstTensor, const LocalTensor<U>& srcTensor, const U scalarValue, | 83 | __aicore__ inline void Axpy(const LocalTensor<T>& dstTensor, const LocalTensor<U>& srcTensor, const U scalarValue, |
| @@ -88,7 +88,7 @@ $$ | |||
| 88 | ``` | 88 | ``` |
| 89 | - Tiling Side Interface | 89 | - Tiling Side Interface |
| 90 | 90 | ||
| 91 | - In the corresponding category directory under `include/adv_api/`, add new file [axpy_tiling.h](../../include/adv_api/math/axpy_tiling.h). Based on the above analyzed and designed Tiling side interface, write function declaration. | 91 | + In the corresponding category directory under `include/adv_api/`, add new file [axpy_tiling.h](../../../include/adv_api/math/axpy_tiling.h). Based on the above analyzed and designed Tiling side interface, write function declaration. |
| 92 | ```c++ | 92 | ```c++ |
| 93 | #include "../utils/types.h" | 93 | #include "../utils/types.h" |
| 94 | 94 | ||
| @@ -96,7 +96,7 @@ $$ | |||
| 96 | ``` | 96 | ``` |
| 97 | - Include header files in common files. | 97 | - Include header files in common files. |
| 98 | 98 | ||
| 99 | - [include/adv_api/kernel_api.h](../../include/adv_api/kernel_api.h) file includes all high-level API header files. Recommend including new API header files in this file, so when calling high-level APIs, only need to include `"kernel_api.h"`. | 99 | + [include/adv_api/kernel_api.h](../../../include/adv_api/kernel_api.h) file includes all high-level API header files. Recommend including new API header files in this file, so when calling high-level APIs, only need to include `"kernel_api.h"`. |
| 100 | ```c++ | 100 | ```c++ |
| 101 | #if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 1001 || __NPU_ARCH__ == 2002 || __NPU_ARCH__ == 2201) | 101 | #if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 1001 || __NPU_ARCH__ == 2002 || __NPU_ARCH__ == 2201) |
| 102 | // ... | 102 | // ... |
| @@ -105,7 +105,7 @@ $$ | |||
| 105 | #endif // __NPU_ARCH__ == 1001 || __NPU_ARCH__ == 2002 || __NPU_ARCH__ == 2201 | 105 | #endif // __NPU_ARCH__ == 1001 || __NPU_ARCH__ == 2002 || __NPU_ARCH__ == 2201 |
| 106 | ``` | 106 | ``` |
| 107 | 107 | ||
| 108 | - [include/adv_api/tiling_api.h](../../include/adv_api/tiling_api.h) file includes all high-level API Tiling interface header files. Recommend including new Tiling interface header files in this file, so when calling high-level API Tiling functions, only need to include `"tiling_api.h"`. | 108 | + [include/adv_api/tiling_api.h](../../../include/adv_api/tiling_api.h) file includes all high-level API Tiling interface header files. Recommend including new Tiling interface header files in this file, so when calling high-level API Tiling functions, only need to include `"tiling_api.h"`. |
| 109 | ```c++ | 109 | ```c++ |
| 110 | #include "math/axpy_tiling.h" | 110 | #include "math/axpy_tiling.h" |
| 111 | ``` | 111 | ``` |
| @@ -113,7 +113,7 @@ $$ | |||
| 113 | #### Write API Internal Implementation | 113 | #### Write API Internal Implementation |
| 114 | - Kernel Function Side Implementation | 114 | - Kernel Function Side Implementation |
| 115 | 115 | ||
| 116 | - In the kernel function interface implementation path [impl/adv_api/detail](../../impl/adv_api/detail), add a new `axpy` directory under the corresponding category directory (`math` in this case). In this directory, add new interface implementation file [axpy_common_impl.h](../../impl/adv_api/detail/math/axpy/axpy_common_impl.h), then write interface implementation code in this implementation file. | 116 | + In the kernel function interface implementation path [impl/adv_api/detail](../../../impl/adv_api/detail), add a new `axpy` directory under the corresponding category directory (`math` in this case). In this directory, add new interface implementation file [axpy_common_impl.h](../../../impl/adv_api/detail/math/axpy/axpy_common_impl.h), then write interface implementation code in this implementation file. |
| 117 | 117 | ||
| 118 | First, include necessary header files. | 118 | First, include necessary header files. |
| 119 | ```c++ | 119 | ```c++ |
| @@ -217,7 +217,7 @@ $$ | |||
| 217 | ``` | 217 | ``` |
| 218 | - Tiling Side Implementation | 218 | - Tiling Side Implementation |
| 219 | 219 | ||
| 220 | - In Tiling interface implementation file path [impl/adv_api/tiling](../../impl/adv_api/tiling) corresponding category directory (this case is `math`), add new interface implementation file [axpy_tiling_impl.cpp](../../impl/adv_api/tiling/math/axpy_tiling_impl.cpp), then write interface implementation code in this implementation file. | 220 | + In Tiling interface implementation file path [impl/adv_api/tiling](../../../impl/adv_api/tiling) corresponding category directory (this case is `math`), add new interface implementation file [axpy_tiling_impl.cpp](../../../impl/adv_api/tiling/math/axpy_tiling_impl.cpp), then write interface implementation code in this implementation file. |
| 221 | 221 | ||
| 222 | First, include necessary header files. | 222 | First, include necessary header files. |
| 223 | ```c++ | 223 | ```c++ |
| @@ -288,7 +288,7 @@ $$ | |||
| 288 | return AXPY_ONE_REPEAT_BYTE_SIZE * (typeSize == sizeof(float) ? AXPY_FLOAT_CALC_PROC : AXPY_HALF_CALC_PROC); | 288 | return AXPY_ONE_REPEAT_BYTE_SIZE * (typeSize == sizeof(float) ? AXPY_FLOAT_CALC_PROC : AXPY_HALF_CALC_PROC); |
| 289 | } | 289 | } |
| 290 | ``` | 290 | ``` |
| 291 | - After writing Tiling side implementation file, need to include this file in [impl/adv_api/tiling/CMakeLists.txt](../../impl/adv_api/tiling/CMakeLists.txt). Specifically: add file path `${CMAKE_CURRENT_SOURCE_DIR}/math/axpy_tiling_impl.cpp` in `add_library(tiling_api STATIC ...)` statement. | 291 | + After writing Tiling side implementation file, need to include this file in [impl/adv_api/tiling/CMakeLists.txt](../../../impl/adv_api/tiling/CMakeLists.txt). Specifically: add file path `${CMAKE_CURRENT_SOURCE_DIR}/math/axpy_tiling_impl.cpp` in `add_library(tiling_api STATIC ...)` statement. |
| 292 | ## Advanced Development Based on Existing API | 292 | ## Advanced Development Based on Existing API |
| 293 | If developers perform advanced feature development based on existing APIs in current repository, the design API process is the same as described above. When developing code, consider reloading existing function implementations or adding new code branches. Based on advanced feature algorithm function, determine needed basic APIs and complete coding. For example, if existing API does not support some data types, suppose Axpy does not support destination operand element as float type, then need to overload `AxpyIntrinsicsImpl` function to implement dstTensor data type as float function. | 293 | If developers perform advanced feature development based on existing APIs in current repository, the design API process is the same as described above. When developing code, consider reloading existing function implementations or adding new code branches. Based on advanced feature algorithm function, determine needed basic APIs and complete coding. For example, if existing API does not support some data types, suppose Axpy does not support destination operand element as float type, then need to overload `AxpyIntrinsicsImpl` function to implement dstTensor data type as float function. |
| 294 | ```c++ | 294 | ```c++ |
| @@ -318,7 +318,7 @@ UT testing uses gTest as testing framework, generally verifies interface compila | |||
| 318 | ##### UT Coding | 318 | ##### UT Coding |
| 319 | ###### Kernel Function Side | 319 | ###### Kernel Function Side |
| 320 | 320 | ||
| 321 | -In UT directory [tests/api/adv_api/math](../../tests/api/adv_api/math), add new directory `axpy`, file [test_operator_axpy.cpp](../../tests/api/adv_api/math/axpy/test_operator_axpy.cpp). UT implementation mainly includes the following three parts: | 321 | +In UT directory [tests/api/adv_api/math](../../../tests/api/adv_api/math), add new directory `axpy`, file [test_operator_axpy.cpp](../../../tests/api/adv_api/math/axpy/test_operator_axpy.cpp). UT implementation mainly includes the following three parts: |
| 322 | 1. Include header files | 322 | 1. Include header files |
| 323 | ```c++ | 323 | ```c++ |
| 324 | #include <gtest/gtest.h> | 324 | #include <gtest/gtest.h> |
| @@ -412,7 +412,7 @@ In UT directory [tests/api/adv_api/math](../../tests/api/adv_api/math), add new | |||
| 412 | ``` | 412 | ``` |
| 413 | ###### Tiling Side | 413 | ###### Tiling Side |
| 414 | 414 | ||
| 415 | -Tiling interface UT is currently unified in [tests/api/adv_api/tiling/test_tiling.cpp](../../tests/api/adv_api/tiling/test_tiling.cpp) file. Add corresponding test function in this file. | 415 | +Tiling interface UT is currently unified in [tests/api/adv_api/tiling/test_tiling.cpp](../../../tests/api/adv_api/tiling/test_tiling.cpp) file. Add corresponding test function in this file. |
| 416 | ```c++ | 416 | ```c++ |
| 417 | TEST_F(TestTiling, TestAxpyTiling) | 417 | TEST_F(TestTiling, TestAxpyTiling) |
| 418 | { | 418 | { |
| @@ -427,7 +427,7 @@ TEST_F(TestTiling, TestAxpyTiling) | |||
| 427 | } | 427 | } |
| 428 | ``` | 428 | ``` |
| 429 | ##### Modify cmake file | 429 | ##### Modify cmake file |
| 430 | -Before executing UT cases, modify the [CMakeLists.txt](../../tests/api/adv_api/CMakeLists.txt) file. Since kernel function-side UTs and Tiling-side UTs have different test targets, add the test files to their respective targets. Using the kernel function-side UT for Atlas A2 training series products/Atlas A2 inference series products as an example, add the UT test file path to the case source file list `ASCENDC_TEST_ASCEND910B1_AIV_CASE_SRC_PART_FILES`, that is, add the new file path `${ASCENDC_TESTS_DIR}/math/axpy/test_operator_axpy.cpp`. For the Tiling-side UT, add the test file to the `ASCENDC_TILING_TEST_SRC_FILES` list. | 430 | +Before executing UT cases, modify the [CMakeLists.txt](../../../tests/api/adv_api/CMakeLists.txt) file. Since kernel function-side UTs and Tiling-side UTs have different test targets, add the test files to their respective targets. Using the kernel function-side UT for Atlas A2 training series products/Atlas A2 inference series products as an example, add the UT test file path to the case source file list `ASCENDC_TEST_ASCEND910B1_AIV_CASE_SRC_PART_FILES`, that is, add the new file path `${ASCENDC_TESTS_DIR}/math/axpy/test_operator_axpy.cpp`. For the Tiling-side UT, add the test file to the `ASCENDC_TILING_TEST_SRC_FILES` list. |
| 431 | ##### Execute UT | 431 | ##### Execute UT |
| 432 | - Execute all UT cases | 432 | - Execute all UT cases |
| 433 | 433 | ||
| @@ -437,11 +437,11 @@ Before executing UT cases, modify the [CMakeLists.txt](../../tests/api/adv_api/C | |||
| 437 | ``` | 437 | ``` |
| 438 | - Run only new UT cases | 438 | - Run only new UT cases |
| 439 | 439 | ||
| 440 | - Open [tests/main_global.cpp](../../tests/main_global.cpp) file, add the following code in the last line before return in main function. Use gTest filter to filter test cases based on unit test unit name. | 440 | + Open [tests/main_global.cpp](../../../tests/main_global.cpp) file, add the following code in the last line before return in main function. Use gTest filter to filter test cases based on unit test unit name. |
| 441 | ```c++ | 441 | ```c++ |
| 442 | ::testing::GTEST_FLAG(filter) = "*Axpy*"; | 442 | ::testing::GTEST_FLAG(filter) = "*Axpy*"; |
| 443 | ``` | 443 | ``` |
| 444 | - Modify [build.sh](../../build.sh), change all to needed UT target. Using the Ascend 910B1 kernel function-side UT as an example, the target is ascendc_ut_adv_api_kernel_ascend910B1_AIV. | 444 | + Modify [build.sh](../../../build.sh), change all to needed UT target. Using the Ascend 910B1 kernel function-side UT as an example, the target is ascendc_ut_adv_api_kernel_ascend910B1_AIV. |
| 445 | ```bash | 445 | ```bash |
| 446 | function build_test() { | 446 | function build_test() { |
| 447 | cmake_config | 447 | cmake_config |
| @@ -454,11 +454,11 @@ Before executing UT cases, modify the [CMakeLists.txt](../../tests/api/adv_api/C | |||
| 454 | After completing high-level API coding, test API functionality by implementing operator function and calling the API in the operator. Refer to the following steps. | 454 | After completing high-level API coding, test API functionality by implementing operator function and calling the API in the operator. Refer to the following steps. |
| 455 | - Compile and install. | 455 | - Compile and install. |
| 456 | 456 | ||
| 457 | - Compile and install new or modified API source code to environment. For specific method, refer to [Compile and Install](./quick_start.md#compile&install). | 457 | + Compile and install new or modified API source code to environment. For specific method, refer to [Compile and Install](../quick_start.md#compile&install). |
| 458 | - Create simple custom operator project and test. | 458 | - Create simple custom operator project and test. |
| 459 | 459 | ||
| 460 | Custom develop operator, after creating simple custom operator project, test API functionality by calling single operator. For detailed content about operator development and simple custom operator project, refer to [Ascend C Programming Guide](https://www.hiascend.com/document/redirect/CannCommunityOpdevAscendC). | 460 | Custom develop operator, after creating simple custom operator project, test API functionality by calling single operator. For detailed content about operator development and simple custom operator project, refer to [Ascend C Programming Guide](https://www.hiascend.com/document/redirect/CannCommunityOpdevAscendC). |
| 461 | 461 | ||
| 462 | 462 | ||
| 463 | ## Merge Code | 463 | ## Merge Code |
| 464 | -When developers complete high-level API coding and testing, please refer to [Contribution Guide](../../CONTRIBUTING_en.md) to merge code into this repository. | 464 | +When developers complete high-level API coding and testing, please refer to [Contribution Guide](../../../CONTRIBUTING_en.md) to merge code into this repository. |
| @@ -46,7 +46,7 @@ If you have practical experience with Ascend C operator performance optimization | |||
| 46 | 46 | ||
| 47 | ## Writing Conventions | 47 | ## Writing Conventions |
| 48 | 48 | ||
| 49 | -Ascend C documentation follows the three-dimensional requirements defined in the [Ascend C Documentation Design Principles](./asc_doc_design_rules.md): discoverability, readability, and completeness. Below are specific conventions for common writing scenarios. | 49 | +Ascend C documentation follows the three-dimensional requirements defined in the [Ascend C Documentation Design Principles](../asc_doc_design_rules.md): discoverability, readability, and completeness. Below are specific conventions for common writing scenarios. |
| 50 | 50 | ||
| 51 | ### General Conventions | 51 | ### General Conventions |
| 52 | 52 | ||
| @@ -121,7 +121,7 @@ The API Reference Manual is the **interface detail authority source**. Each API | |||
| 121 | | 9 | Key Feature Description | Conditionally required | Matrix/vector computation APIs involving key hardware features such as HF32, GEMV, or UnitFlag must include corresponding feature descriptions; simple APIs may omit this section | | 121 | | 9 | Key Feature Description | Conditionally required | Matrix/vector computation APIs involving key hardware features such as HF32, GEMV, or UnitFlag must include corresponding feature descriptions; simple APIs may omit this section | |
| 122 | | 10 | Code Example | ✅ Required | Provides a code snippet and a link to the sample repository when a corresponding sample exists; the link may be omitted when no sample is available | | 122 | | 10 | Code Example | ✅ Required | Provides a code snippet and a link to the sample repository when a corresponding sample exists; the link may be omitted when no sample is available | |
| 123 | 123 | ||
| 124 | -For detailed writing requirements for each section, see the [Ascend C API Writing Guidelines](./asc_api_writing_guidelines.md). | 124 | +For detailed writing requirements for each section, see the [Ascend C API Writing Guidelines](../asc_api_writing_guidelines.md). |
| 125 | 125 | ||
| 126 | --- | 126 | --- |
| 127 | 127 | ||
| @@ -251,7 +251,7 @@ Refer to existing cases under `operator_practice/best_practices/` (e.g., FlashAt | |||
| 251 | Before submitting a documentation PR, check each item: | 251 | Before submitting a documentation PR, check each item: |
| 252 | 252 | ||
| 253 | **Content Accuracy**: | 253 | **Content Accuracy**: |
| 254 | -- [ ] All hardware parameter values (capacity, granularity, range) are consistent with [Architecture Specifications](../../docs/zh/guide/programming_guide/advanced_programming/hardware_implementation/architecture_spec/architecture_spec.md) | 254 | +- [ ] All hardware parameter values (capacity, granularity, range) are consistent with [Architecture Specifications](../../../docs/zh/guide/programming_guide/advanced_programming/hardware_implementation/architecture_spec/architecture_spec.md) |
| 255 | - [ ] "Fixed value" and other absolute descriptions have been verified (many "fixed values" are actually determined by configuration parameters) | 255 | - [ ] "Fixed value" and other absolute descriptions have been verified (many "fixed values" are actually determined by configuration parameters) |
| 256 | - [ ] Data path descriptions match actual routes (no contradictions with other documents) | 256 | - [ ] Data path descriptions match actual routes (no contradictions with other documents) |
| 257 | 257 | ||
| @@ -257,7 +257,7 @@ Neg_ISASI.md的内容如下: | |||
| 257 | 257 | ||
| 258 | 【级别】强制 | 258 | 【级别】强制 |
| 259 | 259 | ||
| 260 | -【描述】每个接口的md文件须按如下顺序组织章节(均为二级标题),其中数据类型、关键特性、需要包含的头文件章节可视接口实际情况选填。例如高阶API中的Sin接口,其不同芯片支持的数据类型相同,无需单独章节描述差异,可随参数说明一并描述。例如基础API统一在功能说明中描述需要包含的头文件,可以不需要"需要包含的头文件"章节。同一类API的章节结构应保持统一。 | 260 | +【描述】每个接口的md文件须按如下顺序组织章节(均为二级标题),其中数据类型、关键特性章节可视接口实际情况选填。例如高阶API中的Sin接口,其不同芯片支持的数据类型相同,无需单独章节描述差异,可随参数说明一并描述。同一类API的章节结构应保持统一。 |
| 261 | 261 | ||
| 262 | ```text | 262 | ```text |
| 263 | 产品支持情况 | 263 | 产品支持情况 |
| @@ -267,7 +267,6 @@ Neg_ISASI.md的内容如下: | |||
| 267 | 数据类型 | 267 | 数据类型 |
| 268 | 返回值说明 | 268 | 返回值说明 |
| 269 | 约束说明 | 269 | 约束说明 |
| 270 | -需要包含的头文件 | ||
| 271 | 关键特性说明 | 270 | 关键特性说明 |
| 272 | 调用示例 | 271 | 调用示例 |
| 273 | ``` | 272 | ``` |
| @@ -389,13 +388,12 @@ Neg_ISASI.md的内容如下: | |||
| 389 | 388 | ||
| 390 | 【级别】强制 | 389 | 【级别】强制 |
| 391 | 390 | ||
| 392 | -【描述】须提供接口所在的头文件及使用该接口时需包含的头文件。若在前文章节已按API分类有总体介绍或者有单独章节介绍,功能说明中则无需重复介绍。头文件路径用反引号包裹。 | 391 | +【描述】须提供接口所在的头文件及使用该接口时需包含的头文件。若在前文章节已按API分类有总体介绍,功能说明中则无需重复介绍。头文件路径用反引号包裹。 |
| 393 | 392 | ||
| 394 | 【正例】 | 393 | 【正例】 |
| 395 | 头文件路径为:`"basic_api/kernel_operator_vec_binary_intf.h"`。 | 394 | 头文件路径为:`"basic_api/kernel_operator_vec_binary_intf.h"`。 |
| 396 | 395 | ||
| 397 | -【例外】 | 396 | +【例外】 |
| 398 | -- 如果有单独的章节“需要包含的头文件”单独说明需要包含的头文件,此处无需列出。 | ||
| 399 | - 如果在上文章节统一说明一类接口需要包含的头文件,此处无需列出。 | 397 | - 如果在上文章节统一说明一类接口需要包含的头文件,此处无需列出。 |
| 400 | 398 | ||
| 401 | ### API-FUNC-02 引入新概念时须增加必要的解释或者增加至相关概念的超链接 | 399 | ### API-FUNC-02 引入新概念时须增加必要的解释或者增加至相关概念的超链接 |
| @@ -23,9 +23,9 @@ | |||
| 23 | ## 相关文档 | 23 | ## 相关文档 |
| 24 | 24 | ||
| 25 | - [CONTRIBUTING.md](../../../CONTRIBUTING.md) — 贡献总流程 | 25 | - [CONTRIBUTING.md](../../../CONTRIBUTING.md) — 贡献总流程 |
| 26 | -- [asc_adv_api_contributing.md](../asc_adv_api_contributing.md) — 高阶API开发流程 | 26 | +- [asc_adv_api_contributing.md](./asc_adv_api_contributing.md) — 高阶API开发流程 |
| 27 | -- [asc_basic_api_contributing.md](../asc_basic_api_contributing.md) — 基础API开发流程 | 27 | +- [asc_basic_api_contributing.md](./asc_basic_api_contributing.md) — 基础API开发流程 |
| 28 | -- [asc_c_api_contributing.md](../asc_c_api_contributing.md) — C API开发流程 | 28 | +- [asc_c_api_contributing.md](./asc_c_api_contributing.md) — C API开发流程 |
| 29 | -- [asc_doc_contributing.md](../asc_doc_contributing.md) — 文档贡献流程 | 29 | +- [asc_doc_contributing.md](./asc_doc_contributing.md) — 文档贡献流程 |
| 30 | 30 | ||
| 31 | --- | 31 | --- |
| @@ -19,7 +19,7 @@ Ascend C高阶API的开发流程主要包括如下步骤: | |||
| 19 | - 单算子测试 | 19 | - 单算子测试 |
| 20 | --- | 20 | --- |
| 21 | ## 自定义开发全新API | 21 | ## 自定义开发全新API |
| 22 | -下面以高阶API `Axpy`为例,介绍如何从零开始,开发一个高阶API。本案例删除了部分非必要代码,您可以在代码仓的[axpy.h](../../include/adv_api/math/axpy.h)、[axpy_tiling.h](../../include/adv_api/math/axpy_tiling.h)、[axpy_tiling_intf.h](../../include/adv_api/math/axpy_tiling_intf.h)、[axpy_common_impl.h](../../impl/adv_api/detail/math/axpy/axpy_common_impl.h)、[axpy_tiling_impl.cpp](../../impl/adv_api/tiling/math/axpy_tiling_impl.cpp)文件中查看全部代码。 | 22 | +下面以高阶API `Axpy`为例,介绍如何从零开始,开发一个高阶API。本案例删除了部分非必要代码,您可以在代码仓的[axpy.h](../../../include/adv_api/math/axpy.h)、[axpy_tiling.h](../../../include/adv_api/math/axpy_tiling.h)、[axpy_tiling_intf.h](../../../include/adv_api/math/axpy_tiling_intf.h)、[axpy_common_impl.h](../../../impl/adv_api/detail/math/axpy/axpy_common_impl.h)、[axpy_tiling_impl.cpp](../../../impl/adv_api/tiling/math/axpy_tiling_impl.cpp)文件中查看全部代码。 |
| 23 | ### 设计API | 23 | ### 设计API |
| 24 | axpy的功能为源操作数`srcTensor`中每个元素与标量求积后,与目的操作数`dstTensor`中的对应元素相加,计算公式如下。 | 24 | axpy的功能为源操作数`srcTensor`中每个元素与标量求积后,与目的操作数`dstTensor`中的对应元素相加,计算公式如下。 |
| 25 | 25 | ||
| @@ -77,7 +77,7 @@ $$ | |||
| 77 | #### 编写API对外接口 | 77 | #### 编写API对外接口 |
| 78 | - 核函数(Kernel)侧接口 | 78 | - 核函数(Kernel)侧接口 |
| 79 | 79 | ||
| 80 | - 在`include/adv_api/`对应分类的目录下,新增[axpy.h](../../include/adv_api/math/axpy.h)文件。根据上述分析设计的API函数原型,编写对外接口的代码,函数实现中调用AxpyImpl的实现。 | 80 | + 在`include/adv_api/`对应分类的目录下,新增[axpy.h](../../../include/adv_api/math/axpy.h)文件。根据上述分析设计的API函数原型,编写对外接口的代码,函数实现中调用AxpyImpl的实现。 |
| 81 | ```c++ | 81 | ```c++ |
| 82 | template <typename T, typename U, bool isReuseSource = false> | 82 | template <typename T, typename U, bool isReuseSource = false> |
| 83 | __aicore__ inline void Axpy(const LocalTensor<T>& dstTensor, const LocalTensor<U>& srcTensor, const U scalarValue, | 83 | __aicore__ inline void Axpy(const LocalTensor<T>& dstTensor, const LocalTensor<U>& srcTensor, const U scalarValue, |
| @@ -88,7 +88,7 @@ $$ | |||
| 88 | ``` | 88 | ``` |
| 89 | - Tiling侧接口 | 89 | - Tiling侧接口 |
| 90 | 90 | ||
| 91 | - 在`include/adv_api/`对应分类的目录下,新增[axpy_tiling.h](../../include/adv_api/math/axpy_tiling.h)文件。根据上述分析设计的Tiling侧接口,编写函数声明。 | 91 | + 在`include/adv_api/`对应分类的目录下,新增[axpy_tiling.h](../../../include/adv_api/math/axpy_tiling.h)文件。根据上述分析设计的Tiling侧接口,编写函数声明。 |
| 92 | ```c++ | 92 | ```c++ |
| 93 | #include "../utils/types.h" | 93 | #include "../utils/types.h" |
| 94 | 94 | ||
| @@ -96,7 +96,7 @@ $$ | |||
| 96 | ``` | 96 | ``` |
| 97 | - 在公共文件中引入头文件。 | 97 | - 在公共文件中引入头文件。 |
| 98 | 98 | ||
| 99 | - [include/adv_api/kernel_api.h](../../include/adv_api/kernel_api.h)文件中包含了所有高阶API头文件,建议在该文件中引入新增API的头文件,这样在调用高阶API时,只需要引入`"kernel_api.h"`。 | 99 | + [include/adv_api/kernel_api.h](../../../include/adv_api/kernel_api.h)文件中包含了所有高阶API头文件,建议在该文件中引入新增API的头文件,这样在调用高阶API时,只需要引入`"kernel_api.h"`。 |
| 100 | ```c++ | 100 | ```c++ |
| 101 | #if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 1001 || __NPU_ARCH__ == 2002 || __NPU_ARCH__ == 2201) | 101 | #if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 1001 || __NPU_ARCH__ == 2002 || __NPU_ARCH__ == 2201) |
| 102 | // ... | 102 | // ... |
| @@ -105,7 +105,7 @@ $$ | |||
| 105 | #endif // __NPU_ARCH__ == 1001 || __NPU_ARCH__ == 2002 || __NPU_ARCH__ == 2201 | 105 | #endif // __NPU_ARCH__ == 1001 || __NPU_ARCH__ == 2002 || __NPU_ARCH__ == 2201 |
| 106 | ``` | 106 | ``` |
| 107 | 107 | ||
| 108 | - [include/adv_api/tiling_api.h](../../include/adv_api/tiling_api.h)文件中包含了所有高阶API的TIling接口头文件,建议在该文件中引入新增的Tiling接口头文件,这样在调用高阶API的Tiling函数时,只需要引入`"tiling_api.h"`。 | 108 | + [include/adv_api/tiling_api.h](../../../include/adv_api/tiling_api.h)文件中包含了所有高阶API的TIling接口头文件,建议在该文件中引入新增的Tiling接口头文件,这样在调用高阶API的Tiling函数时,只需要引入`"tiling_api.h"`。 |
| 109 | ```c++ | 109 | ```c++ |
| 110 | #include "math/axpy_tiling.h" | 110 | #include "math/axpy_tiling.h" |
| 111 | ``` | 111 | ``` |
| @@ -113,7 +113,7 @@ $$ | |||
| 113 | #### 编写API内部实现 | 113 | #### 编写API内部实现 |
| 114 | - 核函数(Kernel)侧实现 | 114 | - 核函数(Kernel)侧实现 |
| 115 | 115 | ||
| 116 | - 在核函数(Kernel)接口实现文件路径[impl/adv_api/detail](../../impl/adv_api/detail)的相应类别目录(本案例为`math`)下新增`axpy`目录,在该目录下新增接口实现文件[axpy_common_impl.h](../../impl/adv_api/detail/math/axpy/axpy_common_impl.h),然后在该实现文件中编写接口实现代码。 | 116 | + 在核函数(Kernel)接口实现文件路径[impl/adv_api/detail](../../../impl/adv_api/detail)的相应类别目录(本案例为`math`)下新增`axpy`目录,在该目录下新增接口实现文件[axpy_common_impl.h](../../../impl/adv_api/detail/math/axpy/axpy_common_impl.h),然后在该实现文件中编写接口实现代码。 |
| 117 | 117 | ||
| 118 | 首先,引入必要的头文件。 | 118 | 首先,引入必要的头文件。 |
| 119 | ```c++ | 119 | ```c++ |
| @@ -217,7 +217,7 @@ $$ | |||
| 217 | ``` | 217 | ``` |
| 218 | - Tiling侧实现 | 218 | - Tiling侧实现 |
| 219 | 219 | ||
| 220 | - 在Tiling接口实现文件路径[impl/adv_api/tiling](../../impl/adv_api/tiling)的相应类别目录(本案例为`math`)下新增接口实现文件[axpy_tiling_impl.cpp](../../impl/adv_api/tiling/math/axpy_tiling_impl.cpp),然后在该实现文件中编写接口实现代码。 | 220 | + 在Tiling接口实现文件路径[impl/adv_api/tiling](../../../impl/adv_api/tiling)的相应类别目录(本案例为`math`)下新增接口实现文件[axpy_tiling_impl.cpp](../../../impl/adv_api/tiling/math/axpy_tiling_impl.cpp),然后在该实现文件中编写接口实现代码。 |
| 221 | 221 | ||
| 222 | 首先,引入必要的头文件。 | 222 | 首先,引入必要的头文件。 |
| 223 | ```c++ | 223 | ```c++ |
| @@ -288,7 +288,7 @@ $$ | |||
| 288 | return AXPY_ONE_REPEAT_BYTE_SIZE * (typeSize == sizeof(float) ? AXPY_FLOAT_CALC_PROC : AXPY_HALF_CALC_PROC); | 288 | return AXPY_ONE_REPEAT_BYTE_SIZE * (typeSize == sizeof(float) ? AXPY_FLOAT_CALC_PROC : AXPY_HALF_CALC_PROC); |
| 289 | } | 289 | } |
| 290 | ``` | 290 | ``` |
| 291 | - 编写完Tiling侧实现文件后,需要在[impl/adv_api/tiling/CMakeLists.txt](../../impl/adv_api/tiling/CMakeLists.txt)中引入该文件。具体方式为:在`add_library(tiling_api STATIC ...)`语句中新增文件路径`${CMAKE_CURRENT_SOURCE_DIR}/math/axpy_tiling_impl.cpp`。 | 291 | + 编写完Tiling侧实现文件后,需要在[impl/adv_api/tiling/CMakeLists.txt](../../../impl/adv_api/tiling/CMakeLists.txt)中引入该文件。具体方式为:在`add_library(tiling_api STATIC ...)`语句中新增文件路径`${CMAKE_CURRENT_SOURCE_DIR}/math/axpy_tiling_impl.cpp`。 |
| 292 | ## 基于原有API进阶开发 | 292 | ## 基于原有API进阶开发 |
| 293 | 若开发者基于当前仓库已有的API进行进阶特性开发,设计API的过程与前述内容相同。开发代码时,考虑对原有函数实现重载或新增代码分支,根据进阶特性的算法功能,确定需要使用的基础API,并完成编码。例如,原有API对部分数据类型不支持,假设Axpy不支持目的操作数元素为float类型,那么就需要对`AxpyIntrinsicsImpl`函数进行重载,实现dstTensor数据类型为float的函数功能。 | 293 | 若开发者基于当前仓库已有的API进行进阶特性开发,设计API的过程与前述内容相同。开发代码时,考虑对原有函数实现重载或新增代码分支,根据进阶特性的算法功能,确定需要使用的基础API,并完成编码。例如,原有API对部分数据类型不支持,假设Axpy不支持目的操作数元素为float类型,那么就需要对`AxpyIntrinsicsImpl`函数进行重载,实现dstTensor数据类型为float的函数功能。 |
| 294 | ```c++ | 294 | ```c++ |
| @@ -318,7 +318,7 @@ UT测试使用gTest作为测试框架,一般验证接口编译是否正常, | |||
| 318 | ##### UT编码 | 318 | ##### UT编码 |
| 319 | ###### 核函数(Kernel)侧 | 319 | ###### 核函数(Kernel)侧 |
| 320 | 320 | ||
| 321 | -在UT目录[tests/api/adv_api/math](../../tests/api/adv_api/math)下新增目录`axpy`、文件[test_operator_axpy.cpp](../../tests/api/adv_api/math/axpy/test_operator_axpy.cpp)。UT实现主要包括如下三部分: | 321 | +在UT目录[tests/api/adv_api/math](../../../tests/api/adv_api/math)下新增目录`axpy`、文件[test_operator_axpy.cpp](../../../tests/api/adv_api/math/axpy/test_operator_axpy.cpp)。UT实现主要包括如下三部分: |
| 322 | 1. 引入头文件 | 322 | 1. 引入头文件 |
| 323 | ```c++ | 323 | ```c++ |
| 324 | #include <gtest/gtest.h> | 324 | #include <gtest/gtest.h> |
| @@ -412,7 +412,7 @@ UT测试使用gTest作为测试框架,一般验证接口编译是否正常, | |||
| 412 | ``` | 412 | ``` |
| 413 | ###### Tiling侧 | 413 | ###### Tiling侧 |
| 414 | 414 | ||
| 415 | -Tiling接口的UT目前统一在[tests/api/adv_api/tiling/test_tiling.cpp](../../tests/api/adv_api/tiling/test_tiling.cpp)文件中,在该文件中添加相应测试函数即可。 | 415 | +Tiling接口的UT目前统一在[tests/api/adv_api/tiling/test_tiling.cpp](../../../tests/api/adv_api/tiling/test_tiling.cpp)文件中,在该文件中添加相应测试函数即可。 |
| 416 | ```c++ | 416 | ```c++ |
| 417 | TEST_F(TestTiling, TestAxpyTiling) | 417 | TEST_F(TestTiling, TestAxpyTiling) |
| 418 | { | 418 | { |
| @@ -427,7 +427,7 @@ TEST_F(TestTiling, TestAxpyTiling) | |||
| 427 | } | 427 | } |
| 428 | ``` | 428 | ``` |
| 429 | ##### 修改cmake文件 | 429 | ##### 修改cmake文件 |
| 430 | -在执行UT用例前,需要修改[CMakeLists.txt](../../tests/api/adv_api/CMakeLists.txt)文件,由于核函数(Kernel)侧和Tiling侧的UT执行对象不同,需要在不同的target下添加测试文件。以核函数(Kernel)侧验证Atlas A2 训练系列产品/Atlas A2 推理系列产品的UT为例,将UT测试文件路径添加到用例的源文件列表`ASCENDC_TEST_ASCEND910B1_AIV_CASE_SRC_PART_FILES`中,即新增文件路径`${ASCENDC_TESTS_DIR}/math/axpy/test_operator_axpy.cpp`。Tiling侧同理,需要将测试文件添加到`ASCENDC_TILING_TEST_SRC_FILES`列表。 | 430 | +在执行UT用例前,需要修改[CMakeLists.txt](../../../tests/api/adv_api/CMakeLists.txt)文件,由于核函数(Kernel)侧和Tiling侧的UT执行对象不同,需要在不同的target下添加测试文件。以核函数(Kernel)侧验证Atlas A2 训练系列产品/Atlas A2 推理系列产品的UT为例,将UT测试文件路径添加到用例的源文件列表`ASCENDC_TEST_ASCEND910B1_AIV_CASE_SRC_PART_FILES`中,即新增文件路径`${ASCENDC_TESTS_DIR}/math/axpy/test_operator_axpy.cpp`。Tiling侧同理,需要将测试文件添加到`ASCENDC_TILING_TEST_SRC_FILES`列表。 |
| 431 | ##### 执行UT | 431 | ##### 执行UT |
| 432 | - 执行全量UT用例 | 432 | - 执行全量UT用例 |
| 433 | 433 | ||
| @@ -437,11 +437,11 @@ TEST_F(TestTiling, TestAxpyTiling) | |||
| 437 | ``` | 437 | ``` |
| 438 | - 仅运行新增UT用例 | 438 | - 仅运行新增UT用例 |
| 439 | 439 | ||
| 440 | - 打开[tests/main_global.cpp](../../tests/main_global.cpp)文件,在main函数中return前的最后一行添加下面的代码,利用gTest的过滤器根据单元测试的单元名字过滤测试用例。 | 440 | + 打开[tests/main_global.cpp](../../../tests/main_global.cpp)文件,在main函数中return前的最后一行添加下面的代码,利用gTest的过滤器根据单元测试的单元名字过滤测试用例。 |
| 441 | ```c++ | 441 | ```c++ |
| 442 | ::testing::GTEST_FLAG(filter) = "*Axpy*"; | 442 | ::testing::GTEST_FLAG(filter) = "*Axpy*"; |
| 443 | ``` | 443 | ``` |
| 444 | - 修改[build.sh](../../build.sh),将all修改为需要执行的UT target,以执行核函数(Kernel)侧Ascend 910B1的UT为例,target即为ascendc_ut_adv_api_kernel_ascend910B1_AIV。 | 444 | + 修改[build.sh](../../../build.sh),将all修改为需要执行的UT target,以执行核函数(Kernel)侧Ascend 910B1的UT为例,target即为ascendc_ut_adv_api_kernel_ascend910B1_AIV。 |
| 445 | ```bash | 445 | ```bash |
| 446 | function build_test() { | 446 | function build_test() { |
| 447 | cmake_config | 447 | cmake_config |
| @@ -454,11 +454,11 @@ TEST_F(TestTiling, TestAxpyTiling) | |||
| 454 | 完成高阶API编码后,通过实现算子功能,在算子中调用该API,来测试API的功能,具体参考如下步骤。 | 454 | 完成高阶API编码后,通过实现算子功能,在算子中调用该API,来测试API的功能,具体参考如下步骤。 |
| 455 | - 编译安装。 | 455 | - 编译安装。 |
| 456 | 456 | ||
| 457 | - 将新增或修改的API源码编译并安装到环境中,具体方式请参考[编译安装](./quick_start.md#compile&install)。 | 457 | + 将新增或修改的API源码编译并安装到环境中,具体方式请参考[编译安装](../quick_start.md#compile&install)。 |
| 458 | - 创建简易自定义算子工程并测试。 | 458 | - 创建简易自定义算子工程并测试。 |
| 459 | 459 | ||
| 460 | 自定义开发算子,创建简易自定义算子工程后,通过调用单算子测试API功能。关于算子开发和简易自定义算子工程的详细内容请参考[Ascend C编程指南](https://www.hiascend.com/document/redirect/CannCommunityOpdevAscendC)。 | 460 | 自定义开发算子,创建简易自定义算子工程后,通过调用单算子测试API功能。关于算子开发和简易自定义算子工程的详细内容请参考[Ascend C编程指南](https://www.hiascend.com/document/redirect/CannCommunityOpdevAscendC)。 |
| 461 | 461 | ||
| 462 | 462 | ||
| 463 | ## 合入代码 | 463 | ## 合入代码 |
| 464 | -当开发者完成高阶API的编码和测试后,请参考[贡献指南](../../CONTRIBUTING.md)将代码合入本仓库。 | 464 | +当开发者完成高阶API的编码和测试后,请参考[贡献指南](../../../CONTRIBUTING.md)将代码合入本仓库。 |
| @@ -12,7 +12,7 @@ Ascend C资料体系包含五份核心文档,开发者可以通过提交PR对 | |||
| 12 | | 算子实践参考 | 算子实现、性能优化、调优案例 | `docs/zh/guide/operator_practice/` | | 12 | | 算子实践参考 | 算子实现、性能优化、调优案例 | `docs/zh/guide/operator_practice/` | |
| 13 | | 跨代迁移兼容性指南 | API兼容策略、架构变更映射、迁移步骤 | `docs/zh/guide/cross_gen_migration_guide/` | | 13 | | 跨代迁移兼容性指南 | API兼容策略、架构变更映射、迁移步骤 | `docs/zh/guide/cross_gen_migration_guide/` | |
| 14 | 14 | ||
| 15 | -在阅读本文档前,请确保您已了解昇腾AI处理器硬件架构。零基础开发者推荐先阅读[入门教程](./guide/getting_started/ascend_c_overview_and_learning_path.md);已有基础的开发者推荐先阅读[Ascend C编程指南](https://www.hiascend.com/document/redirect/CannCommunityOpdevAscendC)。 | 15 | +在阅读本文档前,请确保您已了解昇腾AI处理器硬件架构。零基础开发者推荐先阅读[入门教程](../guide/getting_started/ascend_c_overview_and_learning_path.md);已有基础的开发者推荐先阅读[Ascend C编程指南](https://www.hiascend.com/document/redirect/CannCommunityOpdevAscendC)。 |
| 16 | 16 | ||
| 17 | --- | 17 | --- |
| 18 | 18 | ||
| @@ -46,7 +46,7 @@ Ascend C资料体系包含五份核心文档,开发者可以通过提交PR对 | |||
| 46 | 46 | ||
| 47 | ## 编写规范 | 47 | ## 编写规范 |
| 48 | 48 | ||
| 49 | -Ascend C资料遵循[《Ascend C资料设计规范》](./asc_doc_design_rules.md)的三个维度要求:可获取性、可读性、完备性。以下是针对常见编写场景的具体规范。 | 49 | +Ascend C资料遵循[《Ascend C资料设计规范》](../asc_doc_design_rules.md)的三个维度要求:可获取性、可读性、完备性。以下是针对常见编写场景的具体规范。 |
| 50 | 50 | ||
| 51 | ### 通用规范 | 51 | ### 通用规范 |
| 52 | 52 | ||
| @@ -121,7 +121,7 @@ API参考手册是**接口详情权威源**,每个API页面必须包含以下 | |||
| 121 | | 9 | 关键特性说明 | 条件必须 | 矩阵/向量计算类API如涉及关键硬件特性(HF32、GEMV、UnitFlag等),须有对应特性说明节;简单API可省略 | | 121 | | 9 | 关键特性说明 | 条件必须 | 矩阵/向量计算类API如涉及关键硬件特性(HF32、GEMV、UnitFlag等),须有对应特性说明节;简单API可省略 | |
| 122 | | 10 | 调用示例 | ✅ 必须 | 代码片段示例 + 链接到样例库(如有对应样例,如果接口没有对应样例可省略链接) | | 122 | | 10 | 调用示例 | ✅ 必须 | 代码片段示例 + 链接到样例库(如有对应样例,如果接口没有对应样例可省略链接) | |
| 123 | 123 | ||
| 124 | -各个结构的详细写作规范请阅读[Ascend C API写作规范](./asc_api_writing_guidelines.md)。 | 124 | +各个结构的详细写作规范请阅读[Ascend C API写作规范](../asc_api_writing_guidelines.md)。 |
| 125 | 125 | ||
| 126 | --- | 126 | --- |
| 127 | 127 | ||
| @@ -251,7 +251,7 @@ __aicore__ inline void ExampleKernel(__gm__ uint8_t* x) { // __aicore__=核函 | |||
| 251 | 提交资料PR前,请逐项检查: | 251 | 提交资料PR前,请逐项检查: |
| 252 | 252 | ||
| 253 | **内容正确性**: | 253 | **内容正确性**: |
| 254 | -- [ ] 所有硬件参数值(容量、粒度、范围)与[硬件规格](./guide/programming_guide/advanced_programming/hardware_implementation/architecture_spec/architecture_spec.md)保持一致 | 254 | +- [ ] 所有硬件参数值(容量、粒度、范围)与[硬件规格](../guide/programming_guide/advanced_programming/hardware_implementation/architecture_spec/architecture_spec.md)保持一致 |
| 255 | - [ ] "固定值"等绝对性描述已经核实(很多"固定值"实际由配置参数决定) | 255 | - [ ] "固定值"等绝对性描述已经核实(很多"固定值"实际由配置参数决定) |
| 256 | - [ ] 数据通路描述与实际路径一致(不与其他文档矛盾) | 256 | - [ ] 数据通路描述与实际路径一致(不与其他文档矛盾) |
| 257 | 257 | ||
| @@ -70,9 +70,9 @@ console.log(`copied ${files.length} .md files to docs/public/api-source/files/`) | |||
| 70 | console.log(`generated bundle.json (${bundleSize} MB) with ${Object.keys(bundle).length} entries`) | 70 | console.log(`generated bundle.json (${bundleSize} MB) with ${Object.keys(bundle).length} entries`) |
| 71 | 71 | ||
| 72 | const contribFiles = [ | 72 | const contribFiles = [ |
| 73 | - 'asc_adv_api_contributing.md', | 73 | + 'contributing/asc_adv_api_contributing.md', |
| 74 | - 'asc_basic_api_contributing.md', | 74 | + 'contributing/asc_basic_api_contributing.md', |
| 75 | - 'asc_c_api_contributing.md', | 75 | + 'contributing/asc_c_api_contributing.md', |
| 76 | 'asc_how_to_choose_api.md', | 76 | 'asc_how_to_choose_api.md', |
| 77 | 'quick_start.md', | 77 | 'quick_start.md', |
| 78 | ] | 78 | ] |
| @@ -85,7 +85,9 @@ let copiedCount = 0 | |||
| 85 | for (const f of contribFiles) { | 85 | for (const f of contribFiles) { |
| 86 | const src = path.join(contribSrcDir, f) | 86 | const src = path.join(contribSrcDir, f) |
| 87 | if (fs.existsSync(src)) { | 87 | if (fs.existsSync(src)) { |
| 88 | - fs.copyFileSync(src, path.join(contribDstDir, f)) | 88 | + const dst = path.join(contribDstDir, f) |
| 89 | + fs.mkdirSync(path.dirname(dst), { recursive: true }) | ||
| 90 | + fs.copyFileSync(src, dst) | ||
| 89 | copiedCount++ | 91 | copiedCount++ |
| 90 | } | 92 | } |
| 91 | } | 93 | } |
| @@ -97,7 +99,9 @@ fs.mkdirSync(contribEnDst, { recursive: true }) | |||
| 97 | for (const f of contribFiles) { | 99 | for (const f of contribFiles) { |
| 98 | const src = path.join(contribEnDir, f) | 100 | const src = path.join(contribEnDir, f) |
| 99 | if (fs.existsSync(src)) { | 101 | if (fs.existsSync(src)) { |
| 100 | - fs.copyFileSync(src, path.join(contribEnDst, f)) | 102 | + const dst = path.join(contribEnDst, f) |
| 103 | + fs.mkdirSync(path.dirname(dst), { recursive: true }) | ||
| 104 | + fs.copyFileSync(src, dst) | ||
| 101 | copiedCount++ | 105 | copiedCount++ |
| 102 | } | 106 | } |
| 103 | } | 107 | } |
| @@ -1619,7 +1619,7 @@ | |||
| 1619 | "expect": { | 1619 | "expect": { |
| 1620 | "minResults": 1, | 1620 | "minResults": 1, |
| 1621 | "targets": [ | 1621 | "targets": [ |
| 1622 | - { "exact": "/asc_basic_api_contributing", "grade": 3 } | 1622 | + { "exact": "/contributing/asc_basic_api_contributing", "grade": 3 } |
| 1623 | ] | 1623 | ] |
| 1624 | } | 1624 | } |
| 1625 | }, | 1625 | }, |
| @@ -1631,7 +1631,7 @@ | |||
| 1631 | "expect": { | 1631 | "expect": { |
| 1632 | "minResults": 1, | 1632 | "minResults": 1, |
| 1633 | "targets": [ | 1633 | "targets": [ |
| 1634 | - { "exact": "/asc_c_api_contributing", "grade": 3 } | 1634 | + { "exact": "/contributing/asc_c_api_contributing", "grade": 3 } |
| 1635 | ] | 1635 | ] |
| 1636 | } | 1636 | } |
| 1637 | }, | 1637 | }, |
| @@ -48,6 +48,7 @@ exclude = [ | |||
| 48 | "^https://docs\\.docker\\.com/$", | 48 | "^https://docs\\.docker\\.com/$", |
| 49 | "^https://docs\\.docker\\.com/reference/cli/docker/buildx/$", | 49 | "^https://docs\\.docker\\.com/reference/cli/docker/buildx/$", |
| 50 | "^https://ccache\\.dev/documentation\\.html$", | 50 | "^https://ccache\\.dev/documentation\\.html$", |
| 51 | + "//img\\.shields\\.io/badge/", | ||
| 51 | ] | 52 | ] |
| 52 | 53 | ||
| 53 | exclude_path = [ | 54 | exclude_path = [ |