SetScaleBType
Function Usage
Sets the position, data format, and transpose status of matrix scaleB in the MxMatmul scenario. These settings must be consistent with those in the kernel. If this API is not called, the settings of matrix scaleB will be kept the same as that of matrix B in SetBType.
Prototype
1
|
int32_t SetScaleBType(TPosition scalePos, CubeFormat scaleType, bool isScaleTrans = true) |
Parameters
Returns
-1: setting failed; 0: setting succeeded.
Restrictions
None
Example
1 2 3 4 5 6 |
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); // Set matrix scaleB, with the buffer located in the GM, data format of ND, and transpose enabled. tiling.SetScaleBType(matmul_tiling::TPosition::GM, matmul_tiling::CubeFormat::ND, true); |
Parent topic: Matmul Tiling