SetSingleRange

Function Usage

Sets the maximum and minimum values of singleCoreM, singleCoreN, and singleCoreK.

Prototype

1
int32_t SetSingleRange(int32_t maxM = -1, int32_t maxN = -1, int32_t maxK = -1, int32_t minM = -1, int32_t minN = -1, int32_t minK = -1)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

maxM

Input

Maximum value of singleCoreM. The default value is -1. The value -1 indicates that the maximum value of singleCoreM is not set. Instead, it is calculated by the tiling function.

maxN

Input

Maximum value of singleCoreN. The default value is -1. The value -1 indicates that the maximum value of singleCoreN is not set. Instead, it is calculated by the tiling function.

maxK

Input

Maximum value of singleCoreK. The default value is -1. The value -1 indicates that the maximum value of singleCoreK is not set. Instead, it is calculated by the tiling function.

minM

Input

Minimum singleCoreM value. The default value is -1. The value -1 indicates that the minimum value of singleCoreM is not set. Instead, it is calculated by the tiling function.

minN

Input

Minimum singleCoreN value. The default value is -1. The value -1 indicates that the minimum value of singleCoreN is not set. Instead, it is calculated by the tiling function.

minK

Input

Minimum singleCoreK value. The default value is -1. The value -1 indicates that the minimum value of 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.SetSingleRange(1024, 1024, 1024, 1024, 1024, 1024); //: Set the maximum and minimum values of singleCoreM, singleCoreN, and singleCoreK.
tiling.SetOrgShape(1024, 1024, 1024);
tiling.SetBias(true);   
tiling.SetBufferSpace(-1, -1, -1);
optiling::TCubeTiling tilingData;   
int ret = tiling.GetTiling(tilingData);