昇腾社区首页
中文
注册

WaitIterateBatch

功能说明

等待IterateBatch异步接口返回,支持连续输出到Global Memory。

函数原型

1
__aicore__ inline void WaitIterateBatch()

参数说明

参数名

输入/输出

描述

NA

返回值

支持的型号

Atlas A2 训练系列产品/Atlas 800I A2 推理产品

约束说明

  • 配套IterateBatch异步接口使用。
  • 仅支持连续输出至Global Memory。
  • 模板参数enableMixDualMaster(默认取值为false)设置为true,即使能MixDualMaster(双主模式)场景时,不支持使用该接口。

调用示例

1
2
3
4
5
6
7
8
9
AscendC::Matmul<aType, bType, cType, biasType> mm;
mm.SetTensorA(queryGm[tensorACoreOffset]);
mm.SetTensorB(keyGm[tensorBCoreOffset + sInnerStart * singleProcessSInnerSize *
      tilingData->attentionScoreOffestStrideParams.matmulHead], true);
mm.SetTail(singleProcessSOuterSize, mmNNum);
mm.template IterateBatch<false>(workspaceGm[tmp_block_idx * mmResUbSize * sInnerLoopTimes],batchA, batchB, false);
// do some others compute
mm.WaitIterateBatch(); // 等待IterateBatch完成
DataCopy(dstUB, GM);  // 进行GM到UB的拷贝