template <bool sync = true> __aicore__ inline void IterateAll(const GlobalTensor<DstT>& gm, uint8_t enAtomic = 0, bool enSequentialWrite = false, bool waitIterateAll = false, bool fakeMsg = false) template <bool sync = true> __aicore__ inline void IterateAll(const LocalTensor<DstT>& ubCmatrix, uint8_t enAtomic = 0)
表1 模板参数说明
| 参数名 | 描述 |
|---|---|
| sync | 获取C矩阵过程分为同步和异步两种模式: - 同步:需要同步等待IterateAll执行结束。 - 异步:不需要同步等待IterateAll执行结束。 通过该参数设置同步或者异步模式:同步模式设置为true,异步模式设置为false,默认为同步模式。 |
表2 接口参数说明
| 参数名 | 输入/输出 | 描述 |
|---|---|---|
| gm | 输入 | C矩阵放置于Global Memory的地址。 Kirin9020系列处理器、Kirin9030系列处理器,支持的数据类型为:half。 |
| ubCmatrix | 输入 | C矩阵放置于Local Memory的地址。TPosition可设置为TPosition::TSCM。 Kirin9020系列处理器、Kirin9030系列处理器,支持的数据类型为:half。 |
| enAtomic | 输入 | 是否开启Atomic操作,默认值为0。 参数取值: 0:不开启Atomic操作 1:开启AtomicAdd累加操作 2:开启AtomicMax求最大值操作 3:开启AtomicMin求最小值操作 。 |
| enSequentialWrite | 输入 | 是否开启连续写模式(连续写,写入[baseM, baseN]。非连续写,写入[singleCoreM、singleCoreN]中对应的位置),默认值false(非连续写模式)。 |
| waitIterateAll | 输入 | 仅在异步场景下使用,是否需要通过WaitIterateAll接口等待IterateAll执行结束。 true:需要通过WaitIterateAll接口等待IterateAll执行结束。 false:不需要通过WaitIterateAll接口等待IterateAll执行结束,开发者自行处理等待IterateAll执行结束的过程。 |
| fakeMsg | 输入 | 仅在IBShare(模板参数中开启了doIBShareNorm开关)场景使用。 IBShare用于保证复用L1上相同的A矩阵或B矩阵数据,要求AIV分核调用IterateAll的次数必须匹配,此时需要调用IterateAll并设置fakeMsg为true,不执行真正的计算,仅用来保证IterateAll调用成对出现。默认值为false,表示执行真正的计算。 |