目录

Init

Function Description

Initializes the tiling data in the Matmul object. Resources are divided based on the tiling parameters. For details about the tiling parameters, see Matmul Tiling.

You can use REGIST_MATMUL_OBJ to initialize a single Matmul object without passing the tiling parameters. Later, you can use the Init API to pass the tiling parameters to adjust the tiling data. For example, in scenarios where tiling is variable, you can call Init to reset the tiling parameters multiple times.

If no tiling change is required, you are advised to use REGIST_MATMUL_OBJ to pass tiling parameters for initialization.

Function Prototype

__aicore__ inline void Init(const TCubeTiling* __restrict cubeTiling, TPipe* tpipe = nullptr)

Parameters

Table 1 API parameters

Parameter Input/Output Description
cubeTiling Input

Matmul tiling parameter. For details about the definition of the TCubeTiling structure, see Table 1 in TCubeTiling structure.

The tiling parameter can be obtained through the GetTiling API on the host and passed to the kernel for use.

tpipe Input Tpipe object.

Return Value

None

Supported Models

Kirin 9020 series processors

Kirin 9030 series processors

Precautions

None

Calling Example

// You can use REGIST_MATMUL_OBJ to initialize a single Matmul object without passes the tiling parameters. Later, you can use the Init API to pass the tiling parameters to adjust the tiling data.
REGIST_MATMUL_OBJ(&pipe, GetSysWorkSpacePtr(), mm);
mm.Init(&tiling);