已合并
基本概念md英文名化link低错清理 #4213
chenjiao创建于 7月23日
基本概念md英文名化link低错清理 #4213
已合并
共 9 个文件变更+42-48
| @@ -91,7 +91,7 @@ | |||
| 91 | * 必须满足以下值范围: | 91 | * 必须满足以下值范围: |
| 92 | '<====>'表示格式是双向支持的,无论是输入还是输出。 | 92 | '<====>'表示格式是双向支持的,无论是输入还是输出。 |
| 93 | '====>'表示不支持该格式转换,输入和输出数据类型必须相互对应。 | 93 | '====>'表示不支持该格式转换,输入和输出数据类型必须相互对应。 |
| 94 | -[数据格式简介](../../docs/zh/context/%E6%95%B0%E6%8D%AE%E6%A0%BC%E5%BC%8F.md) | 94 | +[数据格式简介](../../docs/zh/context/data_format.md) |
| 95 | 95 | ||
| 96 | | src_format <====> dst_format | dtype | C0 | groups | | 96 | | src_format <====> dst_format | dtype | C0 | groups | |
| 97 | | :-------------------------: | :--------------------------------: |:-----:| :----: | | 97 | | :-------------------------: | :--------------------------------: |:-----:| :----: | |
| @@ -24,11 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | - CANNLab云开发环境: | 25 | - CANNLab云开发环境: |
| 26 | 26 | ||
| 27 | - 默认提供最新版本CANN包配套的项目源码,进入源码目录,\$\{gitCode\_id\}替换为开发者个人gitCode账号。 | 27 | + 默认提供最新版本CANN包配套的项目源码,资源一般在`/mnt/workspace/gitCode`目录,请进入目标分支源码目录。 |
| 28 | - | ||
| 29 | - ```bash | ||
| 30 | - cd /mnt/workspace/gitCode/${gitCode_id}/ops-math | ||
| 31 | - ``` | ||
| 32 | 28 | ||
| 33 | - 非CANNLab云开发环境: | 29 | - 非CANNLab云开发环境: |
| 34 | 30 | ||
| @@ -174,7 +170,7 @@ __aicore__ inline void AddExample<T>::Compute(int64_t currentNum) | |||
| 174 | 170 | ||
| 175 | 请在`examples/add_example/op_kernel/add_example.h`中进行代码修改。 | 171 | 请在`examples/add_example/op_kernel/add_example.h`中进行代码修改。 |
| 176 | 172 | ||
| 177 | -* **printf** | 173 | +- **printf** |
| 178 | 174 | ||
| 179 | 该接口支持打印Scalar类型数据,如整数、字符型、布尔型等,详细介绍请参见[《Ascend C API》](https://hiascend.com/document/redirect/CannCommunityAscendCApi)中“算子调测API > printf”。 | 175 | 该接口支持打印Scalar类型数据,如整数、字符型、布尔型等,详细介绍请参见[《Ascend C API》](https://hiascend.com/document/redirect/CannCommunityAscendCApi)中“算子调测API > printf”。 |
| 180 | 176 | ||
| @@ -186,7 +182,7 @@ __aicore__ inline void AddExample<T>::Compute(int64_t currentNum) | |||
| 186 | AscendC::PRINTF("Tiling blockLength is %lld\n", blockLength_); | 182 | AscendC::PRINTF("Tiling blockLength is %lld\n", blockLength_); |
| 187 | ``` | 183 | ``` |
| 188 | 184 | ||
| 189 | -* **DumpTensor** | 185 | +- **DumpTensor** |
| 190 | 186 | ||
| 191 | 该接口支持Dump指定Tensor的内容,同时支持打印自定义附加信息,比如当前行号等,详细介绍请参见[《Ascend C API》](https://hiascend.com/document/redirect/CannCommunityAscendCApi)中“算子调测API > DumpTensor”。 | 187 | 该接口支持Dump指定Tensor的内容,同时支持打印自定义附加信息,比如当前行号等,详细介绍请参见[《Ascend C API》](https://hiascend.com/document/redirect/CannCommunityAscendCApi)中“算子调测API > DumpTensor”。 |
| 192 | 188 | ||
| @@ -28,9 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | <img src="../figures/cloudIDE.png" alt="云平台" width="750px" height="85px"> | 29 | <img src="../figures/cloudIDE.png" alt="云平台" width="750px" height="85px"> |
| 30 | 30 | ||
| 31 | -2. 根据页面提示创建NPU环境并配置规格,启动云开发环境后,单击“`连接 > WebIDE`”进入一站式开发平台。 | 31 | +2. 根据页面提示创建NPU环境并配置规格,启动云开发环境后,单击“`连接 > WebIDE`”进入一站式开发平台。当前开源项目资源默认在/mnt/workspace/gitCode目录。 |
| 32 | - | ||
| 33 | - 当前开源项目资源默认在`/mnt/workspace/gitCode/${gitCode_id}`目录下,\$\{gitCode\_id\}表示开发者个人gitCode账号。 | ||
| 34 | 32 | ||
| 35 | <img src="../figures/webIDE.png" alt="云平台" width="1000px" height="150px"> | 33 | <img src="../figures/webIDE.png" alt="云平台" width="1000px" height="150px"> |
| 36 | 34 | ||
| @@ -23,7 +23,7 @@ $$ | |||
| 23 | - aclnnLog:需新建一个输出张量对象存储计算结果。 | 23 | - aclnnLog:需新建一个输出张量对象存储计算结果。 |
| 24 | - aclnnInplaceLog:无需新建输出张量对象,直接在输入张量的内存中存储计算结果。 | 24 | - aclnnInplaceLog:无需新建输出张量对象,直接在输入张量的内存中存储计算结果。 |
| 25 | 25 | ||
| 26 | -- 每个算子分为[两段式接口](../../../../docs/zh/context/两段式接口.md),必须先调用“aclnnLogGetWorkspaceSize”或者“aclnnInplaceLogGetWorkspaceSize”接口获取计算所需workspace大小以及包含了算子计算流程的执行器,再调用“aclnnLog”或者“aclnnInplaceLog”接口执行计算。 | 26 | +- 每个算子分为[两段式接口](../../../../docs/zh/context/two_phase_api.md),必须先调用“aclnnLogGetWorkspaceSize”或者“aclnnInplaceLogGetWorkspaceSize”接口获取计算所需workspace大小以及包含了算子计算流程的执行器,再调用“aclnnLog”或者“aclnnInplaceLog”接口执行计算。 |
| 27 | 27 | ||
| 28 | * `aclnnStatus aclnnLogGetWorkspaceSize(const aclTensor *self, aclTensor *out, uint64_t *workspaceSize, aclOpExecutor **executor)` | 28 | * `aclnnStatus aclnnLogGetWorkspaceSize(const aclTensor *self, aclTensor *out, uint64_t *workspaceSize, aclOpExecutor **executor)` |
| 29 | 29 | ||
| @@ -37,16 +37,16 @@ $$ | |||
| 37 | 37 | ||
| 38 | - **参数说明:** | 38 | - **参数说明:** |
| 39 | 39 | ||
| 40 | - * self(aclTensor*, 计算输入):Device侧的aclTensor,支持1维~8维。支持[非连续的Tensor](../../../../docs/zh/context/非连续的Tensor.md),[数据格式](../../../../docs/zh/context/数据格式.md)支持ND。 | 40 | + * self(aclTensor*, 计算输入):Device侧的aclTensor,支持1维~8维。支持[非连续的Tensor](../../../../docs/zh/context/non_contiguous_tensor.md),[数据格式](../../../../docs/zh/context/data_format.md)支持ND。 |
| 41 | - <term>Atlas A2 训练系列产品/Atlas A2 推理系列产品</term>:数据类型支持BOOL、INT64、INT32、INT16、INT8、UINT8、FLOAT、FLOAT16、DOUBLE、COMPLEX64、COMPLEX128、BFLOAT16。 | 41 | - <term>Atlas A2 训练系列产品/Atlas A2 推理系列产品</term>:数据类型支持BOOL、INT64、INT32、INT16、INT8、UINT8、FLOAT、FLOAT16、DOUBLE、COMPLEX64、COMPLEX128、BFLOAT16。 |
| 42 | - * out(aclTensor*, 计算输出):Device侧的aclTensor,支持1维~8维。当self是复数时,out必须是复数。[数据格式](../../../../docs/zh/context/数据格式.md)支持ND。 | 42 | + * out(aclTensor*, 计算输出):Device侧的aclTensor,支持1维~8维。当self是复数时,out必须是复数。[数据格式](../../../../docs/zh/context/data_format.md)支持ND。 |
| 43 | - <term>Atlas A2 训练系列产品/Atlas A2 推理系列产品</term>:数据类型支持FLOAT、FLOAT16、DOUBLE、COMPLEX64、COMPLEX128、BFLOAT16。 | 43 | - <term>Atlas A2 训练系列产品/Atlas A2 推理系列产品</term>:数据类型支持FLOAT、FLOAT16、DOUBLE、COMPLEX64、COMPLEX128、BFLOAT16。 |
| 44 | * workspaceSize(uint64_t*, 出参):返回需要在Device侧申请的workspace大小。 | 44 | * workspaceSize(uint64_t*, 出参):返回需要在Device侧申请的workspace大小。 |
| 45 | * executor(aclOpExecutor**, 出参):返回op执行器,包含了算子计算流程。 | 45 | * executor(aclOpExecutor**, 出参):返回op执行器,包含了算子计算流程。 |
| 46 | 46 | ||
| 47 | - **返回值:** | 47 | - **返回值:** |
| 48 | 48 | ||
| 49 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../../docs/zh/context/aclnn返回码.md)。 | 49 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../../docs/zh/context/aclnn_return_code.md)。 |
| 50 | 50 | ||
| 51 | ````text | 51 | ````text |
| 52 | 第一段接口完成入参校验,出现以下场景时报错: | 52 | 第一段接口完成入参校验,出现以下场景时报错: |
| @@ -68,13 +68,13 @@ $$ | |||
| 68 | 68 | ||
| 69 | - **返回值:** | 69 | - **返回值:** |
| 70 | 70 | ||
| 71 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../../docs/zh/context/aclnn返回码.md)。 | 71 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../../docs/zh/context/aclnn_return_code.md)。 |
| 72 | 72 | ||
| 73 | ## aclnnInplaceLogGetWorkspaceSize | 73 | ## aclnnInplaceLogGetWorkspaceSize |
| 74 | 74 | ||
| 75 | - **参数说明:** | 75 | - **参数说明:** |
| 76 | 76 | ||
| 77 | - - selfRef(aclTensor*,计算输入|计算输出):公式中的输入`self`与输出`output`,支持1维~8维。支持[非连续的Tensor](../../../../docs/zh/context/非连续的Tensor.md),[数据格式](../../../../docs/zh/context/数据格式.md)支持ND。 | 77 | + - selfRef(aclTensor*,计算输入|计算输出):公式中的输入`self`与输出`output`,支持1维~8维。支持[非连续的Tensor](../../../../docs/zh/context/non_contiguous_tensor.md),[数据格式](../../../../docs/zh/context/data_format.md)支持ND。 |
| 78 | - <term>Atlas A2 训练系列产品/Atlas A2 推理系列产品</term>:数据类型支持FLOAT、FLOAT16、DOUBLE、COMPLEX64、COMPLEX128、BFLOAT16。 | 78 | - <term>Atlas A2 训练系列产品/Atlas A2 推理系列产品</term>:数据类型支持FLOAT、FLOAT16、DOUBLE、COMPLEX64、COMPLEX128、BFLOAT16。 |
| 79 | - workspaceSize(uint64_t*,出参):返回需要在Device侧申请的workspace大小。 | 79 | - workspaceSize(uint64_t*,出参):返回需要在Device侧申请的workspace大小。 |
| 80 | 80 | ||
| @@ -82,7 +82,7 @@ $$ | |||
| 82 | 82 | ||
| 83 | - **返回值:** | 83 | - **返回值:** |
| 84 | 84 | ||
| 85 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../../docs/zh/context/aclnn返回码.md)。 | 85 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../../docs/zh/context/aclnn_return_code.md)。 |
| 86 | 86 | ||
| 87 | ```text | 87 | ```text |
| 88 | 第一段接口完成入参校验,出现以下场景时报错: | 88 | 第一段接口完成入参校验,出现以下场景时报错: |
| @@ -105,7 +105,7 @@ $$ | |||
| 105 | 105 | ||
| 106 | - **返回值:** | 106 | - **返回值:** |
| 107 | 107 | ||
| 108 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../../docs/zh/context/aclnn返回码.md)。 | 108 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../../docs/zh/context/aclnn_return_code.md)。 |
| 109 | 109 | ||
| 110 | ## 约束说明 | 110 | ## 约束说明 |
| 111 | 111 | ||
| @@ -113,7 +113,7 @@ $$ | |||
| 113 | 113 | ||
| 114 | ## 调用示例 | 114 | ## 调用示例 |
| 115 | 115 | ||
| 116 | -示例代码如下,仅供参考,具体编译和执行过程请参考[编译与运行样例](../../../../docs/zh/context/编译与运行样例.md)。 | 116 | +示例代码如下,仅供参考,具体编译和执行过程请参考[编译与运行样例](../../../../docs/zh/context/compile_and_run_sample.md)。 |
| 117 | 117 | ||
| 118 | **aclnnLog示例代码:** | 118 | **aclnnLog示例代码:** |
| 119 | 119 | ||
| @@ -3,7 +3,7 @@ | |||
| 3 | `out = input · (cos(angle) + i·sin(angle))`,input(abs)/angle 为 fp32 可广播,out 为 complex64。 | 3 | `out = input · (cos(angle) + i·sin(angle))`,input(abs)/angle 为 fp32 可广播,out 为 complex64。 |
| 4 | 对齐基准:`cann/ops-math` 的 `math/complex/op_host/op_api/aclnn_polar.cpp`(l0 拼接版)。 | 4 | 对齐基准:`cann/ops-math` 的 `math/complex/op_host/op_api/aclnn_polar.cpp`(l0 拼接版)。 |
| 5 | 5 | ||
| 6 | -## 文件构成(与 S8 case_910b/<Op>/ 完全一致) | 6 | +## 文件构成(与 S8 case_910b/\<Op\>/ 完全一致) |
| 7 | 7 | ||
| 8 | | 文件 | 来源 | 说明 | | 8 | | 文件 | 来源 | 说明 | |
| 9 | |---|---|---| | 9 | |---|---|---| |
| @@ -40,7 +40,7 @@ $$ | |||
| 40 | - aclnnLog:需新建一个输出张量对象存储计算结果。 | 40 | - aclnnLog:需新建一个输出张量对象存储计算结果。 |
| 41 | - aclnnInplaceLog:无需新建输出张量对象,直接在输入张量的内存中存储计算结果。 | 41 | - aclnnInplaceLog:无需新建输出张量对象,直接在输入张量的内存中存储计算结果。 |
| 42 | 42 | ||
| 43 | -- 每个算子分为[两段式接口](../../../docs/zh/context/两段式接口.md),必须先调用“aclnnLogGetWorkspaceSize”或者“aclnnInplaceLogGetWorkspaceSize”接口获取计算所需workspace大小以及包含了算子计算流程的执行器,再调用“aclnnLog”或者“aclnnInplaceLog”接口执行计算。 | 43 | +- 每个算子分为[两段式接口](../../../docs/zh/context/two_phase_api.md),必须先调用“aclnnLogGetWorkspaceSize”或者“aclnnInplaceLogGetWorkspaceSize”接口获取计算所需workspace大小以及包含了算子计算流程的执行器,再调用“aclnnLog”或者“aclnnInplaceLog”接口执行计算。 |
| 44 | 44 | ||
| 45 | ```Cpp | 45 | ```Cpp |
| 46 | aclnnStatus aclnnLogGetWorkspaceSize( | 46 | aclnnStatus aclnnLogGetWorkspaceSize( |
| @@ -143,7 +143,7 @@ aclnnStatus aclnnInplaceLog( | |||
| 143 | 143 | ||
| 144 | - **返回值:** | 144 | - **返回值:** |
| 145 | 145 | ||
| 146 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn返回码.md)。 | 146 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn_return_code.md)。 |
| 147 | 147 | ||
| 148 | 第一段接口完成入参校验,出现如下场景时报错: | 148 | 第一段接口完成入参校验,出现如下场景时报错: |
| 149 | 149 | ||
| @@ -222,7 +222,7 @@ aclnnStatus aclnnInplaceLog( | |||
| 222 | 222 | ||
| 223 | - **返回值:** | 223 | - **返回值:** |
| 224 | 224 | ||
| 225 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn返回码.md)。 | 225 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn_return_code.md)。 |
| 226 | 226 | ||
| 227 | ## aclnnInplaceLogGetWorkspaceSize | 227 | ## aclnnInplaceLogGetWorkspaceSize |
| 228 | 228 | ||
| @@ -284,7 +284,7 @@ aclnnStatus aclnnInplaceLog( | |||
| 284 | 284 | ||
| 285 | - **返回值:** | 285 | - **返回值:** |
| 286 | 286 | ||
| 287 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn返回码.md)。 | 287 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn_return_code.md)。 |
| 288 | 288 | ||
| 289 | 第一段接口完成入参校验,出现如下场景时报错: | 289 | 第一段接口完成入参校验,出现如下场景时报错: |
| 290 | 290 | ||
| @@ -357,7 +357,7 @@ aclnnStatus aclnnInplaceLog( | |||
| 357 | 357 | ||
| 358 | - **返回值:** | 358 | - **返回值:** |
| 359 | 359 | ||
| 360 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn返回码.md)。 | 360 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn_return_code.md)。 |
| 361 | 361 | ||
| 362 | ## 约束说明 | 362 | ## 约束说明 |
| 363 | 363 | ||
| @@ -368,7 +368,7 @@ aclnnStatus aclnnInplaceLog( | |||
| 368 | 368 | ||
| 369 | ## 调用示例 | 369 | ## 调用示例 |
| 370 | 370 | ||
| 371 | -示例代码如下,仅供参考,具体编译和执行过程请参考[编译与运行样例](../../../docs/zh/context/编译与运行样例.md)。 | 371 | +示例代码如下,仅供参考,具体编译和执行过程请参考[编译与运行样例](../../../docs/zh/context/compile_and_run_sample.md)。 |
| 372 | 372 | ||
| 373 | **aclnnLog示例代码:** | 373 | **aclnnLog示例代码:** |
| 374 | 374 | ||
| @@ -43,7 +43,7 @@ | |||
| 43 | - aclnnLog10:需新建一个输出张量对象存储计算结果。 | 43 | - aclnnLog10:需新建一个输出张量对象存储计算结果。 |
| 44 | - aclnnInplaceLog10:无需新建输出张量对象,直接在输入张量的内存中存储计算结果。 | 44 | - aclnnInplaceLog10:无需新建输出张量对象,直接在输入张量的内存中存储计算结果。 |
| 45 | 45 | ||
| 46 | -- 每个算子分为[两段式接口](../../../docs/zh/context/两段式接口.md),必须先调用"aclnnLog10GetWorkspaceSize"或者"aclnnInplaceLog10GetWorkspaceSize"接口获取计算所需workspace大小以及包含了算子计算流程的执行器,再调用"aclnnLog10"或者"aclnnInplaceLog10"接口执行计算。 | 46 | +- 每个算子分为[两段式接口](../../../docs/zh/context/two_phase_api.md),必须先调用"aclnnLog10GetWorkspaceSize"或者"aclnnInplaceLog10GetWorkspaceSize"接口获取计算所需workspace大小以及包含了算子计算流程的执行器,再调用"aclnnLog10"或者"aclnnInplaceLog10"接口执行计算。 |
| 47 | 47 | ||
| 48 | ```Cpp | 48 | ```Cpp |
| 49 | aclnnStatus aclnnLog10GetWorkspaceSize( | 49 | aclnnStatus aclnnLog10GetWorkspaceSize( |
| @@ -150,7 +150,7 @@ aclnnStatus aclnnInplaceLog10( | |||
| 150 | 150 | ||
| 151 | - **返回值:** | 151 | - **返回值:** |
| 152 | 152 | ||
| 153 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn返回码.md)。 | 153 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn_return_code.md)。 |
| 154 | 154 | ||
| 155 | 第一段接口完成入参校验,出现如下场景时报错: | 155 | 第一段接口完成入参校验,出现如下场景时报错: |
| 156 | 156 | ||
| @@ -226,7 +226,7 @@ aclnnStatus aclnnInplaceLog10( | |||
| 226 | 226 | ||
| 227 | - **返回值:** | 227 | - **返回值:** |
| 228 | 228 | ||
| 229 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn返回码.md)。 | 229 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn_return_code.md)。 |
| 230 | 230 | ||
| 231 | ## aclnnInplaceLog10GetWorkspaceSize | 231 | ## aclnnInplaceLog10GetWorkspaceSize |
| 232 | 232 | ||
| @@ -290,7 +290,7 @@ aclnnStatus aclnnInplaceLog10( | |||
| 290 | 290 | ||
| 291 | - **返回值:** | 291 | - **返回值:** |
| 292 | 292 | ||
| 293 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn返回码.md)。 | 293 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn_return_code.md)。 |
| 294 | 294 | ||
| 295 | 第一段接口完成入参校验,出现如下场景时报错: | 295 | 第一段接口完成入参校验,出现如下场景时报错: |
| 296 | 296 | ||
| @@ -360,7 +360,7 @@ aclnnStatus aclnnInplaceLog10( | |||
| 360 | 360 | ||
| 361 | - **返回值:** | 361 | - **返回值:** |
| 362 | 362 | ||
| 363 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn返回码.md)。 | 363 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn_return_code.md)。 |
| 364 | 364 | ||
| 365 | ## 约束说明 | 365 | ## 约束说明 |
| 366 | 366 | ||
| @@ -371,7 +371,7 @@ aclnnStatus aclnnInplaceLog10( | |||
| 371 | 371 | ||
| 372 | **aclnnLog10示例代码:** | 372 | **aclnnLog10示例代码:** |
| 373 | 373 | ||
| 374 | -示例代码如下,仅供参考,具体编译和执行过程请参考[编译与运行样例](../../../docs/zh/context/编译与运行样例.md)。 | 374 | +示例代码如下,仅供参考,具体编译和执行过程请参考[编译与运行样例](../../../docs/zh/context/compile_and_run_sample.md)。 |
| 375 | 375 | ||
| 376 | ```Cpp | 376 | ```Cpp |
| 377 | #include <iostream> | 377 | #include <iostream> |
| @@ -40,7 +40,7 @@ | |||
| 40 | - aclnnLog2:需新建一个输出张量对象存储计算结果。 | 40 | - aclnnLog2:需新建一个输出张量对象存储计算结果。 |
| 41 | - aclnnInplaceLog2:无需新建输出张量对象,直接在输入张量的内存中存储计算结果。 | 41 | - aclnnInplaceLog2:无需新建输出张量对象,直接在输入张量的内存中存储计算结果。 |
| 42 | 42 | ||
| 43 | -- 每个算子分为[两段式接口](../../../docs/zh/context/两段式接口.md),必须先调用"aclnnLog2GetWorkspaceSize"或者"aclnnInplaceLog2GetWorkspaceSize"接口获取计算所需workspace大小以及包含了算子计算流程的执行器,再调用"aclnnLog2"或者"aclnnInplaceLog2"接口执行计算。 | 43 | +- 每个算子分为[两段式接口](../../../docs/zh/context/two_phase_api.md),必须先调用"aclnnLog2GetWorkspaceSize"或者"aclnnInplaceLog2GetWorkspaceSize"接口获取计算所需workspace大小以及包含了算子计算流程的执行器,再调用"aclnnLog2"或者"aclnnInplaceLog2"接口执行计算。 |
| 44 | 44 | ||
| 45 | ```Cpp | 45 | ```Cpp |
| 46 | aclnnStatus aclnnLog2GetWorkspaceSize( | 46 | aclnnStatus aclnnLog2GetWorkspaceSize( |
| @@ -143,7 +143,7 @@ aclnnStatus aclnnInplaceLog2( | |||
| 143 | 143 | ||
| 144 | - **返回值:** | 144 | - **返回值:** |
| 145 | 145 | ||
| 146 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn返回码.md)。 | 146 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn_return_code.md)。 |
| 147 | 147 | ||
| 148 | 第一段接口完成入参校验,出现如下场景时报错: | 148 | 第一段接口完成入参校验,出现如下场景时报错: |
| 149 | 149 | ||
| @@ -222,7 +222,7 @@ aclnnStatus aclnnInplaceLog2( | |||
| 222 | 222 | ||
| 223 | - **返回值:** | 223 | - **返回值:** |
| 224 | 224 | ||
| 225 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn返回码.md)。 | 225 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn_return_code.md)。 |
| 226 | 226 | ||
| 227 | ## aclnnInplaceLog2GetWorkspaceSize | 227 | ## aclnnInplaceLog2GetWorkspaceSize |
| 228 | 228 | ||
| @@ -284,7 +284,7 @@ aclnnStatus aclnnInplaceLog2( | |||
| 284 | 284 | ||
| 285 | - **返回值:** | 285 | - **返回值:** |
| 286 | 286 | ||
| 287 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn返回码.md)。 | 287 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn_return_code.md)。 |
| 288 | 288 | ||
| 289 | 第一段接口完成入参校验,出现如下场景时报错: | 289 | 第一段接口完成入参校验,出现如下场景时报错: |
| 290 | 290 | ||
| @@ -357,7 +357,7 @@ aclnnStatus aclnnInplaceLog2( | |||
| 357 | 357 | ||
| 358 | - **返回值:** | 358 | - **返回值:** |
| 359 | 359 | ||
| 360 | - aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn返回码.md)。 | 360 | + aclnnStatus:返回状态码,具体参见[aclnn返回码](../../../docs/zh/context/aclnn_return_code.md)。 |
| 361 | 361 | ||
| 362 | ## 约束说明 | 362 | ## 约束说明 |
| 363 | 363 | ||
| @@ -366,7 +366,7 @@ aclnnStatus aclnnInplaceLog2( | |||
| 366 | 366 | ||
| 367 | ## 调用示例 | 367 | ## 调用示例 |
| 368 | 368 | ||
| 369 | -示例代码如下,仅供参考,具体编译和执行过程请参考[编译与运行样例](../../../docs/zh/context/编译与运行样例.md)。 | 369 | +示例代码如下,仅供参考,具体编译和执行过程请参考[编译与运行样例](../../../docs/zh/context/compile_and_run_sample.md)。 |
| 370 | 370 | ||
| 371 | **aclnnLog2示例代码:** | 371 | **aclnnLog2示例代码:** |
| 372 | 372 | ||
| @@ -20,22 +20,22 @@ extern "C" { | |||
| 20 | * @domain aclnn_math | 20 | * @domain aclnn_math |
| 21 | * * 算子功能:使用输入边界的反射填充输入tensor。 | 21 | * * 算子功能:使用输入边界的反射填充输入tensor。 |
| 22 | * @param [in] data: | 22 | * @param [in] data: |
| 23 | - * 表示参与计算的目标张量,维度小于8维,Device侧的aclTensor,支持[非连续的Tensor](../../../../docs/zh/context/非连续的Tensor.md), | 23 | + * 表示参与计算的目标张量,维度小于8维,Device侧的aclTensor,支持非连续的Tensor, |
| 24 | - * 数据类型支持FLOAT16、FLOAT32,[数据格式](../../../../docs/zh/context/数据格式.md)支持ND。 | 24 | + * 数据类型支持FLOAT16、FLOAT32,数据格式支持ND。 |
| 25 | * @param [in] axes: 指定计算维度,Host侧的aclIntArray,数据类型支持INT64,取值范围为[-self.dim(), self.dim()-1]。 | 25 | * @param [in] axes: 指定计算维度,Host侧的aclIntArray,数据类型支持INT64,取值范围为[-self.dim(), self.dim()-1]。 |
| 26 | * @param [in] keepDims: 指定是否在输出张量中保留输入张量的维度,Host侧的BOOL值。 | 26 | * @param [in] keepDims: 指定是否在输出张量中保留输入张量的维度,Host侧的BOOL值。 |
| 27 | * @param [in] noopWithEmptyAxes: | 27 | * @param [in] noopWithEmptyAxes: |
| 28 | * 指定axes为空时的行为:false即对所有轴进行计算;true即不进行计算,输出张量等于输入张量,Host侧的BOOL值。 | 28 | * 指定axes为空时的行为:false即对所有轴进行计算;true即不进行计算,输出张量等于输入张量,Host侧的BOOL值。 |
| 29 | * @param [in] reduce: | 29 | * @param [in] reduce: |
| 30 | - * 表示计算后的结果,维度小于8维,Device侧的aclTensor,支持[非连续的Tensor](../../../../docs/zh/context/非连续的Tensor.md), | 30 | + * 表示计算后的结果,维度小于8维,Device侧的aclTensor,支持非连续的Tensor, |
| 31 | - * 数据类型支持FLOAT16、FLOAT32,需与data一致,[数据格式](../../../../docs/zh/context/数据格式.md)支持ND。 | 31 | + * 数据类型支持FLOAT16、FLOAT32,需与data一致,数据格式支持ND。 |
| 32 | * @param [out] workspaceSize: 返回用户需要在npu device侧申请的workspace大小。 | 32 | * @param [out] workspaceSize: 返回用户需要在npu device侧申请的workspace大小。 |
| 33 | * @param [out] executor: 返回op执行器,包含算子计算流程。 | 33 | * @param [out] executor: 返回op执行器,包含算子计算流程。 |
| 34 | * @return aclnnStatus: 返回状态码。 | 34 | * @return aclnnStatus: 返回状态码。 |
| 35 | */ | 35 | */ |
| 36 | -ACLNN_API aclnnStatus aclnnReduceLogSumGetWorkspaceSize( | 36 | +ACLNN_API aclnnStatus aclnnReduceLogSumGetWorkspaceSize(const aclTensor* data, const aclIntArray* axes, bool keepDims, |
| 37 | - const aclTensor* data, const aclIntArray* axes, bool keepDims, bool noopWithEmptyAxes, aclTensor* reduce, | 37 | + bool noopWithEmptyAxes, aclTensor* reduce, |
| 38 | - uint64_t* workspaceSize, aclOpExecutor** executor); | 38 | + uint64_t* workspaceSize, aclOpExecutor** executor); |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | * @brief aclnnReduceLogSum的第二段接口,用于执行计算。 | 41 | * @brief aclnnReduceLogSum的第二段接口,用于执行计算。 |
| @@ -45,8 +45,8 @@ ACLNN_API aclnnStatus aclnnReduceLogSumGetWorkspaceSize( | |||
| 45 | * @param [in] executor: op执行器,包含了算子计算流程。 | 45 | * @param [in] executor: op执行器,包含了算子计算流程。 |
| 46 | * @return aclnnStatus: 返回状态码。 | 46 | * @return aclnnStatus: 返回状态码。 |
| 47 | */ | 47 | */ |
| 48 | -ACLNN_API aclnnStatus | 48 | +ACLNN_API aclnnStatus aclnnReduceLogSum(void* workspace, uint64_t workspaceSize, aclOpExecutor* executor, |
| 49 | -aclnnReduceLogSum(void* workspace, uint64_t workspaceSize, aclOpExecutor* executor, aclrtStream stream); | 49 | + aclrtStream stream); |
| 50 | 50 | ||
| 51 | 51 | ||
| 52 | } | 52 | } |