GetCoreNumAic

Function

Obtains the number of cube cores on AI Cores of the current hardware platform. If the AI Core architecture is in Cube-Vector decoupled mode, the number of Cube cores is returned. If the AI Core architecture is in Cube-Vector coupled mode, the number of AI Cores is returned.

Prototype

1
uint32_t GetCoreNumAic(void) const

Parameters

None

Returns

Atlas training products: In coupled mode, the number of AI Cores is returned.

Atlas inference products: In coupled mode, the number of AI Cores is returned.

Atlas A2 training products/Atlas A2 inference products: In decoupled mode, the number of Cube cores is returned.

Atlas A3 training products/Atlas A3 inference products: In decoupled mode, the number of Cube cores is returned.

Restrictions

None

Examples

1
2
3
4
5
6
7
8
ge::graphStatus TilingXXX(gert::TilingContext* context) {
    auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
    auto aicNum = ascendcPlatform.GetCoreNumAic();
    auto aivNum = ascendcPlatform.GetCoreNumAiv();
    // ... Split by aivNum.
    context->SetBlockDim(ascendcPlatform.CalcTschBlockDim(aivNum, aicNum, aivNum));
    return ret;
}