GetSocVersion

Function Usage

Obtains the version of the current hardware platform.

Prototype

SocVersion GetSocVersion(void) const;

Parameters

Parameter

Input/Output

Description

-

-

-

Returns

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

The AI processor model can be obtained in the following ways:

  • Run the npu-smi info command on the server where the Ascend AI Processor is installed to obtain the Chip Name information. The actual value is AscendChip Name. For example, if Chip Name is xxxyy, the actual value is Ascendxxxyy.

Constraints

None

Example

ge::graphStatus TilingXXX(gert::TilingContext* context) {
    auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo());
    auto socVersion = ascendcPlatform.GetSocVersion();
    // ... Design the tiling policy based on the obtained version.
    // Replace ASCENDXXX with the actual version number.
    if (socVersion == platform_ascendc::SocVersion::ASCENDXXX) {
        // ...
    }
    return ret;
}