SetAlignSplit

Function Usage

Sets the singleCoreM, singcleCoreN, and singleCoreK alignment values during multi-core splitting. For example, if the alignment value of singleCoreM is 64 (unit: element), the tiled singleCoreM value is a multiple of 64.

Prototype

1
int32_t SetAlignSplit(int32_t alignM, int32_t alignN, int32_t alignK)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

alignM

Input

Alignment value of singleCoreM. If -1 is passed, the alignment value of the specified singleCoreM is not set. Instead, it is calculated by the tiling function.

alignN

Input

Alignment value of singleCoreN. If -1 is passed, the alignment value of the specified singleCoreN is not set. Instead, it is calculated by the tiling function.

alignK

Input

Alignment value of singleCoreK. If -1 is passed, the alignment value of the specified singleCoreK is not set. Instead, it is calculated by the tiling function.

Returns

-1: setting failed; 0: setting succeeded.

Precautions

None

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
matmul_tiling::MultiCoreMatmulTiling tiling(ascendcPlatform); 
tiling.SetDim(1);
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.SetAlignSplit(-1, 64, -1); //: Specify the alignment values of singleCoreM, singcleCoreN, and singleCoreK.
tiling.SetOrgShape(1024, 1024, 1024);
tiling.SetBias(true);   
tiling.SetBufferSpace(-1, -1, -1);
optiling::TCubeTiling tilingData;   
int ret = tiling.GetTiling(tilingData);