BatchMatmulGetTmpBufSizeV2
Function Usage
Obtains the used L1/UB/L0C size based on the tiling structure information after batch Matmul tiling.
Prototype
1 | int32_t BatchMatmulGetTmpBufSizeV2(TCubeTiling & tiling, matmul_tiling::SysTilingTempBufSize &bufSize) |
Parameters
Parameter |
Input/Output |
Description |
||
|---|---|---|---|---|
tiling |
Input |
Batch Matmul tiling structure. TCubeTiling is the Matmul TilingData defined on the kernel. It is used together with the GetTiling API whose input parameter is the TCubeTiling structure without the optiling namespace. |
||
bufSize |
Output |
Used L1/UB/L0C size obtained based on the tiling structure information. The SysTilingTempBufSize structure is defined as follows:
|
Returns
-1: setting failed; 0: setting succeeded.
Precautions
None
Example
1 2 3 4 5 6 7 8 9 | auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo()); matmul_tiling::BatchMatmulTiling bmmTiling(ascendcPlatform); bmmTiling.SetAType(matmul_tiling::TPosition::GM, matmul_tiling::CubeFormat::ND, matmul_tiling::DataType::DT_FLOAT16); ... TCubeTiling tilingData; int ret = tiling.GetTiling(tilingData); // Obtain tiling parameters. ... SysTilingTempBufSize bufSize; BatchMatmulGetTmpBufSizeV2(tilingData, bufSize); |
Parent topic: Obtaining Space Required for Matmul Computation