GetCoreNumVector

Function

Obtains the number of independent vector cores on the hardware platform.

This API is valid only on the Atlas inference products. For other hardware platforms, it returns 0.

Prototype

1
uint32_t GetCoreNumVector(void) const

Parameters

None

Returns

Number of vector cores on the hardware platform

Constraints

For the Atlas training products, this API is not supported and 0 is returned.

For the Atlas inference products, this API is supported and the number of vector cores on the hardware platform is returned.

For the Atlas A2 training products/Atlas A2 inference products, this API is not supported and 0 is returned.

For the Atlas A2 training products/Atlas A2 inference products, this API is not supported and 0 is returned.

For the Atlas 200I/500 A2 inference products, this API is not supported and 0 is returned.

Example

1
2
3
4
5
6
7
8
ge::graphStatus TilingXXX(gert::TilingContext* context) {
    auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
    auto aivCoreNum = ascendcPlatform.GetCoreNumAiv();
    auto vectorCoreNum = ascendcPlatform.GetCoreNumVector();
    auto allVecCoreNums = aivCoreNum + vectorCoreNum;
    // ... Split by allVecCoreNums.
    return ret;
}