CANN/asc-devkit:数据搬运填充设置

CANN/asc-devkit:数据搬运填充设置
asc_set_gm2l1_pad【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit产品支持情况Ascend 950PR/Ascend 950DT支持Atlas A3 训练系列产品/Atlas A3 推理系列产品不支持Atlas A2 训练系列产品/Atlas A2 推理系列产品不支持Atlas 200I/500 A2 推理产品不支持Atlas 推理系列产品AI Core不支持Atlas 推理系列产品Vector Core不支持Atlas 训练系列产品不支持功能说明头文件路径c_api/cube_datamove/cube_datamove.h。将数据从Global Memory (GM)非对齐搬运到L1 Buffer时通过调用该接口设置连续搬运数据块左右两侧需要填补的数据值。函数原型__aicore__ inline void asc_set_gm2l1_pad(uint32_t pad_val)参数说明参数名输入/输出描述pad_val输入左右两侧需要填补的数据值。返回值说明无流水类型PIPE_S约束说明无调用示例asc_set_gm2l1_loop_size(2, 2); asc_set_gm2l1_loop1_stride(96, 128); asc_set_gm2l1_loop2_stride(192, 288); // 源操作数非对齐需要填补数据 asc_set_gm2l1_pad(0); constexpr uint32_t n_burst 2; constexpr uint32_t len_burst 2; constexpr uint8_t left_padding_count 1; constexpr uint8_t right_padding_count 0; constexpr bool data_select_bit false; constexpr uint8_t l2_cache_ctl 0; constexpr uint64_t burst_src_stride 0; constexpr uint32_t burst_dst_stride 0; __gm__ half src[256]; __cbuf__ half dst[256]; asc_copy_gm2l1_align(dst, src, n_burst, len_burst, left_padding_count, right_padding_count, data_select_bit, l2_cache_ctl, burst_src_stride, burst_dst_stride); asc_set_gm2l1_loop_size(1, 1);【免费下载链接】asc-devkit本项目是CANN 推出的昇腾AI处理器专用的算子程序开发语言原生支持C和C标准规范主要由类库和语言扩展层构成提供多层级API满足多维场景算子开发诉求。项目地址: https://gitcode.com/cann/asc-devkit创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考