Skip to content

Commit

Permalink
Fix warning in template plugin (openvinotoolkit#19932)
Browse files Browse the repository at this point in the history
  • Loading branch information
riverlijunjie authored Sep 19, 2023
1 parent 933d9c1 commit e34f3a1
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 35 deletions.
10 changes: 0 additions & 10 deletions src/plugins/template/src/compiled_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ std::shared_ptr<const ov::template_plugin::Plugin> ov::template_plugin::Compiled

// ! [compiled_model:get_property]
ov::Any ov::template_plugin::CompiledModel::get_property(const std::string& name) const {
const auto& add_ro_properties = [](const std::string& name, std::vector<ov::PropertyName>& properties) {
properties.emplace_back(ov::PropertyName{name, ov::PropertyMutability::RO});
};
const auto& default_ro_properties = []() {
std::vector<ov::PropertyName> ro_properties{ov::model_name,
ov::supported_properties,
Expand All @@ -141,13 +138,6 @@ ov::Any ov::template_plugin::CompiledModel::get_property(const std::string& name
std::vector<ov::PropertyName> rw_properties{ov::device::id, ov::enable_profiling};
return rw_properties;
};
const auto& to_string_vector = [](const std::vector<ov::PropertyName>& properties) {
std::vector<std::string> ret;
for (const auto& property : properties) {
ret.emplace_back(property);
}
return ret;
};
if (ov::model_name == name) {
auto model_name = m_model->get_friendly_name();
return decltype(ov::model_name)::value_type(model_name);
Expand Down
10 changes: 0 additions & 10 deletions src/plugins/template/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@ void ov::template_plugin::Plugin::set_property(const ov::AnyMap& properties) {

// ! [plugin:get_property]
ov::Any ov::template_plugin::Plugin::get_property(const std::string& name, const ov::AnyMap& arguments) const {
const auto& add_ro_properties = [](const std::string& name, std::vector<ov::PropertyName>& properties) {
properties.emplace_back(ov::PropertyName{name, ov::PropertyMutability::RO});
};
const auto& default_ro_properties = []() {
std::vector<ov::PropertyName> ro_properties{ov::available_devices,
ov::supported_properties,
Expand All @@ -240,13 +237,6 @@ ov::Any ov::template_plugin::Plugin::get_property(const std::string& name, const
ov::template_plugin::disable_transformations};
return rw_properties;
};
const auto& to_string_vector = [](const std::vector<ov::PropertyName>& properties) {
std::vector<std::string> ret;
for (const auto& property : properties) {
ret.emplace_back(property);
}
return ret;
};
if (ov::supported_properties == name) {
auto ro_properties = default_ro_properties();
auto rw_properties = default_rw_properties();
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/template/tests/functional/op_reference/loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ struct LoopStaticInputs : public LoopFunctionalBase {

// Body
std::shared_ptr<ov::Node> Zo = body_params[0];
for (int i = 1; i < body_params.size(); ++i) {
for (size_t i = 1; i < body_params.size(); ++i) {
Zo = std::make_shared<ov::opset8::Add>(body_params[i], Zo);
}

Expand All @@ -164,7 +164,7 @@ struct LoopStaticInputs : public LoopFunctionalBase {
loop->set_function(body);
loop->set_special_body_ports(ov::opset8::Loop::SpecialBodyPorts{-1, 0});

for (int i = 0; i < body_params.size(); ++i) {
for (size_t i = 0; i < body_params.size(); ++i) {
if (loop_in_type[i] == LOOP_IN_TYPE::INVARIANT) {
loop->set_invariant_input(body_params[i], loop_params[i]);
} else if (loop_in_type[i] == LOOP_IN_TYPE::MERGED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ class ReferenceMemoryTest : public testing::TestWithParam<MemoryTestParams> {
void CommonTestSteps(const std::function<void(size_t, ov::InferRequest&)>& custom_step = nullptr) {
auto params = GetParam();

const auto& functionParams = function->get_parameters();
inferRequest.set_tensor(executableNetwork.input(0), params.m_input_data);
for (size_t i = 0; i < params.m_count_runs; ++i) {
if (custom_step) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ static std::shared_ptr<Model> create_simple_function(element::Type type, const P
return std::make_shared<ov::Model>(ResultVector{res}, ParameterVector{data1});
}

static std::shared_ptr<Model> create_simple_function_yuv(const PartialShape& shape) {
auto data1 = std::make_shared<op::v0::Parameter>(element::u8, shape);
data1->set_friendly_name("input1");
data1->get_output_tensor(0).set_names({"tensor_input1", "input1"});
auto op = std::make_shared<op::v0::Convert>(data1, element::f32);
op->set_friendly_name("Convert1");
auto res = std::make_shared<op::v0::Result>(op);
res->set_friendly_name("Result1");
res->get_output_tensor(0).set_names({"tensor_output1", "Result1", "Convert1"});
return std::make_shared<ov::Model>(ResultVector{res}, ParameterVector{data1});
}

TEST_F(ReferencePreprocessLegacyTest, mean) {
function = create_simple_function(element::f32, Shape{1, 3, 2, 2});
auto p = PrePostProcessor(function);
Expand Down

0 comments on commit e34f3a1

Please sign in to comment.