GetSocVersion
Function Usage
Obtains the version of the current hardware platform.
Prototype
1 | SocVersion GetSocVersion(void) const |
Parameters
None
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:
- For the following products: Run the npu-smi info command on the server where AI processor is installed to obtain the Name information. The actual value is AscendName. For example, if Name is xxxyy, the actual value is Ascendxxxyy.
Atlas A2 training product /Atlas A2 inference product Atlas 200I/500 A2 inference product Atlas inference product Atlas training product - For the
Atlas A3 training product /Atlas A3 inference product : Run the npu-smi info -t board -i id -c chip_id command on the server where AI processor is installed to obtain the Chip Name and NPU Name information. The actual value is Chip Name_NPU Name. For example, if the value of Chip Name is Ascendxxx and the value of NPU Name is 1234, the actual value is Ascendxxx_1234. Note that:- id: device ID, which is the NPU ID obtained by running the npu-smi info -l command.
- chip_id: chip ID, which is obtained by running the npu-smi info -m command.
- For the Atlas 350 Accelerator Card: Run the npu-smi info -t board -i id command on the server where AI processor is installed to obtain the Chip Name and NPU Name information. The actual value is Chip Name_NPU Name. For example, if the value of Chip Name is Ascendxxx and the value of NPU Name is 1234, the actual value is Ascendxxx_1234.
id indicates the device ID, which is the NPU ID obtained by running the npu-smi info -l command.
Constraints
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 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; } |
Parent topic: PlatformAscendC