[template] Add device ro props and fix compile_model props test (#19886)

This commit is contained in:
Sofya Balandina
2023-09-20 03:05:01 +01:00
committed by GitHub
parent 394e58fafb
commit 0f18d2a0ea
3 changed files with 16 additions and 11 deletions

View File

@@ -223,7 +223,9 @@ ov::Any ov::template_plugin::Plugin::get_property(const std::string& name, const
ov::device::full_name,
ov::device::architecture,
ov::device::capabilities,
ov::range_for_async_infer_requests};
ov::device::type,
ov::range_for_async_infer_requests,
ov::execution_devices};
return ro_properties;
};
const auto& default_rw_properties = []() {
@@ -259,8 +261,10 @@ ov::Any ov::template_plugin::Plugin::get_property(const std::string& name, const
return decltype(ov::device::full_name)::value_type(device_name);
} else if (ov::device::architecture == name) {
// TODO: return device architecture for device specified by DEVICE_ID config
std::string arch = "TEMPLATE";
std::string arch = get_device_name();
return decltype(ov::device::architecture)::value_type(arch);
} else if (ov::device::type == name) {
return decltype(ov::device::type)::value_type(ov::device::Type::INTEGRATED);
} else if (ov::internal::caching_properties == name) {
std::vector<ov::PropertyName> caching_properties = {ov::device::architecture};
return decltype(ov::internal::caching_properties)::value_type(caching_properties);
@@ -268,6 +272,9 @@ ov::Any ov::template_plugin::Plugin::get_property(const std::string& name, const
// TODO: fill actual list of supported capabilities: e.g. Template device supports only FP32 and EXPORT_IMPORT
std::vector<std::string> capabilities = {ov::device::capability::FP32, ov::device::capability::EXPORT_IMPORT};
return decltype(ov::device::capabilities)::value_type(capabilities);
} else if (ov::execution_devices == name) {
std::string dev = get_device_name();
return decltype(ov::execution_devices)::value_type{dev};
} else if (ov::range_for_async_infer_requests == name) {
// TODO: fill with actual values
using uint = unsigned int;

View File

@@ -15,7 +15,7 @@ using namespace ov::test::conformance;
//
INSTANTIATE_TEST_SUITE_P(
ov_compiled_model, OVClassCompiledModelGetPropertyTest,
ov_compiled_model_mandatory, OVClassCompiledModelGetPropertyTest,
::testing::ValuesIn(return_all_possible_device_combination()));
//

View File

@@ -208,9 +208,7 @@ TEST_P(OVSetPropComplieModleGetPropTests, SetPropertyAndComplieModelWithPropsWor
std::vector<ov::AnyMap> OVPropertiesTestsWithCompileModelProps::getROMandatoryProperties() {
std::vector<ov::AnyMap> res;
res.push_back({{ov::PropertyName(ov::model_name.name(), ov::model_name.mutability), nullptr}});
res.push_back({{ov::PropertyName(ov::device::full_name.name(), ov::model_name.mutability), nullptr}});
res.push_back({{ov::PropertyName(ov::optimal_number_of_infer_requests.name(), ov::optimal_number_of_infer_requests.mutability), nullptr}});
res.push_back({{ov::PropertyName(ov::device::full_name.name(), ov::device::full_name.mutability), nullptr}});
res.push_back({{ov::PropertyName(ov::device::architecture.name(), ov::device::architecture.mutability), nullptr}});
res.push_back({{ov::PropertyName(ov::device::type.name(), ov::device::type.mutability), nullptr}});
res.push_back({{ov::PropertyName(ov::execution_devices.name(), ov::execution_devices.mutability), nullptr}});
@@ -286,11 +284,6 @@ std::vector<ov::AnyMap> OVPropertiesTestsWithCompileModelProps::getRWMandatoryPr
}
}
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::streams::num.name()) != props.end()) {
res.push_back({ov::streams::num(3)});
}
@@ -332,6 +325,11 @@ std::vector<ov::AnyMap> OVPropertiesTestsWithCompileModelProps::getRWOptionalPro
}
}
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)});
}
return res;
}