BatchMatmulGetTmpBufSizeV2
Function
Obtains the used L1 Buffer, Unified Buffer, or L0C Buffer size based on the tiling structure information after BatchMatmul tiling calls the GetTiling API to obtain tiling parameters.
Prototype
1
|
int32_t BatchMatmulGetTmpBufSizeV2(AscendC::tiling::TCubeTiling &tiling, matmul_tiling::SysTilingTempBufSize &bufSize) |
Parameters
|
Parameter |
Input/Output |
Description |
||
|---|---|---|---|---|
|
tiling |
Input |
BatchMatmul tiling structure, which is the TCubeTiling structure obtained by the BatchMatmulTiling object. TCubeTiling is the Matmul TilingData defined in the kernel and is used together with the GetTiling API whose input parameter is the TCubeTiling structure with the AscendC::tiling namespace. |
||
|
bufSize |
Output |
Used L1 Buffer, Unified Buffer, or L0C Buffer size obtained based on the TCubeTiling structure information. The SysTilingTempBufSize structure is defined as follows:
|
Returns
-1: setting failed; 0: setting succeeded.
Restrictions
None
Example
1 2 3 4 5 6 7 |
auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo()); matmul_tiling::BatchMatmulTiling tiling(ascendcPlatform); AscendC::tiling::TCubeTiling tilingData; ... // Initialize tilingData. For details, see the usage description of MatmulTiling APIs. int ret = tiling.GetTiling(tilingData); // Obtain tiling parameters. SysTilingTempBufSize bufSize; BatchMatmulGetTmpBufSizeV2(tilingData, bufSize); |
Parent topic: Obtaining Space Required for Matmul Computation