Skip to content
版 本

asc_set_gm2l1_pad

产 品 支 持 情 况

产 品是 否 支 持
Ascend 950PR/Ascend 950DT

功 能 说 明

将 数 据 从Global Memory (GM)非 对 齐 搬 运 到L1 Buffer时,通 过 调 用 该 接 口 设 置 连 续 搬 运 数 据 块 左 右 两 侧 需 要 填 补 的 数 据 值。

函 数 原 型

C++
__aicore__ inline void asc_set_gm2l1_pad(uint32_t pad_val)

参 数 说 明

参 数 名输 入/输 出描 述
pad_val输 入左 右 两 侧 需 要 填 补 的 数 据 值。

返 回 值 说 明

流 水 类 型

PIPE_S

约 束 说 明

调 用 示 例

C++
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 仓 master 分 支 自 动 编 译 生 成,属 于 持 续 开 发 版 本,可 能 存 在 缺 陷,仅 供 预 览 与 参 考。如 需 稳 定 及 商 用 资 料,请 查 阅 官 方 昇 腾 社 区