Skip to content
版 本

asc_get_rsvd_count

产 品 支 持 情 况

产 品是 否 支 持
Atlas A3 训 练 系 列 产 品/Atlas A3 推 理 系 列 产 品
Atlas A2 训 练 系 列 产 品/Atlas A2 推 理 系 列 产 品

功 能 说 明

此 接 口 用 于 获 取 执 行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();  // 获 取 结 果

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