昇腾社区首页
中文
注册

GetBatchC

功能说明

调用一次GetBatchC,会获取C矩阵片,该接口可以与IterateNBatch异步接口配合使用。用于在调用IterateNBatch迭代计算后,获取一片std::max(batchA, batchB) * singleCoreM * singleCoreN大小的矩阵分片。

函数原型

template <bool sync = true>
__aicore__ inline GlobalTensor<DstT> GetBatchC(uint32_t batchA, uint32_t batchB, bool enSequentialWrite = false)
template <bool sync = true>
__aicore__ inline void GetBatchC(const LocalTensor<DstT>& c, uint32_t batchA, uint32_t batchB, bool enSequentialWrite = false)

参数说明

表1 模板参数说明

参数名

描述

sync

通过该参数设置同步或者异步模式:同步模式设置为true;异步模式设置为false,默认为同步模式。

表2 接口参数说明

参数名

输入/输出

描述

batchA

输入

左矩阵的batch数

batchB

输入

右矩阵的batch数

enSequentialWrite

输入

输出是否连续存放数据,默认false(非连续写模式)

c

输入

C矩阵放置于Local Memory的地址,用于保存矩阵分片

返回值

GlobalTensor<DstT>,返回计算的矩阵分片。

支持的型号

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

注意事项