SetOrgShape
Function Usage
Sets the original complete shape M, N, K, Ka, or Kb for Matmul computation. The unit is the number of elements.
Prototype
1 | int32_t SetOrgShape(int32_t orgMIn, int32_t orgNIn, int32_t orgKIn) |
1 | int32_t SetOrgShape(int32_t orgMIn, int32_t orgNIn, int32_t orgKaIn, int32_t orgKbIn) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
orgMIn |
Input |
Sets the size of the original complete shape M. The unit is element. |
orgNIn |
Input |
Sets the size of the original complete shape N. The unit is element. |
orgKIn |
Input |
Sets the size of the original complete shape K. The unit is element. This parameter can be set if the original complete shape meets the condition of Ka = Kb. |
orgKaIn |
Input |
Sets the size of the original complete shape Ka of matrix A. The unit is element. |
orgKbIn |
Input |
Sets the size of the original complete shape Kb of matrix B. The unit is element. |
Returns
-1: setting failed; 0: setting succeeded.
Restrictions
Values of the orgKaIn and orgKbIn parameters can be different, that is, the original matrix shapes Ka and Kb can be different. They are not the actual K value used in Matmul computation. These parameters are used only to assist in offset computation during data movement by the Matmul API.
Examples
1 2 3 4 5 | auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo()); matmul_tiling::MatmulApiTiling tiling(ascendcPlatform); tiling.SetShape(1024, 1024, 1024); tiling.SetOrgShape(1024, 1024, 1024); // Set the original complete shape. |