GetSocVersion
函数功能
获取当前硬件平台版本型号。
函数原型
SocVersion GetSocVersion(void) const;
参数说明
参数 |
输入/输出 |
说明 |
---|---|---|
- |
- |
- |
返回值说明
当前硬件平台版本型号的枚举类。该枚举类和AI处理器型号的对应关系请通过CANN软件安装后文件存储路径下include/tiling/platform/platform_ascendc.h头文件获取。
AI处理器的型号请通过如下方式获取:在安装昇腾AI处理器的服务器执行npu-smi info命令进行查询,在查询到的“Name”前增加Ascend信息,例如“Name”对应取值为xxxyy,AI处理器的型号为Ascendxxxyy。
约束说明
无
调用示例
ge::graphStatus TilingXXX(gert::TilingContext* context) { auto ascendcPlatform = platform_ascendc::PlatformAscendC(context->GetPlatformInfo()); auto socVersion = ascendcPlatform.GetSocVersion(); // 根据所获得的版本型号自行设计Tiling策略 // ASCENDXXX请替换为实际的版本型号 if (socVersion == platform_ascendc::SocVersion::ASCENDXXX) { // ... } return ret; }
父主题: PlatformAscendC类