产品 |
是否支持 |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
|
x |
|
x |
通过设置结果矩阵Output在GM上的首地址,本接口一次性计算singleCo * singleDo * singleM大小的数据块,并写到结果矩阵Output中。
本接口提供单核内卷积计算能力,singleCo为多核切分后单个核内的输出通道大小;singleDo为多核切分后单个核内的Dout大小;singleM为多核切分后单个核内的M大小。singleCo、singleDo和singleM的大小通过SetSingleOutputShape接口设置。
1 | __aicore__ inline void IterateAll(const AscendC::GlobalTensor<OutputT>& output, bool enPartialSum = false) |
参数名 |
输入/输出 |
描述 |
|---|---|---|
output |
输入 |
Output在GM上的地址。类型为GlobalTensor。结果矩阵Output支持的数据类型为:half/bfloat16_t。 |
enPartialSum |
输入 |
预留参数。 |
无
1 2 3 4 5 | for (uint64_t batchIter = 0; batchIter < singleCoreBatch; ++batchIter) { conv3dApi.SetInput(inputGm[batchIter * inputOneBatchSize]); conv3dApi.IterateAll(outputGm[batchIter * outputOneBatchSize]); conv3dApi.End(); } |
1 2 3 4 | Init(...); ... // 输入输出配置 IterateAll(...); End(); |
1 2 3 4 5 6 7 8 9 10 11 12 13 | TPipe pipe; conv3dApi.Init(&tiling); conv3dApi.SetWeight(weightGm); if (biasFlag) { conv3dApi.SetBias(biasGm); } conv3dApi.SetInputStartPosition(diIdxStart, mIdxStart); conv3dApi.SetSingleOutputShape(singleCoreCout, singleCoreDout, singleCoreM); for (uint64_t batchIter = 0; batchIter < singleCoreBatch; ++batchIter) { conv3dApi.SetInput(inputGm[batchIter * inputOneBatchSize]); conv3dApi.IterateAll(outputGm[batchIter * outputOneBatchSize]); conv3dApi.End(); } |