目录

GetBlockNum

Function Description

Obtains the number of cores configured for the current task, which is used for multi-core logic control in the code.

Function Prototype

__aicore__ inline int64_t GetBlockNum()

Parameters

None

Return Value

Number of cores configured for the current task

Supported Models

Kirin 9020 series processors

Kirin 9030 series processors

Kirin X90 series processors

Restrictions

None

Calling Example

#include "kernel_operator.h"
// Use block_num for simple tiling computation in the core. It is recommended that complex tiling be performed on the host.
__aicore__ inline void InitTilingParam(int32_t& totalSize, int32_t& loopSize)
{
    loopSize = totalSize / AscendC::GetBlockNum();
};