SetTraverse

Function Usage

Sets the fixed Matmul computation direction, which means whether the computation starts from the M axis or N axis.

Prototype

1
int32_t SetTraverse(MatrixTraverse traverse)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

traverse

Input

Fixed Matmul computation direction. Possible values are MatrixTraverse::FIRSTM and MatrixTraverse::FIRSTN.

FIRSTM indicates that offsetting is performed along the M-axis direction first and then along the N-axis direction.

FIRSTN indicates that offsetting is performed along the N-axis direction first and then along the M-axis direction.

Returns

-1: setting failed; 0: setting succeeded.

Restrictions

None

Examples

1
2
3
auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
matmul_tiling::MatmulApiTiling tiling(ascendcPlatform); 
tiling.SetTraverse(MatrixTraverse::FIRSTM);  // Set the traversal mode.