SetSubBlockIdx
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
x |
|
x |
|
x |
|
x |
Function Usage
Sets the ID of the current AIV. In the separated architecture, an AI Core consists of Cube Cores (AICs) and Vector Cores (AIVs) in a fixed ratio of 1:N. The IDs of the N AIVs are 0, 1, ..., and N-1, respectively.
Prototype
1 | __aicore__ inline void SetSubBlockIdx(uint8_t subBlockIdx) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
subBlockIdx |
Input |
ID of the current AIV. |
Returns
None
Restrictions
- This API can be used only in the separated architecture.
- In the separated architecture, the AIV ID is automatically initialized and assigned within the REGIST_MATMUL_OBJ() API. If the REGIST_MATMUL_OBJ() API is used in the operator program, you are not advised to call this API. If the REGIST_MATMUL_OBJ() API is not used, call this API and set the subcore ID to 0.
Example
1 2 3 4 5 6 7 | typedef AscendC::MatmulType<AscendC::TPosition::GM, CubeFormat::ND, half> aType; typedef AscendC::MatmulType<AscendC::TPosition::GM, CubeFormat::ND, half> bType; typedef AscendC::MatmulType<AscendC::TPosition::GM, CubeFormat::ND, float> cType; typedef AscendC::MatmulType<AscendC::TPosition::GM, CubeFormat::ND, float> biasType; MatmulImpl<aType, bType, cType, biasType, CFG_NORM> mm; mm.SetSubBlockIdx(0); // Set the subcore ID to 0. |
Parent topic: Matmul Kernel APIs