Skip to content

okftype: reference.api description: "为 Atlas A3 与 Atlas A2 系列产品设置 L0C Buffer 搬运到 GM 或 L1 Buffer 时随路 Nz 转 ND 的配置,包括 ND 矩阵数量、源相邻 Nz 矩阵偏移与目的相邻 ND 矩阵偏移。" tag:

  • roles: [data_movement_configuration] dependencies:
  • path: docs/zh/api/SIMD-API/c_api/cube_datamove/cube_compute_store/asc_copy_l0c2gm_arch_2201.md kind: configures condition: "与 Atlas A3/A2 对应的 L0C 到 GM 搬出接口配合使用"
  • path: docs/zh/api/SIMD-API/c_api/cube_datamove/cube_compute_store/asc_copy_l0c2l1_arch_2201.md kind: configures condition: "与 Atlas A3/A2 对应的 L0C 到 L1 搬出接口配合使用"
  • path: docs/zh/api/SIMD-API/c_api/cube_datamove/cube_store_aux_config/asc_set_l0c_copy_nz_para.md kind: related condition: "Ascend 950PR&950DT 使用该接口替代本接口,参数单位以其说明为准"
  • path: docs/zh/api/SIMD-API/c_api/cube_datamove/cube_store_key_features/NZ2ND.md kind: related version: ">=9.0.0" version_changes: []

asc_set_l0c_copy_params

产品支持情况​

  • Ascend 950PR&950DT系列产品:不支持
  • Atlas A3系列产品:支持
  • Atlas A2系列产品:支持
  • Atlas 200I/500 A2推理产品:不支持
  • Atlas推理系列产品AI Core:不支持
  • Atlas推理系列产品Vector Core:不支持
  • Atlas训练系列产品:不支持

功能说明​

头文件路径为:"c_api/cube_datamove/cube_datamove.h"。

DataCopy从L0C Buffer搬运到Global Memory或L1 Buffer过程中进行随路格式转换(NZ格式转换为ND格式)时,通过调用该接口设置格式转换的相关配置。

本接口用于Atlas A3系列产品和Atlas A2系列产品对应的asc_copy_l0c2gm和asc_copy_l0c2l1;矩阵数量和间隔的图示见NZ2ND。

Ascend 950PR&950DT系列产品使用asc_set_l0c_copy_nz_para,参数单位以该接口说明为准。

函数原型​

C++
__aicore__ inline void asc_set_l0c_copy_params(uint16_t nd_num, uint16_t src_nd_stride, uint16_t dst_nd_stride)

参数说明​

表1 参数说明

参数名输入/输出描述
nd_num输入ND矩阵的数量,取值范围:nd_num∈[1, 65535]。
src_nd_stride输入以分形大小为单位的源步长,源相邻nz矩阵的起始地址间的偏移。
src_nd_stride∈[1, 512],单位:fractal_size 1024B。
dst_nd_stride输入目的相邻ND矩阵的起始地址间的偏移。单位为元素。
dst_nd_stride∈[1, 65535]。

返回值说明​

无

流水类型​

PIPE_S

约束说明​

无

调用示例​

C++
uint16_t nd_num = 2;
uint16_t src_nd_stride = 2;
uint16_t dst_nd_stride = 1;
asc_set_l0c_copy_params(nd_num, src_nd_stride, dst_nd_stride);

免责声明:本站内容由 asc-devkit 仓 master 分支自动编译生成,属于持续开发版本,可能存在缺陷,仅供预览与参考。如需稳定及商用资料,请查阅官方 昇腾社区。