!19176 fix 310 check support

Merge pull request !19176 from zhoufeng/fix-310-check-support
This commit is contained in:
i-robot 2021-07-01 01:23:57 +00:00 committed by Gitee
commit d7e0b93c61
1 changed files with 11 additions and 0 deletions

View File

@ -172,6 +172,17 @@ uint32_t MsModel::GetDeviceID() const {
}
bool MsModel::CheckModelSupport(enum ModelType model_type) {
#if ENABLE_D
const char *soc_name_c = aclrtGetSocName();
if (soc_name_c == nullptr) {
return false;
}
std::string soc_name(soc_name_c);
if (soc_name.find("910") == std::string::npos) {
return false;
}
#endif
static const std::set<ModelType> kSupportedModelMap = {kMindIR};
auto iter = kSupportedModelMap.find(model_type);
if (iter == kSupportedModelMap.end()) {