SetMadType
Function Usage
Sets whether to enable the HF32 mode. Not supported in the current version.
For the Atlas 350 Accelerator Card, sets whether to enable the HF32 mode (not supported in the current version) and whether to enable the MxMatmul scenario. In the MxMatmul scenario, this API must be called and MxMatmul must be enabled to ensure that the tiling parameters are correctly computed and returned in this scenario.
Prototype
1 | int32_t SetMadType(MatrixMadType madType) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
madType |
Input |
Matmul mode. The values are of the MatrixMadType type. The code below describes the definition. The parameters are described as follows: MatrixMadType::NORMAL: normal mode, which is different from the HF32 mode and MxMatmul scenario. MatrixMadType::HF32: HF32 mode. MatrixMadType::MXMODE: MxMatmul scenario. This parameter is supported only by the Atlas 350 Accelerator Card. |
1 2 3 4 5 | enum class MatrixMadType : int32_t { NORMAL = 0, HF32 = 1, MXMODE = 2, }; |
Returns
-1: setting failed; 0: setting succeeded.
Restrictions
None
Example
1 2 3 4 | auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo()); matmul_tiling::MatmulApiTiling tiling(ascendcPlatform); tiling.SetTraverse(MatrixTraverse::FIRSTM); // Set the traversal mode. tiling.SetMadType(MatrixMadType::MXMODE); // Enable the MxMatmul scenario. |