SetFixSplit
Function Usage
Sets the fixed baseM, baseN, and baseK. The unit is the number of elements.
Prototype
1 | int32_t SetFixSplit(int32_t baseMIn = -1, int32_t baseNIn = -1, int32_t baseKIn = -1) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
baseMIn |
Input |
Sets a fixed baseM. The default value is -1, indicating that no fixed baseM is set and it is computed by the tiling function. |
baseNIn |
Input |
Sets a fixed baseN. The default value is -1, indicating that no fixed baseN is set and it is computed by the tiling function. |
baseKIn |
Input |
The value can only be -1. |
Returns
-1: setting failed; 0: setting succeeded.
Restrictions
- The size of the storage space occupied by baseM × baseN output elements cannot exceed the size of the L0C buffer, that is, baseM × baseN × sizeof(C_TYPE) ≤ L0CSize.
- The value of baseM must be less than or equal to the value of singleM that is 16-element aligned upwards (for example, ceil(singleM/16) × 16), and the value of baseN must be less than or equal to the value of singleN that is C0_size-element aligned upwards. singleM indicates the length of a single-core M axis, singleN indicates the length of a single-core N axis, and C0_size is 16 for data type half or bfloat16_t, 8 for float, 32 for int8_t, and 64 for int4b_t. For example, if singleM is 12, the value of baseM must be less than or equal to 16. In addition, it must be fractal-aligned. Therefore, baseM can only be 16. Otherwise, tiling information fails to be obtained.
Examples
1 2 3 4 | auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo()); matmul_tiling::MatmulApiTiling tiling(ascendcPlatform); tiling.SetFixSplit(16, 16, -1); // Set the fixed baseM and baseN. |
Parent topic: Matmul Tiling