diff --git a/src/plugins/template/src/config.cpp b/src/plugins/template/src/config.cpp index d47e826e826..64c5541d556 100644 --- a/src/plugins/template/src/config.cpp +++ b/src/plugins/template/src/config.cpp @@ -83,6 +83,32 @@ Configuration::Configuration(const ov::AnyMap& config, const Configuration& defa log_level = value.as(); } else if (ov::hint::model_priority == key) { model_priority = value.as(); + } else if (ov::optimal_batch_size == key) { + try { + auto tmp_i = value.as(); + optimal_batch_size = tmp_i; + } catch (const std::exception&) { + OPENVINO_THROW("Incorrect value ", value.as(), "for property key ", key); + } + } else if (ov::max_batch_size == key) { + try { + auto tmp_i = value.as(); + max_batch_size = tmp_i; + } catch (const std::exception&) { + OPENVINO_THROW("Incorrect value ", value.as(), "for property key ", key); + } + } else if (ov::loaded_from_cache == key) { + loaded_from_cache = value.as(); + } else if (ov::compilation_num_threads == key) { + try { + auto tmp_i = value.as(); + if (tmp_i >= 0) + compilation_num_threads = tmp_i; + else + OPENVINO_THROW("Incorrect value, it should be unsigned integer: ", key); + } catch (const std::exception&) { + OPENVINO_THROW("Incorrect value ", value.as(), "for property key ", key); + } } else if (throwOnUnsupported) { OPENVINO_THROW("Property was not found: ", key); } @@ -116,6 +142,14 @@ ov::Any Configuration::Get(const std::string& name) const { return log_level; } else if (name == ov::hint::model_priority) { return model_priority; + } else if (name == ov::optimal_batch_size) { + return optimal_batch_size; + } else if (name == ov::max_batch_size) { + return max_batch_size; + } else if (name == ov::loaded_from_cache) { + return loaded_from_cache; + } else if (name == ov::compilation_num_threads) { + return compilation_num_threads; } else { OPENVINO_THROW("Property was not found: ", name); } diff --git a/src/plugins/template/src/config.hpp b/src/plugins/template/src/config.hpp index 429c2ef5b36..32f54733fb0 100644 --- a/src/plugins/template/src/config.hpp +++ b/src/plugins/template/src/config.hpp @@ -47,6 +47,12 @@ struct Configuration { ov::log::Level log_level = ov::log::Level::NO; ov::hint::Priority model_priority = ov::hint::Priority::DEFAULT; + + int optimal_batch_size = 1; + int max_batch_size = 1; + bool loaded_from_cache = false; + int compilation_num_threads = 1; + int inference_num_threads = 1; }; // ! [configuration:header] diff --git a/src/plugins/template/src/plugin.cpp b/src/plugins/template/src/plugin.cpp index b0abb1c232e..7b2a8bffaa6 100644 --- a/src/plugins/template/src/plugin.cpp +++ b/src/plugins/template/src/plugin.cpp @@ -252,7 +252,10 @@ ov::Any ov::template_plugin::Plugin::get_property(const std::string& name, const ov::device::capabilities, ov::device::type, ov::range_for_async_infer_requests, - ov::execution_devices}; + ov::execution_devices, + ov::optimal_batch_size, + ov::max_batch_size, + ov::loaded_from_cache}; return ro_properties; }; const auto& default_rw_properties = []() { @@ -264,7 +267,10 @@ ov::Any ov::template_plugin::Plugin::get_property(const std::string& name, const ov::hint::execution_mode, ov::num_streams, ov::template_plugin::disable_transformations, - ov::log::level}; + ov::log::level, + ov::enable_mmap, + ov::compilation_num_threads, + ov::inference_num_threads}; return rw_properties; }; if (ov::supported_properties == name) { diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp index 05059355c73..747bbb7320f 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/properties_tests.cpp @@ -359,11 +359,6 @@ OVPropertiesTestsWithCompileModelProps::getRWOptionalPropertiesValues( } } - if (props.empty() || std::find(props.begin(), props.end(), ov::enable_mmap.name()) != props.end()) { - res.push_back({ov::enable_mmap(true)}); - res.push_back({ov::enable_mmap(false)}); - } - if (props.empty() || std::find(props.begin(), props.end(), ov::log::level.name()) != props.end()) { ov::log::Level log_levels[] = {ov::log::Level::NO , ov::log::Level::ERR, ov::log::Level::WARNING, ov::log::Level::INFO, ov::log::Level::DEBUG, ov::log::Level::TRACE}; @@ -407,10 +402,6 @@ OVPropertiesTestsWithCompileModelProps::getWrongRWOptionalPropertiesValues( res.push_back({{ov::hint::scheduling_core_type.name(), -1}}); } - if (props.empty() || std::find(props.begin(), props.end(), ov::enable_mmap.name()) != props.end()) { - res.push_back({{ov::enable_mmap.name(), -10}}); - } - if (props.empty() || std::find(props.begin(), props.end(), ov::log::level.name()) != props.end()) { res.push_back({{ov::log::level.name(), -3}}); }