asc_get_rsvd_count
产 品 支 持 情 况
| 产 品 | 是 否 支 持 |
|---|---|
| √ | |
| √ |
功 能 说 明
此 接 口 用 于 获 取 执 行asc_reduce操 作 后 剩 余 的 元 素 数 量。
函 数 原 型
C++
__aicore__ inline int64_t asc_get_rsvd_count()
参 数 说 明
无
返 回 值 说 明
执 行asc_reduce操 作 后 剩 余 的 元 素 数 量。
流 水 类 型
PIPE_S
约 束 说 明
- 需 和asc_reduce操 作 配 合 使 用。
- 需 通 过 同 步 操 作 确 保asc_reduce执 行 完 成 后 再 调 用 本 接 口 获 取 结 果。
调 用 示 例
C++
// 初 始 化dst、src0、src1和total_length(参 与 计 算 的 数 据 长 度)
int total_length = 256;
__ubuf__ float src0[total_length];
__ubuf__ float src1[total_length];
__ubuf__ float dst[total_length];
asc_reduce(dst, src0, src1, total_length);
asc_sync_notify(PIPE_V, PIPE_S, 0); // 设 置 等 待 和 同 步 信 号
asc_sync_wait(PIPE_V, PIPE_S, 0);
int64_t result = asc_get_rsvd_count(); // 获 取 结 果