GetTiling
Function Usage
Obtains tiling parameters.
Prototype
1
|
int64_t GetTiling(optiling::TCubeTiling &tiling) |
1
|
int64_t GetTiling(AscendC::tiling::TCubeTiling &tiling) |
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
tiling |
Output |
The tiling structure stores the final tiling result. For details about the TCubeTiling structure, see Table 1.
|
Returns
If the return value is not -1, the tiling computation is successful. You can use the value of the tiling structure. If the return value is -1, the tiling computation fails and the tiling result cannot be used.
Restrictions
If the tiling computation fails and you need to view the failure cause, set the log level to WARNING and search for the keyword MatmulApi Tiling in the log. If the tiling computation succeeds and you need to view the parameter values of the tiling structure, set the log level to INFO and search for the keyword MatmulTiling in the log. For details about how to set the log level, see Environment VariablesLogs > ASCEND_GLOBAL_LOG_LEVEL.
Examples
1 2 3 4 5 6 7 8 9 10 11 12 |
auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo()); matmul_tiling::MatmulApiTiling tiling(ascendcPlatform); tiling.SetAType(matmul_tiling::TPosition::GM, matmul_tiling::CubeFormat::ND, matmul_tiling::DataType::DT_FLOAT16); tiling.SetBType(matmul_tiling::TPosition::GM, matmul_tiling::CubeFormat::ND, matmul_tiling::DataType::DT_FLOAT16); tiling.SetCType(matmul_tiling::TPosition::GM, matmul_tiling::CubeFormat::ND, matmul_tiling::DataType::DT_FLOAT); tiling.SetBiasType(matmul_tiling::TPosition::GM, matmul_tiling::CubeFormat::ND, matmul_tiling::DataType::DT_FLOAT); tiling.SetShape(1024, 1024, 1024); tiling.SetOrgShape(1024, 1024, 1024); tiling.SetBias(true); tiling.SetBufferSpace(-1, -1, -1); optiling::TCubeTiling tilingData; int ret = tiling.GetTiling(tilingData); // Obtain tiling parameters. |