Skip to content

Commit

Permalink
Fix COPY_INSTEAD_OF_MOVE and AUTO_CAUSES_COPY (openvinotoolkit#21267
Browse files Browse the repository at this point in the history
)

* Fix `AUTO_CAUSES_COPY` for hetero compiled_model

* Fix `COPY_INSTEAD_OF_MOVE`

* Fix `AUTO_CAUSES_COPY` in template comp_model
  • Loading branch information
vurusovs authored Nov 27, 2023
1 parent b027766 commit 6dd448d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/inference/src/dev/core_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ void ov::CoreImpl::register_plugin_in_registry_unsafe(const std::string& device_
auto fallback = it->second.as<std::string>();
// Change fallback name if fallback is configured to the HW plugin under the proxy with the same name
if (defaultConfig.find(ov::device::priorities.name()) == defaultConfig.end()) {
defaultConfig[ov::device::priorities.name()] = std::vector<std::string>{dev_name, fallback};
defaultConfig[ov::device::priorities.name()] = std::vector<std::string>{dev_name, std::move(fallback)};
} else {
auto dev_order = defaultConfig[ov::device::priorities.name()].as<std::vector<std::string>>();
auto begin_it = std::find(dev_order.begin(), dev_order.end(), dev_name);
Expand Down
6 changes: 2 additions & 4 deletions src/plugins/hetero/src/compiled_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,6 @@ void ov::hetero::CompiledModel::export_model(std::ostream& model_stream) const {

auto subnetworksNode = heteroNode.append_child("compiled_submodels");
for (const auto& comp_model_desc : m_compiled_submodels) {
auto sub_comp_model = comp_model_desc.compiled_model;
OPENVINO_ASSERT(sub_comp_model);

auto subnetworkNode = subnetworksNode.append_child("compiled_submodel");
subnetworkNode.append_attribute("device").set_value(comp_model_desc.device.c_str());
}
Expand All @@ -431,6 +428,7 @@ void ov::hetero::CompiledModel::export_model(std::ostream& model_stream) const {
model_stream << std::endl;

for (const auto& comp_model_desc : m_compiled_submodels) {
OPENVINO_ASSERT(comp_model_desc.compiled_model);
if (get_plugin()->get_core()->device_supports_model_caching(comp_model_desc.device)) {
try {
// Batch plugin reports property of low level plugin
Expand All @@ -441,7 +439,7 @@ void ov::hetero::CompiledModel::export_model(std::ostream& model_stream) const {
} catch (ov::NotImplemented&) {
}
}
auto model = comp_model_desc.model;
auto& model = comp_model_desc.model;
if (!model)
OPENVINO_THROW("OpenVINO Model is empty");

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/template/src/compiled_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ ov::Any ov::template_plugin::CompiledModel::get_property(const std::string& name
return rw_properties;
};
if (ov::model_name == name) {
auto model_name = m_model->get_friendly_name();
auto& model_name = m_model->get_friendly_name();
return decltype(ov::model_name)::value_type(model_name);
} else if (ov::loaded_from_cache == name) {
return m_loaded_from_cache;
Expand Down

0 comments on commit 6dd448d

Please sign in to comment.