SetSingleShape
Function Description
Sets the shapes singleCoreM, singleCoreN, and singleCoreK of the Matmul single-core computation. The unit is the number of elements. It is used to modify the shape during runtime, for example, use a Matmul object to process tail blocks.
Prototype
1 | __aicore__ inline void SetSingleShape(int singleM, int singleN, int singleK) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
singleM |
Input |
Size of singleCoreM. The unit is element. |
singleN |
Input |
Size of singleCoreN. The unit is element. |
singleK |
Input |
Size of singleCoreK. The unit is element. |
Returns
None
Availability
Precautions
None
Example
1 2 3 4 5 6 | REGIST_MATMUL_OBJ(&pipe, GetSysWorkSpacePtr(), mm, &tiling); mm.SetTensorA(gm_a); mm.SetTensorB(gm_b); mm.SetBias(gm_bias); mm.SetSingleShape(tailM,tailN,tailK); // If it is a tail core, adjustments need to be made to singleCoreM, singleCoreN, and singleCoreK. mm.IterateAll(gm_c); |
Parent topic: Matmul