asc_set_gm2l1_loop2_stride
产 品 支 持 情 况
| 产 品 | 是 否 支 持 |
|---|---|
| Ascend 950PR/Ascend 950DT | √ |
功 能 说 明
将 数 据 从Global Memory (GM)搬 运 到L1 Buffer时,通 过 调 用 该 接 口 设 置 外 层 循 环 中 相 邻 迭 代 数 据 块 间 的 间 隔。
以 源 操 作 数 搬 运 场 景 为 例,如 下 图 所 示。

函 数 原 型
C++
__aicore__ inline void asc_set_gm2l1_loop2_stride(uint64_t loop2_src_stride, uint64_t loop2_dst_stride)
参 数 说 明
| 参 数 名 | 输 入/输 出 | 描 述 |
|---|---|---|
| loop2_src_stride | 输 入 | 外 层 循 环 中 相 邻 迭 代 源 操 作 数 的 数 据 块 间 的 间 隔,单 位 为Byte,取 值 范 围 为[0,2^40]。 |
| loop2_dst_stride | 输 入 | 外 层 循 环 中 相 邻 迭 代 目 标 操 作 数 的 数 据 块 间 的 间 隔,单 位 为Byte,取 值 范 围 为[0,2^21],且 必 须32B对 齐。 |
返 回 值 说 明
无
流 水 类 型
PIPE_S
约 束 说 明
无
调 用 示 例
C++
asc_set_gm2l1_loop_size(2, 2);
asc_set_gm2l1_loop1_stride(96, 128);
asc_set_gm2l1_loop2_stride(192, 288);
constexpr uint32_t n_burst = 2;
constexpr uint32_t len_burst = 2;
constexpr uint8_t left_padding_count = 0;
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);