GetCurNpuArch

Function Usage

Obtains the chip architecture version number of the current hardware platform.

Prototype

1
NpuArch GetCurNpuArch(void) const

Parameters

None

Returns

Enumeration class of the architecture version number of the current hardware platform. For details about the mapping between the enumeration class and AI Processor models, see the include/platform/soc_spec.h header file in CANN component directory.

Product

NPU_ARCH

Atlas 350 Accelerator Card

DAV_3510

Atlas A3 training product/Atlas A3 inference product

DAV_2201

Atlas A2 training product/Atlas A2 inference product

DAV_2201

Atlas 200I/500 A2 inference product

DAV_3002

Atlas inference product AI Core

DAV_2002

Atlas inference product Vector Core

DAV_2002

Atlas training product

DAV_1001

Restrictions

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ge::graphStatus TilingXXX(gert::TilingContext* context) {
    auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
    auto npuArch = ascendcPlatform.GetCurNpuArch();
    // ... Design the tiling policy based on the obtained version.
    // Replace DAV_XXX with the actual architecture version number.
    if (socVersion == NpuArch::DAV_XXXX) {
        // ...
    }
    return ret;
}