产品 |
是否支持 |
|---|---|
Ascend 950PR/Ascend 950DT |
√ |
√ |
|
√ |
|
x |
|
√ |
|
x |
|
x |
在不改变Tiling的情况下,重新设置多Batch计算的Batch数。
1 | __aicore__ inline void SetBatchNum(int32_t batchA, int32_t batchB) |
无
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | // 纯cube模式 #define ASCENDC_CUBE_ONLY typedef AscendC::MatmulType<AscendC::TPosition::GM, CubeFormat::ND, AType, false, LayoutMode::NORMAL> aType; typedef AscendC::MatmulType<AscendC::TPosition::GM, CubeFormat::ND, BType, false, LayoutMode::NORMAL> bType; typedef AscendC::MatmulType<AscendC::TPosition::GM, CubeFormat::ND, CType, false, LayoutMode::NORMAL> cType; typedef AscendC::MatmulType<AscendC::TPosition::GM, CubeFormat::ND, BiasType> biasType; AscendC::Matmul<aType, bType, cType, biasType> mm1; mm1.SetTensorA(gm_a, isTransposeAIn); mm1.SetTensorB(gm_b, isTransposeBIn); if(tiling.isBias) { mm1.SetBias(gm_bias); } mm1.SetBatchNum(batchA, batchB); // 多batch Matmul计算 mm1.IterateBatch(gm_c, false, 0, false); |