Skip to content

Commit

Permalink
Remove property with string for 1.0 (#22746)
Browse files Browse the repository at this point in the history
### Details:
 - Remove property with string for 1.0
 - *...*

### Tickets:
 - *ticket-id*

---------

Signed-off-by: Zhai, Xuejun <[email protected]>
Co-authored-by: Ilya Lavrenov <[email protected]>
  • Loading branch information
zhaixuejun1993 and ilya-lavrenov authored Feb 11, 2024
1 parent e57c827 commit 3bdd728
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
10 changes: 0 additions & 10 deletions samples/cpp/benchmark_app/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,12 @@ void update_device_properties_setting(const std::string& device_name,
return;
}

// because of legacy API 1.0. eg the config from JSON file.
if (config[ov::device::properties.name()].is<std::string>()) {
config[ov::device::properties.name()] = config[ov::device::properties.name()].as<ov::AnyMap>();
}

auto& device_properties = config[ov::device::properties.name()].as<ov::AnyMap>();
if (device_properties.find(device_name) == device_properties.end()) {
device_properties.insert({device_name, ov::AnyMap{device_property}});
return;
}

// because of legacy API 1.0. eg the config from JSON file.
if (device_properties[device_name].is<std::string>()) {
device_properties[device_name] = device_properties[device_name].as<ov::AnyMap>();
}

auto& secondary_property = device_properties[device_name].as<ov::AnyMap>();
// overwrite if this config existed
secondary_property.erase(device_property.first);
Expand Down
8 changes: 0 additions & 8 deletions src/inference/src/dev/core_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,13 @@ ov::AnyMap flatten_sub_properties(const std::string& user_device_name, const ov:
auto device_properties = result_properties.find(ov::device::properties.name());
if (device_properties == result_properties.end()) {
result_properties[ov::device::properties.name()] = ov::AnyMap{};
} else if (device_properties->second.is<std::string>()) { // because of legacy API 1.0
device_properties->second = device_properties->second.as<ov::AnyMap>();
}
auto& secondary_properties = result_properties[ov::device::properties.name()].as<ov::AnyMap>();
auto secondary_properties_it = secondary_properties.find(subprop_device_name);
if (secondary_properties_it == secondary_properties.end()) {
// 2.1.1. No device name in map yet, insert all config as is
secondary_properties[subprop_device_name] = secondary_property->second;
} else {
if (secondary_properties_it->second.is<std::string>()) { // because of legacy API 1.0
secondary_properties_it->second = secondary_properties_it->second.as<ov::AnyMap>();
}
// 2.1.2. Device name is present in config file, merge properties according to:
// ov::device::properties(<device_name>) overrides ov::device::properties(ov::AnyMap{})
auto& secondary_device_properties = secondary_properties_it->second.as<ov::AnyMap>();
Expand All @@ -149,9 +144,6 @@ ov::AnyMap flatten_sub_properties(const std::string& user_device_name, const ov:
}

// 2. device properties DEVICE_PROPERTIES are found
if (property->second.is<std::string>()) { // because of legacy API 1.0
property->second = property->second.as<ov::AnyMap>();
}
auto& secondary_properties = property->second.as<ov::AnyMap>();

for (auto secondary_property = secondary_properties.begin();
Expand Down

0 comments on commit 3bdd728

Please sign in to comment.