SetBufferSpace
Function Usage
Sets the size of the available L1 Buffer/L0C Buffer/Unified Buffer/BiasTable Buffer space during Matmul computation. The unit is byte.
Prototype
1 | int32_t SetBufferSpace(int32_t l1Size = -1, int32_t l0CSize = -1, int32_t ubSize = -1, int32_t btSize = -1) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
l1Size |
Input |
Sets the size of the L1 buffer that can be used during Matmul computation. The unit is byte. The default value is -1, indicating the size of the AI Processor L1 buffer in use. |
l0CSize |
Input |
Sets the size of the L0C buffer that can be used during Matmul computation. The unit is byte. The default value is -1, indicating the size of the AI Processor L0C buffer in use. |
ubSize |
Input |
Sets the size of the UB buffer that can be used during Matmul computation. The unit is byte. The default value is -1, indicating the size of the AI Processor UB buffer in use. |
btSize |
Input |
Sets the size of the BiasTable buffer that can be used during Matmul computation. The unit is byte. The default value is -1, indicating the size of the AI Processor BiasTable buffer in use. |
Returns
-1: setting failed; 0: setting succeeded.
Restrictions
None
Examples
1 2 3 | auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo()); matmul_tiling::MatmulApiTiling tiling(ascendcPlatform); tiling.SetBufferSpace(-1, -1, -1, -1); // Set the size of the available L1, L0C, UB, or BiasTable buffer space during computation. |