Skip to content
版 本

asc_set_gm2l1_loop1_stride

产 品 支 持 情 况

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

功 能 说 明

将 数 据 从Global Memory (GM)搬 运 到L1 Buffer时,通 过 调 用 该 接 口 设 置 内 层 循 环 中 相 邻 迭 代 数 据 块 间 的 间 隔。

以 源 操 作 数 搬 运 场 景 为 例,如 下 图 所 示。

源操作数搬运场景示例

函 数 原 型

C++
__aicore__ inline void asc_set_gm2l1_loop1_stride(uint64_t loop1_src_stride, uint64_t loop1_dst_stride)

参 数 说 明

参 数 名输 入/输 出描 述
loop1_src_stride输 入内 层 循 环 中 相 邻 迭 代 源 操 作 数 的 数 据 块 间 的 间 隔,单 位 为Byte,取 值 范 围 为[0,2^40]。
loop1_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);

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