Fix for mac caching test (#10151)

* Fix for mac

* Fixed rtti comparison

* used defined
This commit is contained in:
Anton Pankratov 2022-02-07 19:22:21 +03:00 committed by GitHub
parent d62d185ac5
commit e34ff009e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 23 deletions

View File

@ -11,7 +11,7 @@ namespace ov {
bool Any::equal(std::type_index lhs, std::type_index rhs) {
auto result = lhs == rhs;
#ifdef __ANDROID__
#if (defined(__ANDROID__) || defined(__APPLE__)) && defined(__clang__)
if (!result) {
result = std::strcmp(lhs.name(), rhs.name()) == 0;
}

View File

@ -240,20 +240,24 @@ public:
try {
return {_ptr->GetMetric(name, arguments), _so};
} catch (ie::Exception&) {
auto ro_properties = _ptr->GetMetric(METRIC_KEY(SUPPORTED_METRICS), arguments)
.as<std::vector<std::string>>();
auto rw_properties = _ptr->GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS), arguments)
.as<std::vector<std::string>>();
std::vector<ov::PropertyName> supported_properties;
for (auto&& ro_property : ro_properties) {
if (ro_property != METRIC_KEY(SUPPORTED_METRICS) &&
ro_property != METRIC_KEY(SUPPORTED_CONFIG_KEYS)) {
supported_properties.emplace_back(ro_property, PropertyMutability::RO);
try {
auto ro_properties = _ptr->GetMetric(METRIC_KEY(SUPPORTED_METRICS), arguments)
.as<std::vector<std::string>>();
for (auto&& ro_property : ro_properties) {
if (ro_property != METRIC_KEY(SUPPORTED_METRICS) &&
ro_property != METRIC_KEY(SUPPORTED_CONFIG_KEYS)) {
supported_properties.emplace_back(ro_property, PropertyMutability::RO);
}
}
}
for (auto&& rw_property : rw_properties) {
supported_properties.emplace_back(rw_property, PropertyMutability::RW);
}
} catch (ie::Exception&) {}
try {
auto rw_properties = _ptr->GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS), arguments)
.as<std::vector<std::string>>();
for (auto&& rw_property : rw_properties) {
supported_properties.emplace_back(rw_property, PropertyMutability::RW);
}
} catch (ie::Exception&) {}
supported_properties.emplace_back(ov::supported_properties.name(), PropertyMutability::RO);
return supported_properties;
}

View File

@ -220,11 +220,7 @@ class CoreImpl : public ie::ICore, public std::enable_shared_from_this<ie::ICore
}
bool DeviceSupportsConfigKey(const ov::InferencePlugin& plugin, const std::string& key) const {
try {
return util::contains(plugin.get_property(ov::supported_properties), key);
} catch (...) {
return false;
}
return util::contains(plugin.get_property(ov::supported_properties), key);
}
bool DeviceSupportsImportExport(const ov::InferencePlugin& plugin) const {
@ -242,11 +238,7 @@ class CoreImpl : public ie::ICore, public std::enable_shared_from_this<ie::ICore
}
bool DeviceSupportsCacheDir(const ov::InferencePlugin& plugin) const {
try {
return util::contains(plugin.get_property(ov::supported_properties), ov::cache_dir);
} catch (...) {
return false;
}
return util::contains(plugin.get_property(ov::supported_properties), ov::cache_dir);
}
ov::SoPtr<ie::IExecutableNetworkInternal> compile_model_impl(const InferenceEngine::CNNNetwork& network,