asc_sync_vec
产 品 支 持 情 况
| 产 品 | 是 否 支 持 |
|---|---|
| √ | |
| √ | |
| √ |
功 能 说 明
针 对 所 有 流 水 线 执 行 同 步 操 作。
函 数 原 型
C++
__aicore__ inline void asc_sync_vec()
参 数 说 明
无
返 回 值 说 明
无
流 水 类 型
PIPE_S
约 束 说 明
无
调 用 示 例
C++
// 本 例 中total_length指 参 与 计 算 的 数 据 总 长 度。src0_gm,src1_gm,dst_gm是 外 部 输 入 的float类 型 的 源 操 作 数、目 的 操 作 数,指 向GM内 存 空 间。
constexpr uint32_t total_length = 128;
__ubuf__ float src0[total_length];
__ubuf__ float src1[total_length];
__ubuf__ float dst[total_length];
asc_copy_gm2ub((__ubuf__ void*)src0, (__gm__ void*)src0_gm, total_length * sizeof(float));
asc_copy_gm2ub((__ubuf__ void*)src1, (__gm__ void*)src1_gm, total_length * sizeof(float));
// 同 步 操 作:前 置 操 作 完 成 后 才 能 启 动 后 续 操 作。
asc_sync_vec();
asc_add(dst, src1, src0, total_length);
// 同 步 操 作:前 置 操 作 完 成 后 才 能 启 动 后 续 操 作。
asc_sync_vec();
asc_copy_ub2gm((__gm__ void*)dst_gm, (__ubuf__ void*)dst, total_length * sizeof(float));