[GPU] Introduce ov::config_device_id internal property to the new API (#17820)
* [GPU] Introduce ov::config_device_id internal property to the new API. Fix setting property for specific device * Introduce ov::internal::supported_properties * Fix caching tests * Fix win tests * Fix Proxy tests * Replace CONFIG_KEY_INTERNAL(CONFIG_DEVICE_ID) by ov::internal::config_device_id in PROXY plugin * Review comments
This commit is contained in:
1 parent
b30bd0d3e4
commit
3330cd69a7
28 files changed
+300
-146
No files matched your search
@@ -13,6 +13,14 @@
|
||||
|
||||
namespace ov {
|
||||
|
||||
namespace internal {
|
||||
/**
|
||||
* @brief Read-only property to get a std::vector<PropertyName> of supported internal properties.
|
||||
* @ingroup ov_runtime_cpp_prop_api
|
||||
*/
|
||||
static constexpr Property<std::vector<PropertyName>, PropertyMutability::RO> supported_properties{
|
||||
"INTERNAL_SUPPORTED_PROPERTIES"};
|
||||
|
||||
/**
|
||||
* @brief Read-only property to get a std::vector<PropertyName> of properties
|
||||
* which should affect the hash calculation for model cache
|
||||
@@ -26,4 +34,19 @@ static constexpr Property<std::vector<PropertyName>, PropertyMutability::RO> cac
|
||||
*/
|
||||
static constexpr Property<bool, PropertyMutability::RW> exclusive_async_requests{"EXCLUSIVE_ASYNC_REQUESTS"};
|
||||
|
||||
/**
|
||||
* @brief the property for setting of required device for which config to be updated
|
||||
* values: device id starts from "0" - first device, "1" - second device, etc
|
||||
* note: plugin may have different devices naming convention
|
||||
* @ingroup ov_dev_api_plugin_api
|
||||
*/
|
||||
static constexpr Property<std::string, PropertyMutability::WO> config_device_id{"CONFIG_DEVICE_ID"};
|
||||
|
||||
} // namespace internal
|
||||
OPENVINO_DEPRECATED(
|
||||
"This property is deprecated and will be removed soon. Use ov::internal::caching_properties instead of it.")
|
||||
constexpr auto caching_properties = internal::caching_properties;
|
||||
OPENVINO_DEPRECATED(
|
||||
"This property is deprecated and will be removed soon. Use ov::internal::exclusive_async_requests instead of it.")
|
||||
constexpr auto exclusive_async_requests = internal::exclusive_async_requests;
|
||||
} // namespace ov
|
||||
@@ -36,6 +36,7 @@ namespace ov {
|
||||
enum class PropertyMutability {
|
||||
RO, //!< Read-only property values can not be passed as input parameter
|
||||
RW, //!< Read/Write property key may change readability in runtime
|
||||
WO, //!< Write-only property can not be read
|
||||
};
|
||||
|
||||
/** @cond INTERNAL */
|
||||
|
||||
@@ -217,7 +217,6 @@ void clean_batch_properties(const std::string& deviceName, ov::AnyMap& config, c
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
bool ov::is_config_applicable(const std::string& user_device_name, const std::string& subprop_device_name) {
|
||||
@@ -635,12 +634,10 @@ ov::Plugin ov::CoreImpl::get_plugin(const std::string& pluginName) const {
|
||||
allowNotImplemented([&]() {
|
||||
// Add device specific value to support device_name.device_id cases
|
||||
{
|
||||
auto supportedConfigKeys =
|
||||
plugin.get_property(METRIC_KEY(SUPPORTED_CONFIG_KEYS), {}).as<std::vector<std::string>>();
|
||||
const bool supportsConfigDeviceID =
|
||||
ov::util::contains(supportedConfigKeys, CONFIG_KEY_INTERNAL(CONFIG_DEVICE_ID));
|
||||
const std::string deviceKey =
|
||||
supportsConfigDeviceID ? CONFIG_KEY_INTERNAL(CONFIG_DEVICE_ID) : CONFIG_KEY(DEVICE_ID);
|
||||
device_supports_internal_property(plugin, ov::internal::config_device_id.name())
|
||||
? ov::internal::config_device_id.name()
|
||||
: ov::device::id.name();
|
||||
|
||||
// here we can store values like GPU.0, GPU.1 and we need to set properties to plugin
|
||||
// for each such .0, .1, .# device to make sure plugin can handle different settings for different
|
||||
@@ -1151,7 +1148,6 @@ ov::Any ov::CoreImpl::get_property(const std::string& device_name,
|
||||
ov::AnyMap empty_map;
|
||||
return coreConfig.get_cache_config_for_device(get_plugin(parsed._deviceName), empty_map)._cacheDir;
|
||||
}
|
||||
|
||||
return get_plugin(parsed._deviceName).get_property(name, parsed._config);
|
||||
}
|
||||
|
||||
@@ -1287,9 +1283,9 @@ void ov::CoreImpl::set_property_for_device(const ov::AnyMap& configMap, const st
|
||||
{
|
||||
if (!parser.get_device_id().empty()) {
|
||||
const std::string deviceKey =
|
||||
device_supports_property(plugin.second, CONFIG_KEY_INTERNAL(CONFIG_DEVICE_ID))
|
||||
? CONFIG_KEY_INTERNAL(CONFIG_DEVICE_ID)
|
||||
: CONFIG_KEY(DEVICE_ID);
|
||||
device_supports_internal_property(plugin.second, ov::internal::config_device_id.name())
|
||||
? ov::internal::config_device_id.name()
|
||||
: ov::device::id.name();
|
||||
configCopy[deviceKey] = parser.get_device_id();
|
||||
}
|
||||
}
|
||||
@@ -1329,6 +1325,10 @@ bool ov::CoreImpl::device_supports_property(const ov::Plugin& plugin, const ov::
|
||||
return util::contains(plugin.get_property(ov::supported_properties), key);
|
||||
}
|
||||
|
||||
bool ov::CoreImpl::device_supports_internal_property(const ov::Plugin& plugin, const ov::PropertyName& key) const {
|
||||
return util::contains(plugin.get_property(ov::internal::supported_properties), key);
|
||||
}
|
||||
|
||||
bool ov::CoreImpl::device_supports_model_caching(const ov::Plugin& plugin) const {
|
||||
auto supportedMetricKeys = plugin.get_property(METRIC_KEY(SUPPORTED_METRICS), {}).as<std::vector<std::string>>();
|
||||
auto supported = util::contains(supportedMetricKeys, METRIC_KEY(IMPORT_EXPORT_SUPPORT)) &&
|
||||
@@ -1339,7 +1339,7 @@ bool ov::CoreImpl::device_supports_model_caching(const ov::Plugin& plugin) const
|
||||
util::contains(plugin.get_property(ov::device::capabilities), ov::device::capability::EXPORT_IMPORT);
|
||||
}
|
||||
if (supported) {
|
||||
supported = device_supports_property(plugin, ov::caching_properties);
|
||||
supported = device_supports_internal_property(plugin, ov::internal::caching_properties);
|
||||
}
|
||||
return supported;
|
||||
}
|
||||
@@ -1453,8 +1453,11 @@ ov::AnyMap ov::CoreImpl::create_compile_config(const ov::Plugin& plugin, const o
|
||||
}
|
||||
|
||||
// 2. Extract config keys which affect compilation process
|
||||
auto caching_props = plugin.get_property(ov::caching_properties, property_config);
|
||||
OPENVINO_ASSERT(!caching_props.empty(), "ov::caching_properties returned by ", plugin.get_name(), " are empty");
|
||||
auto caching_props = plugin.get_property(ov::internal::caching_properties, property_config);
|
||||
OPENVINO_ASSERT(!caching_props.empty(),
|
||||
"ov::internal::caching_properties returned by ",
|
||||
plugin.get_name(),
|
||||
" are empty");
|
||||
|
||||
ov::AnyMap compile_config;
|
||||
for (const auto& prop : caching_props) {
|
||||
|
||||
@@ -171,6 +171,7 @@ private:
|
||||
bool device_supports_model_caching(const ov::Plugin& plugin) const;
|
||||
|
||||
bool device_supports_property(const ov::Plugin& plugin, const ov::PropertyName& key) const;
|
||||
bool device_supports_internal_property(const ov::Plugin& plugin, const ov::PropertyName& key) const;
|
||||
|
||||
OPENVINO_DEPRECATED("Don't use this method, it will be removed soon")
|
||||
bool device_supports_cache_dir(const ov::Plugin& plugin) const;
|
||||
|
||||
@@ -74,7 +74,6 @@ std::tuple<bool, std::string> CheckStatic(const InferenceEngine::CNNNetwork& net
|
||||
}
|
||||
return {res, errMsg.str()};
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace InferenceEngine {
|
||||
|
||||
@@ -370,7 +370,7 @@ private:
|
||||
.WillByDefault(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
std::vector<std::string> res;
|
||||
res.emplace_back(METRIC_KEY(IMPORT_EXPORT_SUPPORT));
|
||||
res.emplace_back(ov::caching_properties.name());
|
||||
res.emplace_back(ov::internal::caching_properties.name());
|
||||
res.emplace_back(METRIC_KEY(DEVICE_ARCHITECTURE));
|
||||
return res;
|
||||
}));
|
||||
@@ -379,10 +379,12 @@ private:
|
||||
return std::vector<ov::PropertyName>{ov::supported_properties.name(),
|
||||
METRIC_KEY(IMPORT_EXPORT_SUPPORT),
|
||||
ov::device::capabilities.name(),
|
||||
ov::caching_properties.name(),
|
||||
ov::device::architecture.name()};
|
||||
}));
|
||||
|
||||
ON_CALL(plugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.WillByDefault(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
return std::vector<ov::PropertyName>{ov::internal::caching_properties.name()};
|
||||
}));
|
||||
ON_CALL(plugin, GetMetric(METRIC_KEY(OPTIMIZATION_CAPABILITIES), _))
|
||||
.WillByDefault(Return(std::vector<std::string>()));
|
||||
|
||||
@@ -405,10 +407,10 @@ private:
|
||||
return "mock";
|
||||
}));
|
||||
|
||||
ON_CALL(plugin, GetMetric(ov::caching_properties.name(), _))
|
||||
ON_CALL(plugin, GetMetric(ov::internal::caching_properties.name(), _))
|
||||
.WillByDefault(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
std::vector<ov::PropertyName> cachingProperties = {ov::device::architecture.name()};
|
||||
return decltype(ov::caching_properties)::value_type(cachingProperties);
|
||||
return decltype(ov::internal::caching_properties)::value_type(cachingProperties);
|
||||
}));
|
||||
|
||||
ON_CALL(plugin, ImportNetwork(_, _, _))
|
||||
@@ -510,7 +512,8 @@ TEST_P(CachingTest, TestLoad) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0);
|
||||
@@ -549,7 +552,8 @@ TEST_P(CachingTest, TestLoad_by_device_name) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0);
|
||||
@@ -588,7 +592,8 @@ TEST_P(CachingTest, TestLoadCustomImportExport) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
ON_CALL(*mockPlugin, ImportNetwork(_, _, _))
|
||||
.WillByDefault(
|
||||
Invoke([&](std::istream& s, const RemoteContext::Ptr&, const std::map<std::string, std::string>&) {
|
||||
@@ -656,25 +661,29 @@ TEST_P(CachingTest, TestChangeLoadConfig) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
ON_CALL(*mockPlugin, GetMetric(ov::supported_properties.name(), _))
|
||||
.WillByDefault(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
return std::vector<ov::PropertyName>{ov::supported_properties.name(),
|
||||
METRIC_KEY(IMPORT_EXPORT_SUPPORT),
|
||||
ov::device::capabilities.name(),
|
||||
ov::device::architecture.name(),
|
||||
ov::caching_properties.name()};
|
||||
ov::device::architecture.name()};
|
||||
}));
|
||||
ON_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _))
|
||||
ON_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.WillByDefault(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
return std::vector<ov::PropertyName>{ov::internal::caching_properties.name()};
|
||||
}));
|
||||
ON_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _))
|
||||
.WillByDefault(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
std::vector<ov::PropertyName> res;
|
||||
res.push_back(ov::PropertyName(CUSTOM_KEY, ov::PropertyMutability::RO));
|
||||
return decltype(ov::caching_properties)::value_type(res);
|
||||
return decltype(ov::internal::caching_properties)::value_type(res);
|
||||
}));
|
||||
ON_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS), _))
|
||||
.WillByDefault(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
std::vector<std::string> res;
|
||||
res.push_back(ov::caching_properties.name());
|
||||
res.push_back(ov::internal::caching_properties.name());
|
||||
return res;
|
||||
}));
|
||||
{
|
||||
@@ -713,7 +722,8 @@ TEST_P(CachingTest, TestChangeLoadConfig_With_Cache_Dir_inline) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
ON_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS), _))
|
||||
.WillByDefault(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
return std::vector<std::string>{};
|
||||
@@ -752,7 +762,8 @@ TEST_P(CachingTest, TestNoCacheEnabled) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(0);
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0);
|
||||
@@ -775,7 +786,8 @@ TEST_P(CachingTest, TestNoCacheSupported) {
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(false));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::device::capabilities.name(), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(decltype(ov::device::capabilities)::value_type{}));
|
||||
@@ -806,7 +818,10 @@ TEST_P(CachingTest, TestNoCacheMetricSupported) {
|
||||
.WillRepeatedly(Return(std::vector<std::string>{}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(0);
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(0);
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(0);
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(0);
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::device::capabilities.name(), _)).Times(0);
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
@@ -835,7 +850,10 @@ TEST_P(CachingTest, TestNoCacheMetricSupported_by_device_name) {
|
||||
.WillRepeatedly(Return(std::vector<std::string>{}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(0);
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(0);
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(0);
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(0);
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::device::capabilities.name(), _)).Times(0);
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
@@ -857,12 +875,12 @@ TEST_P(CachingTest, TestNoCacheMetric_hasCacheDirConfig) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(std::vector<std::string>{METRIC_KEY(SUPPORTED_CONFIG_KEYS)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<std::string>{CONFIG_KEY(CACHE_DIR)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::supported_properties.name(), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{ov::supported_properties.name(), ov::cache_dir.name()}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{}));
|
||||
EXPECT_CALL(*mockPlugin, SetConfig(_))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Invoke([](const std::map<std::string, std::string>& config) {
|
||||
@@ -888,13 +906,12 @@ TEST_P(CachingTest, TestNoCacheMetric_hasCacheDirConfig_inline) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(std::vector<std::string>{METRIC_KEY(SUPPORTED_CONFIG_KEYS)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<std::string>{CONFIG_KEY(CACHE_DIR)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::supported_properties.name(), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{ov::supported_properties.name(), ov::cache_dir.name()}));
|
||||
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{}));
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0);
|
||||
@@ -914,12 +931,12 @@ TEST_P(CachingTest, TestNoCacheMetric_hasCacheDirConfig_by_device_name) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(std::vector<std::string>{METRIC_KEY(SUPPORTED_CONFIG_KEYS)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<std::string>{CONFIG_KEY(CACHE_DIR)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::supported_properties.name(), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{ov::supported_properties.name(), ov::cache_dir.name()}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{}));
|
||||
EXPECT_CALL(*mockPlugin, SetConfig(_))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Invoke([](const std::map<std::string, std::string>& config) {
|
||||
@@ -941,12 +958,12 @@ TEST_P(CachingTest, TestCacheEnabled_noConfig) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(std::vector<std::string>{METRIC_KEY(SUPPORTED_CONFIG_KEYS)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<std::string>{}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::supported_properties.name(), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{ov::supported_properties.name()}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{}));
|
||||
EXPECT_CALL(*mockPlugin, SetConfig(_))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([](const std::map<std::string, std::string>& config) {
|
||||
@@ -971,12 +988,12 @@ TEST_P(CachingTest, TestNoCacheMetric_configThrow) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(std::vector<std::string>{METRIC_KEY(SUPPORTED_CONFIG_KEYS)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<std::string>{CONFIG_KEY(CACHE_DIR)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::supported_properties.name(), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{ov::supported_properties.name(), ov::cache_dir.name()}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{}));
|
||||
EXPECT_CALL(*mockPlugin, SetConfig(_))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Invoke([](const std::map<std::string, std::string>& config) {
|
||||
@@ -994,12 +1011,12 @@ TEST_P(CachingTest, TestNoCacheEnabled_cacheDirConfig) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(std::vector<std::string>{METRIC_KEY(SUPPORTED_CONFIG_KEYS)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<std::string>{CONFIG_KEY(CACHE_DIR)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::supported_properties.name(), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{ov::supported_properties.name(), ov::cache_dir.name()}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{}));
|
||||
EXPECT_CALL(*mockPlugin, SetConfig(_))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([](const std::map<std::string, std::string>& config) {
|
||||
@@ -1023,7 +1040,8 @@ TEST_P(CachingTest, TestLoadChangeCacheDir) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0);
|
||||
@@ -1062,7 +1080,8 @@ TEST_P(CachingTest, TestLoadChangeCacheDirOneCore) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, SetConfig(_))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([](const std::map<std::string, std::string>& config) {
|
||||
@@ -1099,7 +1118,8 @@ TEST_P(CachingTest, TestLoadChangeCacheDirOneCore_overwrite_device_dir) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, SetConfig(_))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([](const std::map<std::string, std::string>& config) {
|
||||
@@ -1134,9 +1154,6 @@ TEST_P(CachingTest, TestLoadChangeCacheDirOneCore_SupportsCacheDir_NoImportExpor
|
||||
m_checkConfigCb = [](const std::map<std::string, std::string>& config) {
|
||||
EXPECT_EQ(config.count(CONFIG_KEY(CACHE_DIR)), 0);
|
||||
};
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<std::string>{CONFIG_KEY(CACHE_DIR)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::supported_properties.name(), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{ov::supported_properties.name(), ov::cache_dir.name()}));
|
||||
@@ -1148,7 +1165,8 @@ TEST_P(CachingTest, TestLoadChangeCacheDirOneCore_SupportsCacheDir_NoImportExpor
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(decltype(ov::device::capabilities)::value_type{}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
std::string set_cache_dir = {};
|
||||
EXPECT_CALL(*mockPlugin, SetConfig(_))
|
||||
.Times(AtLeast(2))
|
||||
@@ -1186,7 +1204,8 @@ TEST_P(CachingTest, TestLoadChangeCacheDirOneCore_by_device_name) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, SetConfig(_))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([](const std::map<std::string, std::string>& config) {
|
||||
@@ -1218,9 +1237,6 @@ TEST_P(CachingTest, TestLoadChangeCacheDirOneCore_by_device_name) {
|
||||
/// \brief Change CACHE_DIR per device during working with same 'Core' object - device supports CACHE_DIR
|
||||
/// Verifies that no 'export' is called and cache_dir is propagated to set_config
|
||||
TEST_P(CachingTest, TestLoadChangeCacheDirOneCore_by_device_name_supports_cache_dir) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_CONFIG_KEYS), _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Return(std::vector<std::string>{CONFIG_KEY(CACHE_DIR)}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::supported_properties.name(), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{ov::cache_dir.name()}));
|
||||
@@ -1232,7 +1248,8 @@ TEST_P(CachingTest, TestLoadChangeCacheDirOneCore_by_device_name_supports_cache_
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(decltype(ov::device::capabilities)::value_type{}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, SetConfig(_))
|
||||
.Times(AtLeast(2))
|
||||
.WillRepeatedly(Invoke([](const std::map<std::string, std::string>& config) {
|
||||
@@ -1268,7 +1285,8 @@ TEST_P(CachingTest, TestClearCacheDir) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(0);
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0);
|
||||
@@ -1292,7 +1310,8 @@ TEST_P(CachingTest, TestChangeOtherConfig) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0);
|
||||
@@ -1317,7 +1336,8 @@ TEST_P(CachingTest, TestChangeCacheDirFailure) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0);
|
||||
@@ -1359,7 +1379,8 @@ TEST_P(CachingTest, TestCacheDirCreateRecursive) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0);
|
||||
@@ -1383,7 +1404,8 @@ TEST_P(CachingTest, TestDeviceArchitecture) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([&](const std::string&, const std::map<std::string, Parameter>& options) {
|
||||
@@ -1459,9 +1481,14 @@ TEST_P(CachingTest, TestNoDeviceArchitecture) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::supported_properties.name(), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
return std::vector<ov::PropertyName>{ov::device::capabilities.name(), ov::caching_properties.name()};
|
||||
return std::vector<ov::PropertyName>{ov::device::capabilities.name()};
|
||||
}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _))
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
return std::vector<ov::PropertyName>{ov::internal::caching_properties.name()};
|
||||
}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
return std::vector<ov::PropertyName>{ov::supported_properties};
|
||||
@@ -1514,7 +1541,12 @@ TEST_P(CachingTest, TestNoCachingProperties) {
|
||||
.WillRepeatedly(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
return std::vector<ov::PropertyName>{ov::device::capabilities.name()};
|
||||
}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(0);
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
return std::vector<ov::PropertyName>{};
|
||||
}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(0);
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([&](const std::string&, const std::map<std::string, Parameter>&) {
|
||||
@@ -1548,7 +1580,8 @@ TEST_P(CachingTest, TestThrowOnExport) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0);
|
||||
@@ -1572,7 +1605,8 @@ TEST_P(CachingTest, TestThrowOnImport) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0);
|
||||
@@ -1626,7 +1660,8 @@ TEST_P(CachingTest, TestNetworkModified) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _)).Times(!m_remoteContext ? 1 : 0);
|
||||
@@ -1686,7 +1721,8 @@ TEST_P(CachingTest, TestCacheFileCorrupted) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
@@ -1743,7 +1779,8 @@ TEST_P(CachingTest, TestCacheFileOldVersion) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(SUPPORTED_METRICS), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
|
||||
{
|
||||
EXPECT_CALL(*mockPlugin, LoadExeNetworkImpl(_, _, _)).Times(m_remoteContext ? 1 : 0);
|
||||
@@ -1822,6 +1859,9 @@ TEST_P(CachingTest, LoadHetero_NoCacheMetric) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::supported_properties.name(), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::supported_properties.name(), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(std::vector<ov::PropertyName>{}));
|
||||
// Hetero supports Import/Export, but mock plugin does not
|
||||
deviceToLoad = CommonTestUtils::DEVICE_HETERO + std::string(":mock.1,mock.2");
|
||||
if (m_remoteContext) {
|
||||
@@ -1925,7 +1965,7 @@ TEST_P(CachingTest, LoadHetero_TargetFallbackFromCore) {
|
||||
|
||||
TEST_P(CachingTest, LoadHetero_MultiArchs) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
|
||||
EXPECT_CALL(*mockPlugin, QueryNetwork(_, _))
|
||||
.Times(AnyNumber())
|
||||
@@ -2010,7 +2050,7 @@ TEST_P(CachingTest, LoadHetero_MultiArchs) {
|
||||
TEST_P(CachingTest, LoadHetero_MultiArchs_TargetFallback_FromCore) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, QueryNetwork(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([&](const std::string&, const std::map<std::string, Parameter>& options) {
|
||||
@@ -2079,7 +2119,7 @@ TEST_P(CachingTest, LoadAUTO_OneDevice) {
|
||||
const auto TEST_COUNT = 2;
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, QueryNetwork(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
if (m_remoteContext) {
|
||||
return; // skip the remote Context test for Auto plugin
|
||||
@@ -2107,7 +2147,7 @@ TEST_P(CachingTest, LoadAUTOWithConfig) {
|
||||
const auto TEST_COUNT = 2;
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, QueryNetwork(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
if (m_remoteContext) {
|
||||
return; // skip the remote Context test for Auto plugin
|
||||
@@ -2139,7 +2179,7 @@ TEST_P(CachingTest, LoadAUTO_OneDeviceNoImportExport) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::device::capabilities.name(), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Return(decltype(ov::device::capabilities)::value_type{}));
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
if (m_remoteContext) {
|
||||
return; // skip the remote Context test for Auto plugin
|
||||
@@ -2173,7 +2213,7 @@ TEST_P(CachingTest, LoadMulti_race) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, QueryNetwork(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
if (m_remoteContext) {
|
||||
return; // skip the remote Context test for Multi plugin
|
||||
}
|
||||
@@ -2214,7 +2254,7 @@ TEST_P(CachingTest, LoadMultiWithConfig_race) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, QueryNetwork(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
if (m_remoteContext) {
|
||||
return; // skip the remote Context test for Multi plugin
|
||||
}
|
||||
@@ -2252,7 +2292,7 @@ TEST_P(CachingTest, LoadMulti_Archs) {
|
||||
const auto TEST_DEVICE_MAX_COUNT = 30; // Shall be >= 2
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, QueryNetwork(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _))
|
||||
.Times(AnyNumber())
|
||||
.WillRepeatedly(Invoke([&](const std::string&, const std::map<std::string, Parameter>& options) {
|
||||
@@ -2309,7 +2349,7 @@ TEST_P(CachingTest, LoadMulti_NoCachingOnDevice) {
|
||||
.WillRepeatedly(Return(decltype(ov::device::capabilities)::value_type{}));
|
||||
EXPECT_CALL(*mockPlugin, QueryNetwork(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
|
||||
DataPtr inData = std::make_shared<Data>("Param_1", Precision::FP32);
|
||||
InputInfo inpInfo;
|
||||
@@ -2364,7 +2404,7 @@ TEST_P(CachingTest, LoadBATCHWithConfig) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, QueryNetwork(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
if (m_remoteContext) {
|
||||
return; // skip the remote Context test for Auto plugin
|
||||
}
|
||||
@@ -2394,7 +2434,7 @@ TEST_P(CachingTest, Load_threads) {
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, QueryNetwork(_, _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(DEVICE_ARCHITECTURE), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::caching_properties.name(), _)).Times(AnyNumber());
|
||||
EXPECT_CALL(*mockPlugin, GetMetric(ov::internal::caching_properties.name(), _)).Times(AnyNumber());
|
||||
if (m_remoteContext) {
|
||||
return; // skip the remote Context test for Multi plugin
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "common_test_utils/file_utils.hpp"
|
||||
#include "openvino/openvino.hpp"
|
||||
#include "openvino/runtime/internal_properties.hpp"
|
||||
#include "openvino/runtime/iplugin.hpp"
|
||||
#include "openvino/runtime/properties.hpp"
|
||||
#include "openvino/util/file_util.hpp"
|
||||
@@ -53,6 +54,8 @@ class MockPlugin : public ov::IPlugin {
|
||||
ov::PropertyName(ov::supported_properties.name(), ov::PropertyMutability::RO),
|
||||
ov::PropertyName(ov::num_streams.name(), ov::PropertyMutability::RW)};
|
||||
return decltype(ov::supported_properties)::value_type(supportedProperties);
|
||||
} else if (name == ov::internal::supported_properties) {
|
||||
return decltype(ov::internal::supported_properties)::value_type({});
|
||||
} else if (name == ov::num_streams.name()) {
|
||||
return decltype(ov::num_streams)::value_type(num_streams);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <threading/ie_executor_manager.hpp>
|
||||
#include "openvino/runtime/auto/properties.hpp"
|
||||
#include "openvino/runtime/device_id_parser.hpp"
|
||||
#include "openvino/runtime/internal_properties.hpp"
|
||||
#include "plugin.hpp"
|
||||
#include "auto_schedule.hpp"
|
||||
#include "auto_compiled_model.hpp"
|
||||
@@ -281,6 +282,8 @@ ov::Any Plugin::get_property(const std::string& name, const ov::AnyMap& argument
|
||||
} else if (ov::supported_properties == name) {
|
||||
auto ret = m_plugin_config.supported_properties(get_device_name());
|
||||
return ret;
|
||||
} else if (name == ov::internal::supported_properties.name()) {
|
||||
return decltype(ov::internal::supported_properties)::value_type{};
|
||||
} else if (name == ov::device::full_name) {
|
||||
return decltype(ov::device::full_name)::value_type {get_device_name()};
|
||||
} else if (name == ov::device::capabilities.name()) {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "openvino/core/dimension_tracker.hpp"
|
||||
#include "openvino/pass/manager.hpp"
|
||||
#include "openvino/runtime/intel_gpu/properties.hpp"
|
||||
#include "openvino/runtime/internal_properties.hpp"
|
||||
#include "openvino/util/common_util.hpp"
|
||||
#include "transformations/common_optimizations/dimension_tracking.hpp"
|
||||
#include "transformations/init_node_info.hpp"
|
||||
@@ -148,6 +149,8 @@ InferenceEngine::Parameter Plugin::GetMetric(
|
||||
metrics.push_back(METRIC_KEY(FULL_DEVICE_NAME));
|
||||
metrics.push_back(METRIC_KEY(SUPPORTED_CONFIG_KEYS));
|
||||
IE_SET_METRIC_RETURN(SUPPORTED_METRICS, metrics);
|
||||
} else if (name == ov::internal::supported_properties.name()) {
|
||||
return decltype(ov::internal::supported_properties)::value_type{};
|
||||
} else if (name == METRIC_KEY(FULL_DEVICE_NAME)) {
|
||||
IE_SET_METRIC_RETURN(FULL_DEVICE_NAME, _pluginName);
|
||||
} else if (name == METRIC_KEY(SUPPORTED_CONFIG_KEYS)) {
|
||||
|
||||
@@ -225,12 +225,14 @@ Parameter Engine::GetMetric(const std::string& name, const ov::AnyMap& user_opti
|
||||
if (ov::supported_properties == name) {
|
||||
return decltype(ov::supported_properties)::value_type{
|
||||
ov::PropertyName{ov::supported_properties.name(), ov::PropertyMutability::RO},
|
||||
ov::PropertyName{ov::caching_properties.name(), ov::PropertyMutability::RO},
|
||||
ov::PropertyName{ov::device::full_name.name(), ov::PropertyMutability::RO},
|
||||
ov::PropertyName{ov::device::capabilities.name(), ov::PropertyMutability::RO},
|
||||
ov::PropertyName{ov::device::priorities.name(), ov::PropertyMutability::RW}};
|
||||
} else if (ov::caching_properties == name) {
|
||||
return decltype(ov::caching_properties)::value_type{ov::hetero::caching_device_properties.name()};
|
||||
} else if (ov::internal::supported_properties == name) {
|
||||
return decltype(ov::internal::supported_properties)::value_type{
|
||||
ov::PropertyName{ov::internal::caching_properties.name(), ov::PropertyMutability::RO}};
|
||||
} else if (ov::internal::caching_properties == name) {
|
||||
return decltype(ov::internal::caching_properties)::value_type{ov::hetero::caching_device_properties.name()};
|
||||
} else if (ov::hetero::caching_device_properties == name) {
|
||||
std::string targetFallback = GetTargetFallback(user_options);
|
||||
return decltype(ov::hetero::caching_device_properties)::value_type{DeviceCachingProperties(targetFallback)};
|
||||
@@ -240,7 +242,6 @@ Parameter Engine::GetMetric(const std::string& name, const ov::AnyMap& user_opti
|
||||
ov::device::full_name.name(),
|
||||
METRIC_KEY(SUPPORTED_CONFIG_KEYS),
|
||||
METRIC_KEY(IMPORT_EXPORT_SUPPORT),
|
||||
ov::caching_properties.name(),
|
||||
ov::device::capabilities.name()});
|
||||
} else if (METRIC_KEY(SUPPORTED_CONFIG_KEYS) == name) {
|
||||
IE_SET_METRIC_RETURN(SUPPORTED_CONFIG_KEYS, getSupportedConfigKeys());
|
||||
@@ -266,9 +267,11 @@ std::string Engine::DeviceCachingProperties(const std::string& targetFallback) c
|
||||
auto device_name = parser.get_device_name();
|
||||
auto supported_properties =
|
||||
GetCore()->GetMetric(device, ov::supported_properties.name()).as<std::vector<ov::PropertyName>>();
|
||||
if (ov::util::contains(supported_properties, ov::caching_properties.name())) {
|
||||
auto supported_internal_properties =
|
||||
GetCore()->GetMetric(device, ov::internal::supported_properties.name()).as<std::vector<ov::PropertyName>>();
|
||||
if (ov::util::contains(supported_internal_properties, ov::internal::caching_properties.name())) {
|
||||
auto caching_properties =
|
||||
GetCore()->GetMetric(device, ov::caching_properties.name()).as<std::vector<ov::PropertyName>>();
|
||||
GetCore()->GetMetric(device, ov::internal::caching_properties.name()).as<std::vector<ov::PropertyName>>();
|
||||
for (auto& property_name : caching_properties) {
|
||||
properties[property_name] = GetCore()->GetMetric(device, property_name);
|
||||
}
|
||||
|
||||
@@ -592,7 +592,6 @@ Parameter Engine::GetMetricLegacy(const std::string& name, const std::map<std::s
|
||||
METRIC_KEY(RANGE_FOR_ASYNC_INFER_REQUESTS),
|
||||
METRIC_KEY(RANGE_FOR_STREAMS),
|
||||
METRIC_KEY(IMPORT_EXPORT_SUPPORT),
|
||||
ov::caching_properties.name(),
|
||||
};
|
||||
IE_SET_METRIC_RETURN(SUPPORTED_METRICS, metrics);
|
||||
} else if (name == METRIC_KEY(FULL_DEVICE_NAME)) {
|
||||
@@ -624,9 +623,12 @@ Parameter Engine::GetMetricLegacy(const std::string& name, const std::map<std::s
|
||||
IE_SET_METRIC_RETURN(RANGE_FOR_STREAMS, range);
|
||||
} else if (name == METRIC_KEY(IMPORT_EXPORT_SUPPORT)) {
|
||||
IE_SET_METRIC_RETURN(IMPORT_EXPORT_SUPPORT, true);
|
||||
} else if (name == ov::caching_properties) {
|
||||
} else if (ov::internal::supported_properties == name) {
|
||||
return decltype(ov::internal::supported_properties)::value_type{
|
||||
ov::PropertyName{ov::internal::caching_properties.name(), ov::PropertyMutability::RO}};
|
||||
} else if (name == ov::internal::caching_properties) {
|
||||
std::vector<ov::PropertyName> cachingProperties = { METRIC_KEY(FULL_DEVICE_NAME) };
|
||||
return decltype(ov::caching_properties)::value_type(cachingProperties);
|
||||
return decltype(ov::internal::caching_properties)::value_type(cachingProperties);
|
||||
}
|
||||
|
||||
IE_CPU_PLUGIN_THROW() << "Unsupported metric key: " << name;
|
||||
@@ -650,7 +652,6 @@ Parameter Engine::GetMetric(const std::string& name, const std::map<std::string,
|
||||
RO_property(ov::range_for_streams.name()),
|
||||
RO_property(ov::device::full_name.name()),
|
||||
RO_property(ov::device::capabilities.name()),
|
||||
RO_property(ov::caching_properties.name()),
|
||||
};
|
||||
// the whole config is RW before model is loaded.
|
||||
std::vector<ov::PropertyName> rwProperties {RW_property(ov::num_streams.name()),
|
||||
@@ -675,6 +676,9 @@ Parameter Engine::GetMetric(const std::string& name, const std::map<std::string,
|
||||
supportedProperties.insert(supportedProperties.end(), rwProperties.begin(), rwProperties.end());
|
||||
|
||||
return decltype(ov::supported_properties)::value_type(supportedProperties);
|
||||
} else if (ov::internal::supported_properties == name) {
|
||||
return decltype(ov::internal::supported_properties)::value_type{
|
||||
ov::PropertyName{ov::internal::caching_properties.name(), ov::PropertyMutability::RO}}; ;
|
||||
} else if (name == ov::device::full_name) {
|
||||
return decltype(ov::device::full_name)::value_type(deviceFullName);
|
||||
} else if (name == ov::available_devices) {
|
||||
@@ -698,9 +702,9 @@ Parameter Engine::GetMetric(const std::string& name, const std::map<std::string,
|
||||
} else if (name == ov::range_for_streams) {
|
||||
const std::tuple<unsigned int, unsigned int> range = std::make_tuple(1, parallel_get_max_threads());
|
||||
return decltype(ov::range_for_streams)::value_type(range);
|
||||
} else if (name == ov::caching_properties) {
|
||||
} else if (name == ov::internal::caching_properties) {
|
||||
std::vector<ov::PropertyName> cachingProperties = { ov::device::full_name };
|
||||
return decltype(ov::caching_properties)::value_type(cachingProperties);
|
||||
return decltype(ov::internal::caching_properties)::value_type(cachingProperties);
|
||||
} else if (name == ov::intel_cpu::denormals_optimization) {
|
||||
return decltype(ov::intel_cpu::denormals_optimization)::value_type(engConfig.denormalsOptMode == Config::DenormalsOptMode::DO_On);
|
||||
} else if (name == ov::intel_cpu::sparse_weights_decompression_rate) {
|
||||
|
||||
@@ -32,7 +32,6 @@ TEST_F(OVClassConfigTestCPU, smoke_PluginAllSupportedPropertiesAreAvailable) {
|
||||
RO_property(ov::range_for_streams.name()),
|
||||
RO_property(ov::device::full_name.name()),
|
||||
RO_property(ov::device::capabilities.name()),
|
||||
RO_property(ov::caching_properties.name()),
|
||||
// read write
|
||||
RW_property(ov::num_streams.name()),
|
||||
RW_property(ov::affinity.name()),
|
||||
|
||||
@@ -391,7 +391,6 @@ const Parameter Config::GetSupportedProperties(bool compiled) {
|
||||
{ov::device::capabilities.name(), ov::PropertyMutability::RO},
|
||||
{ov::device::full_name.name(), ov::PropertyMutability::RO},
|
||||
{ov::intel_gna::library_full_version.name(), ov::PropertyMutability::RO},
|
||||
{ov::caching_properties.name(), ov::PropertyMutability::RO},
|
||||
{ov::intel_gna::execution_mode.name(), ov::PropertyMutability::RW},
|
||||
{ov::hint::performance_mode.name(), ov::PropertyMutability::RW},
|
||||
{ov::log::level.name(), ov::PropertyMutability::RW},
|
||||
@@ -407,6 +406,12 @@ const Parameter Config::GetSupportedProperties(bool compiled) {
|
||||
return supported_properties;
|
||||
}
|
||||
|
||||
const Parameter Config::GetSupportedInternalProperties() {
|
||||
std::vector<ov::PropertyName> supported_internal_properties = {
|
||||
{ov::internal::caching_properties.name(), ov::PropertyMutability::RO}};
|
||||
return supported_internal_properties;
|
||||
}
|
||||
|
||||
std::vector<std::string> Config::GetSupportedKeys() const {
|
||||
std::lock_guard<std::mutex> lockGuard{mtx4keyConfigMap};
|
||||
std::vector<std::string> result;
|
||||
|
||||
@@ -54,6 +54,7 @@ struct Config {
|
||||
std::vector<std::string> GetSupportedKeys() const;
|
||||
static const InferenceEngine::Parameter GetImpactingModelCompilationProperties(bool compiled);
|
||||
static const InferenceEngine::Parameter GetSupportedProperties(bool compiled = false);
|
||||
static const InferenceEngine::Parameter GetSupportedInternalProperties();
|
||||
|
||||
ov::hint::PerformanceMode performance_mode = ov::hint::PerformanceMode::LATENCY;
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ Parameter GNAPlugin::GetMetric(const std::string& name,
|
||||
const std::map<std::string, InferenceEngine::Parameter>& options) const {
|
||||
if (ov::supported_properties == name) {
|
||||
return config.GetSupportedProperties();
|
||||
} else if (ov::internal::supported_properties == name) {
|
||||
return config.GetSupportedInternalProperties();
|
||||
} else if (ov::available_devices == name) {
|
||||
return GetAvailableDevices().as<std::vector<std::string>>();
|
||||
} else if (ov::optimal_number_of_infer_requests == name) {
|
||||
@@ -63,11 +65,11 @@ Parameter GNAPlugin::GetMetric(const std::string& name,
|
||||
return decltype(ov::execution_devices)::value_type{GetName()};
|
||||
} else if (ov::model_name == name) {
|
||||
return _network_name;
|
||||
} else if (name == ov::caching_properties) {
|
||||
} else if (name == ov::internal::caching_properties) {
|
||||
auto cachingProperties =
|
||||
Config::GetImpactingModelCompilationProperties(true).as<std::vector<ov::PropertyName>>();
|
||||
cachingProperties.push_back(ov::PropertyName(ov::log::level.name(), ov::PropertyMutability::RO));
|
||||
return decltype(ov::caching_properties)::value_type(cachingProperties);
|
||||
return decltype(ov::internal::caching_properties)::value_type(cachingProperties);
|
||||
} else {
|
||||
const std::unordered_map<std::string, std::function<Parameter()>> queryApiSupported = {
|
||||
{METRIC_KEY(AVAILABLE_DEVICES),
|
||||
|
||||
@@ -58,7 +58,7 @@ TEST_F(GnaExecutableNetworkMetricsTest, TestNetworkName) {
|
||||
TEST_F(GnaExecutableNetworkMetricsTest, TestSupportedProperties) {
|
||||
std::string supportedProperties =
|
||||
"SUPPORTED_PROPERTIES AVAILABLE_DEVICES OPTIMAL_NUMBER_OF_INFER_REQUESTS RANGE_FOR_ASYNC_INFER_REQUESTS "
|
||||
"OPTIMIZATION_CAPABILITIES FULL_DEVICE_NAME GNA_LIBRARY_FULL_VERSION CACHING_PROPERTIES "
|
||||
"OPTIMIZATION_CAPABILITIES FULL_DEVICE_NAME GNA_LIBRARY_FULL_VERSION "
|
||||
"GNA_DEVICE_MODE PERFORMANCE_HINT LOG_LEVEL EXECUTION_DEVICES "
|
||||
"GNA_SCALE_FACTOR_PER_INPUT GNA_FIRMWARE_MODEL_IMAGE GNA_HW_EXECUTION_TARGET GNA_HW_COMPILE_TARGET "
|
||||
"GNA_PWL_DESIGN_ALGORITHM GNA_PWL_MAX_ERROR_PERCENT INFERENCE_PRECISION_HINT EXECUTION_MODE_HINT "
|
||||
|
||||
@@ -38,6 +38,7 @@ class Plugin : public InferenceEngine::IInferencePlugin {
|
||||
RemoteCLContext::Ptr get_default_context(const std::string& device_id) const;
|
||||
|
||||
std::vector<ov::PropertyName> get_supported_properties() const;
|
||||
std::vector<ov::PropertyName> get_supported_internal_properties() const;
|
||||
std::vector<std::string> get_device_capabilities(const cldnn::device_info& info) const;
|
||||
uint32_t get_optimal_batch_size(const std::map<std::string, InferenceEngine::Parameter>& options) const;
|
||||
uint32_t get_max_batch_size(const std::map<std::string, InferenceEngine::Parameter>& options) const;
|
||||
|
||||
@@ -264,7 +264,6 @@ std::vector<std::string> LegacyAPIHelper::get_supported_metrics() {
|
||||
GPU_METRIC_KEY(UARCH_VERSION),
|
||||
GPU_METRIC_KEY(EXECUTION_UNITS_COUNT),
|
||||
GPU_METRIC_KEY(MEMORY_STATISTICS),
|
||||
ov::caching_properties.name(),
|
||||
};
|
||||
|
||||
return supported_metrics;
|
||||
|
||||
@@ -280,9 +280,11 @@ void Plugin::SetConfig(const std::map<std::string, std::string> &config) {
|
||||
}
|
||||
};
|
||||
|
||||
if (config.find(PluginConfigInternalParams::KEY_CONFIG_DEVICE_ID) != config.end()) {
|
||||
std::string device_id = config.at(PluginConfigInternalParams::KEY_CONFIG_DEVICE_ID);
|
||||
update_config(m_configs_map.at(device_id), config);
|
||||
if (config.find(ov::internal::config_device_id.name()) != config.end()) {
|
||||
std::string device_id = config.at(ov::internal::config_device_id.name());
|
||||
auto config_for_device = config;
|
||||
config_for_device.erase(ov::internal::config_device_id.name());
|
||||
update_config(m_configs_map.at(device_id), config_for_device);
|
||||
} else {
|
||||
std::string device_id = get_device_id_from_config(config);
|
||||
if (!device_id.empty()) {
|
||||
@@ -603,6 +605,8 @@ Parameter Plugin::GetMetric(const std::string& name, const std::map<std::string,
|
||||
// earler than querying actual ID to avoid exceptions when no devices are found
|
||||
if (name == ov::supported_properties) {
|
||||
return decltype(ov::supported_properties)::value_type {get_supported_properties()};
|
||||
} else if (ov::internal::supported_properties == name) {
|
||||
return decltype(ov::internal::supported_properties)::value_type{get_supported_internal_properties()};
|
||||
} else if (name == METRIC_KEY(SUPPORTED_METRICS)) {
|
||||
IE_SET_METRIC_RETURN(SUPPORTED_METRICS, LegacyAPIHelper::get_supported_metrics());
|
||||
} else if (name == METRIC_KEY(SUPPORTED_CONFIG_KEYS)) {
|
||||
@@ -612,14 +616,14 @@ Parameter Plugin::GetMetric(const std::string& name, const std::map<std::string,
|
||||
for (auto const& dev : device_map)
|
||||
availableDevices.push_back(dev.first);
|
||||
return decltype(ov::available_devices)::value_type {availableDevices};
|
||||
} else if (name == ov::caching_properties) {
|
||||
} else if (name == ov::internal::caching_properties) {
|
||||
std::vector<ov::PropertyName> cachingProperties;
|
||||
cachingProperties.push_back(ov::PropertyName(ov::device::architecture.name(), PropertyMutability::RO));
|
||||
cachingProperties.push_back(ov::PropertyName(ov::intel_gpu::execution_units_count.name(), PropertyMutability::RO));
|
||||
cachingProperties.push_back(ov::PropertyName(ov::intel_gpu::driver_version.name(), PropertyMutability::RO));
|
||||
cachingProperties.push_back(ov::PropertyName(ov::hint::inference_precision.name(), PropertyMutability::RW));
|
||||
cachingProperties.push_back(ov::PropertyName(ov::hint::execution_mode.name(), PropertyMutability::RW));
|
||||
return decltype(ov::caching_properties)::value_type(cachingProperties);
|
||||
return decltype(ov::internal::caching_properties)::value_type(cachingProperties);
|
||||
} else if (name == METRIC_KEY(IMPORT_EXPORT_SUPPORT)) {
|
||||
IE_SET_METRIC_RETURN(IMPORT_EXPORT_SUPPORT, true);
|
||||
}
|
||||
@@ -730,7 +734,6 @@ std::vector<ov::PropertyName> Plugin::get_supported_properties() const {
|
||||
ov::PropertyName{ov::range_for_streams.name(), PropertyMutability::RO},
|
||||
ov::PropertyName{ov::optimal_batch_size.name(), PropertyMutability::RO},
|
||||
ov::PropertyName{ov::max_batch_size.name(), PropertyMutability::RO},
|
||||
ov::PropertyName{ov::caching_properties.name(), PropertyMutability::RO},
|
||||
ov::PropertyName{ov::device::architecture.name(), PropertyMutability::RO},
|
||||
ov::PropertyName{ov::device::full_name.name(), PropertyMutability::RO},
|
||||
ov::PropertyName{ov::device::uuid.name(), PropertyMutability::RO},
|
||||
@@ -762,6 +765,13 @@ std::vector<ov::PropertyName> Plugin::get_supported_properties() const {
|
||||
return supported_properties;
|
||||
}
|
||||
|
||||
std::vector<ov::PropertyName> Plugin::get_supported_internal_properties() const {
|
||||
static const std::vector<ov::PropertyName> supported_internal_properties = {
|
||||
ov::PropertyName{ov::internal::caching_properties.name(), ov::PropertyMutability::RO},
|
||||
ov::PropertyName{ov::internal::config_device_id.name(), ov::PropertyMutability::WO}};
|
||||
return supported_internal_properties;
|
||||
}
|
||||
|
||||
std::vector<std::string> Plugin::get_device_capabilities(const cldnn::device_info& info) const {
|
||||
std::vector<std::string> capabilities;
|
||||
|
||||
|
||||
+6
-2
@@ -793,7 +793,7 @@ TEST_P(OVGetMetricPropsTest_CACHING_PROPERTIES, GetMetricAndPrintNoThrow) {
|
||||
ov::hint::execution_mode.name(),
|
||||
};
|
||||
|
||||
ASSERT_NO_THROW(caching_properties = ie.get_property(target_device, ov::caching_properties));
|
||||
ASSERT_NO_THROW(caching_properties = ie.get_property(target_device, ov::internal::caching_properties));
|
||||
|
||||
std::cout << "GPU Caching properties: " << std::endl;
|
||||
for (auto& prop : caching_properties) {
|
||||
@@ -807,7 +807,7 @@ TEST_P(OVGetMetricPropsTest_CACHING_PROPERTIES, GetMetricAndPrintNoThrow) {
|
||||
caching_properties.end());
|
||||
}
|
||||
|
||||
OV_ASSERT_PROPERTY_SUPPORTED(ov::caching_properties);
|
||||
OV_ASSERT_PROPERTY_SUPPORTED(ov::internal::caching_properties);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(nightly_OVGetMetricPropsTest,
|
||||
@@ -816,6 +816,10 @@ INSTANTIATE_TEST_SUITE_P(nightly_OVGetMetricPropsTest,
|
||||
|
||||
// GetConfig / SetConfig for specific device
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(nightly_OVClassSpecificDevice0Test, OVSpecificDeviceSetConfigTest, ::testing::Values("GPU.0"));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(nightly_OVClassSpecificDevice1Test, OVSpecificDeviceSetConfigTest, ::testing::Values("GPU.1"));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(nightly_OVClassSpecificDevice0Test, OVSpecificDeviceGetConfigTest, ::testing::Values("GPU.0"));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(nightly_OVClassSpecificDevice1Test, OVSpecificDeviceGetConfigTest, ::testing::Values("GPU.1"));
|
||||
|
||||
@@ -62,7 +62,7 @@ ov::AnyMap remove_device_properties(ov::AnyMap& config, const std::vector<std::s
|
||||
|
||||
ov::AnyMap remove_proxy_properties(ov::AnyMap& config, bool rem_device_properties = false) {
|
||||
const static std::vector<ov::PropertyName> proxy_properties = {ov::device::id,
|
||||
CONFIG_KEY_INTERNAL(CONFIG_DEVICE_ID),
|
||||
ov::internal::config_device_id,
|
||||
ov::device::priorities,
|
||||
ov::proxy::alias_for,
|
||||
ov::proxy::device_priorities};
|
||||
@@ -137,7 +137,7 @@ void ov::proxy::Plugin::set_property(const ov::AnyMap& properties) {
|
||||
}
|
||||
|
||||
// Replace device::id by CONFIG_DEVICE_ID
|
||||
it = hw_config.find(CONFIG_KEY_INTERNAL(CONFIG_DEVICE_ID));
|
||||
it = hw_config.find(ov::internal::config_device_id.name());
|
||||
if (it != hw_config.end()) {
|
||||
hw_config[ov::device::id.name()] = it->second;
|
||||
hw_config.erase(it);
|
||||
@@ -242,7 +242,7 @@ void ov::proxy::Plugin::set_property(const ov::AnyMap& properties) {
|
||||
std::lock_guard<std::mutex> lock(m_plugin_mutex);
|
||||
for (const auto& it : hw_config) {
|
||||
// Skip proxy and primary device properties
|
||||
if (CONFIG_KEY_INTERNAL(CONFIG_DEVICE_ID) == it.first || ov::device::id.name() == it.first ||
|
||||
if (ov::internal::config_device_id.name() == it.first || ov::device::id.name() == it.first ||
|
||||
it.first == ov::device::priorities.name() || it.first == ov::proxy::device_priorities.name() ||
|
||||
it.first == ov::proxy::alias_for.name() ||
|
||||
// Skip options from config for primaty device
|
||||
@@ -261,7 +261,7 @@ ov::Any ov::proxy::Plugin::get_property(const std::string& name, const ov::AnyMa
|
||||
if (name == ov::device::id)
|
||||
return m_default_device;
|
||||
|
||||
if (name == CONFIG_KEY_INTERNAL(CONFIG_DEVICE_ID))
|
||||
if (name == ov::internal::config_device_id)
|
||||
return std::to_string(device_id);
|
||||
|
||||
if (name == ov::device::priorities) {
|
||||
@@ -284,9 +284,13 @@ ov::Any ov::proxy::Plugin::get_property(const std::string& name, const ov::AnyMa
|
||||
// ov::device::id changes the default proxy device
|
||||
if (std::find(supported_prop.begin(), supported_prop.end(), ov::device::id) == supported_prop.end())
|
||||
supported_prop.emplace_back(ov::device::id);
|
||||
if (std::find(supported_prop.begin(), supported_prop.end(), CONFIG_KEY_INTERNAL(CONFIG_DEVICE_ID)) ==
|
||||
return supported_prop;
|
||||
} else if (name == ov::internal::supported_properties) {
|
||||
auto supported_prop =
|
||||
get_core()->get_property(get_primary_device(device_id), name, {}).as<std::vector<ov::PropertyName>>();
|
||||
if (std::find(supported_prop.begin(), supported_prop.end(), ov::internal::config_device_id) ==
|
||||
supported_prop.end())
|
||||
supported_prop.emplace_back(ov::PropertyName(CONFIG_KEY_INTERNAL(CONFIG_DEVICE_ID)));
|
||||
supported_prop.emplace_back(ov::internal::config_device_id);
|
||||
return supported_prop;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ TEST_F(ProxyTests, set_property_for_primary_device_full_name) {
|
||||
TEST_F(ProxyTests, get_property_on_default_device) {
|
||||
const std::string dev_name = "MOCK";
|
||||
auto supported_properties = core.get_property(dev_name, ov::supported_properties);
|
||||
EXPECT_EQ(10, supported_properties.size());
|
||||
EXPECT_EQ(8, supported_properties.size());
|
||||
size_t mutable_pr(0), immutable_pr(0);
|
||||
for (auto&& property : supported_properties) {
|
||||
property.is_mutable() ? mutable_pr++ : immutable_pr++;
|
||||
@@ -66,14 +66,14 @@ TEST_F(ProxyTests, get_property_on_default_device) {
|
||||
EXPECT_NO_THROW(core.get_property(dev_name, property));
|
||||
}
|
||||
}
|
||||
EXPECT_EQ(6, immutable_pr);
|
||||
EXPECT_EQ(4, mutable_pr);
|
||||
EXPECT_EQ(5, immutable_pr);
|
||||
EXPECT_EQ(3, mutable_pr);
|
||||
}
|
||||
|
||||
TEST_F(ProxyTests, get_property_on_mixed_device) {
|
||||
const std::string dev_name = "MOCK.1";
|
||||
auto supported_properties = core.get_property(dev_name, ov::supported_properties);
|
||||
EXPECT_EQ(10, supported_properties.size());
|
||||
EXPECT_EQ(8, supported_properties.size());
|
||||
size_t mutable_pr(0), immutable_pr(0);
|
||||
for (auto&& property : supported_properties) {
|
||||
property.is_mutable() ? mutable_pr++ : immutable_pr++;
|
||||
@@ -93,14 +93,14 @@ TEST_F(ProxyTests, get_property_on_mixed_device) {
|
||||
core.get_property(dev_name, property);
|
||||
}
|
||||
}
|
||||
EXPECT_EQ(6, immutable_pr);
|
||||
EXPECT_EQ(4, mutable_pr);
|
||||
EXPECT_EQ(5, immutable_pr);
|
||||
EXPECT_EQ(3, mutable_pr);
|
||||
}
|
||||
|
||||
TEST_F(ProxyTests, get_property_on_specified_device) {
|
||||
const std::string dev_name = "MOCK.3";
|
||||
auto supported_properties = core.get_property(dev_name, ov::supported_properties);
|
||||
EXPECT_EQ(9, supported_properties.size());
|
||||
EXPECT_EQ(7, supported_properties.size());
|
||||
size_t mutable_pr(0), immutable_pr(0);
|
||||
for (auto&& property : supported_properties) {
|
||||
property.is_mutable() ? mutable_pr++ : immutable_pr++;
|
||||
@@ -119,15 +119,15 @@ TEST_F(ProxyTests, get_property_on_specified_device) {
|
||||
EXPECT_NO_THROW(core.get_property(dev_name, property));
|
||||
}
|
||||
}
|
||||
EXPECT_EQ(6, immutable_pr);
|
||||
EXPECT_EQ(3, mutable_pr);
|
||||
EXPECT_EQ(5, immutable_pr);
|
||||
EXPECT_EQ(2, mutable_pr);
|
||||
}
|
||||
|
||||
TEST_F(ProxyTests, get_property_for_changed_default_device) {
|
||||
const std::string dev_name = "MOCK";
|
||||
core.set_property(dev_name, ov::device::id(3));
|
||||
auto supported_properties = core.get_property(dev_name, ov::supported_properties);
|
||||
EXPECT_EQ(9, supported_properties.size());
|
||||
EXPECT_EQ(7, supported_properties.size());
|
||||
size_t mutable_pr(0), immutable_pr(0);
|
||||
for (auto&& property : supported_properties) {
|
||||
property.is_mutable() ? mutable_pr++ : immutable_pr++;
|
||||
@@ -146,6 +146,6 @@ TEST_F(ProxyTests, get_property_for_changed_default_device) {
|
||||
EXPECT_NO_THROW(core.get_property(dev_name, property));
|
||||
}
|
||||
}
|
||||
EXPECT_EQ(6, immutable_pr);
|
||||
EXPECT_EQ(3, mutable_pr);
|
||||
EXPECT_EQ(5, immutable_pr);
|
||||
EXPECT_EQ(2, mutable_pr);
|
||||
}
|
||||
@@ -528,7 +528,6 @@ void ov::proxy::tests::ProxyTests::register_plugin_support_reshape(ov::Core& cor
|
||||
RO_property(ov::available_devices.name()),
|
||||
RO_property(ov::loaded_from_cache.name()),
|
||||
RO_property(ov::device::uuid.name()),
|
||||
RO_property(ov::caching_properties.name()),
|
||||
RO_property(METRIC_KEY(IMPORT_EXPORT_SUPPORT)),
|
||||
};
|
||||
// the whole config is RW before network is loaded.
|
||||
@@ -548,6 +547,9 @@ void ov::proxy::tests::ProxyTests::register_plugin_support_reshape(ov::Core& cor
|
||||
supportedProperties.insert(supportedProperties.end(), rwProperties.begin(), rwProperties.end());
|
||||
|
||||
return decltype(ov::supported_properties)::value_type(supportedProperties);
|
||||
} else if (name == ov::internal::supported_properties) {
|
||||
return decltype(ov::internal::supported_properties)::value_type(
|
||||
{ov::PropertyName{ov::internal::caching_properties.name(), ov::PropertyMutability::RO}});
|
||||
} else if (name == ov::device::uuid) {
|
||||
ov::device::UUID uuid;
|
||||
for (size_t i = 0; i < uuid.MAX_UUID_SIZE; i++) {
|
||||
@@ -573,9 +575,9 @@ void ov::proxy::tests::ProxyTests::register_plugin_support_reshape(ov::Core& cor
|
||||
return configs;
|
||||
} else if (METRIC_KEY(IMPORT_EXPORT_SUPPORT) == name) {
|
||||
return true;
|
||||
} else if (ov::caching_properties == name) {
|
||||
} else if (ov::internal::caching_properties == name) {
|
||||
std::vector<ov::PropertyName> caching_properties = {ov::device::uuid};
|
||||
return decltype(ov::caching_properties)::value_type(caching_properties);
|
||||
return decltype(ov::internal::caching_properties)::value_type(caching_properties);
|
||||
} else if (name == "SUPPORTED_METRICS") { // TODO: Remove this key
|
||||
std::vector<std::string> configs;
|
||||
for (const auto& property : roProperties) {
|
||||
@@ -649,7 +651,6 @@ void ov::proxy::tests::ProxyTests::register_plugin_support_subtract(ov::Core& co
|
||||
RO_property(ov::available_devices.name()),
|
||||
RO_property(ov::loaded_from_cache.name()),
|
||||
RO_property(ov::device::uuid.name()),
|
||||
RO_property(ov::caching_properties.name()),
|
||||
RO_property(METRIC_KEY(IMPORT_EXPORT_SUPPORT)),
|
||||
};
|
||||
// the whole config is RW before network is loaded.
|
||||
@@ -667,6 +668,9 @@ void ov::proxy::tests::ProxyTests::register_plugin_support_subtract(ov::Core& co
|
||||
supportedProperties.insert(supportedProperties.end(), rwProperties.begin(), rwProperties.end());
|
||||
|
||||
return decltype(ov::supported_properties)::value_type(supportedProperties);
|
||||
} else if (name == ov::internal::supported_properties) {
|
||||
return decltype(ov::internal::supported_properties)::value_type(
|
||||
{ov::PropertyName{ov::internal::caching_properties.name(), ov::PropertyMutability::RO}});
|
||||
} else if (name == ov::device::uuid) {
|
||||
ov::device::UUID uuid;
|
||||
for (size_t i = 0; i < uuid.MAX_UUID_SIZE; i++) {
|
||||
@@ -696,9 +700,9 @@ void ov::proxy::tests::ProxyTests::register_plugin_support_subtract(ov::Core& co
|
||||
return configs;
|
||||
} else if (METRIC_KEY(IMPORT_EXPORT_SUPPORT) == name) {
|
||||
return true;
|
||||
} else if (ov::caching_properties == name) {
|
||||
} else if (ov::internal::caching_properties == name) {
|
||||
std::vector<ov::PropertyName> caching_properties = {ov::device::uuid};
|
||||
return decltype(ov::caching_properties)::value_type(caching_properties);
|
||||
return decltype(ov::internal::caching_properties)::value_type(caching_properties);
|
||||
} else if (name == "SUPPORTED_METRICS") { // TODO: Remove this key
|
||||
std::vector<std::string> configs;
|
||||
for (const auto& property : roProperties) {
|
||||
@@ -753,7 +757,6 @@ void ov::proxy::tests::ProxyTests::register_plugin_without_devices(ov::Core& cor
|
||||
RO_property(ov::supported_properties.name()),
|
||||
RO_property(ov::available_devices.name()),
|
||||
RO_property(ov::loaded_from_cache.name()),
|
||||
RO_property(ov::caching_properties.name()),
|
||||
RO_property(METRIC_KEY(IMPORT_EXPORT_SUPPORT)),
|
||||
};
|
||||
// the whole config is RW before network is loaded.
|
||||
@@ -771,6 +774,9 @@ void ov::proxy::tests::ProxyTests::register_plugin_without_devices(ov::Core& cor
|
||||
supportedProperties.insert(supportedProperties.end(), rwProperties.begin(), rwProperties.end());
|
||||
|
||||
return decltype(ov::supported_properties)::value_type(supportedProperties);
|
||||
} else if (name == ov::internal::supported_properties) {
|
||||
return decltype(ov::internal::supported_properties)::value_type(
|
||||
{ov::PropertyName{ov::internal::caching_properties.name(), ov::PropertyMutability::RO}});
|
||||
} else if (name == ov::available_devices) {
|
||||
return decltype(ov::available_devices)::value_type(device_ids);
|
||||
} else if (name == ov::device::capabilities) {
|
||||
|
||||
@@ -26,7 +26,7 @@ Configuration::Configuration(const ov::AnyMap& config, const Configuration& defa
|
||||
|
||||
if (ov::template_plugin::disable_transformations == key) {
|
||||
disable_transformations = value.as<bool>();
|
||||
} else if (ov::exclusive_async_requests == key) {
|
||||
} else if (ov::internal::exclusive_async_requests == key) {
|
||||
exclusive_async_requests = value.as<bool>();
|
||||
} else if (streamExecutorConfigKeys.end() !=
|
||||
std::find(std::begin(streamExecutorConfigKeys), std::end(streamExecutorConfigKeys), key)) {
|
||||
@@ -55,7 +55,7 @@ ov::Any Configuration::Get(const std::string& name) const {
|
||||
return {std::to_string(device_id)};
|
||||
} else if (name == ov::enable_profiling) {
|
||||
return {perf_count};
|
||||
} else if (name == ov::exclusive_async_requests) {
|
||||
} else if (name == ov::internal::exclusive_async_requests) {
|
||||
return {exclusive_async_requests};
|
||||
} else if (name == ov::template_plugin::disable_transformations) {
|
||||
return {disable_transformations};
|
||||
|
||||
@@ -225,7 +225,6 @@ ov::Any ov::template_plugin::Plugin::get_property(const std::string& name, const
|
||||
ov::device::full_name,
|
||||
ov::device::architecture,
|
||||
ov::device::capabilities,
|
||||
ov::caching_properties,
|
||||
ov::range_for_async_infer_requests};
|
||||
return ro_properties;
|
||||
};
|
||||
@@ -233,7 +232,7 @@ ov::Any ov::template_plugin::Plugin::get_property(const std::string& name, const
|
||||
std::vector<ov::PropertyName> rw_properties{ov::device::id,
|
||||
ov::enable_profiling,
|
||||
ov::hint::performance_mode,
|
||||
ov::exclusive_async_requests,
|
||||
ov::internal::exclusive_async_requests,
|
||||
ov::template_plugin::disable_transformations};
|
||||
return rw_properties;
|
||||
};
|
||||
@@ -271,6 +270,9 @@ ov::Any ov::template_plugin::Plugin::get_property(const std::string& name, const
|
||||
supported_properties.insert(supported_properties.end(), ro_properties.begin(), ro_properties.end());
|
||||
supported_properties.insert(supported_properties.end(), rw_properties.begin(), rw_properties.end());
|
||||
return decltype(ov::supported_properties)::value_type(supported_properties);
|
||||
} else if (ov::internal::supported_properties == name) {
|
||||
return decltype(ov::internal::supported_properties)::value_type{
|
||||
ov::PropertyName{ov::internal::caching_properties.name(), ov::PropertyMutability::RO}};
|
||||
} else if (ov::available_devices == name) {
|
||||
// TODO: fill list of available devices
|
||||
std::vector<std::string> available_devices = {""};
|
||||
@@ -284,9 +286,9 @@ ov::Any ov::template_plugin::Plugin::get_property(const std::string& name, const
|
||||
// TODO: return device architecture for device specified by DEVICE_ID config
|
||||
std::string arch = "TEMPLATE";
|
||||
return decltype(ov::device::architecture)::value_type(arch);
|
||||
} else if (ov::caching_properties == name) {
|
||||
} else if (ov::internal::caching_properties == name) {
|
||||
std::vector<ov::PropertyName> caching_properties = {ov::device::architecture};
|
||||
return decltype(ov::caching_properties)::value_type(caching_properties);
|
||||
return decltype(ov::internal::caching_properties)::value_type(caching_properties);
|
||||
} else if (ov::device::capabilities == name) {
|
||||
// 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};
|
||||
|
||||
@@ -103,6 +103,7 @@ using OVClassCompileModelDoNotReturnDefaultHintTest = OVClassSetDevicePriorityCo
|
||||
using OVClassCompileModelAndCheckSecondaryPropertiesTest = OVClassSetDevicePriorityConfigPropsTest;
|
||||
|
||||
using OVGetConfigTest = OVClassBaseTestP;
|
||||
using OVSpecificDeviceSetConfigTest = OVClassBaseTestP;
|
||||
using OVSpecificDeviceGetConfigTest = OVClassBaseTestP;
|
||||
using OVGetAvailableDevicesPropsTest = OVClassBaseTestP;
|
||||
using OVGetMetricPropsTest = OVClassBaseTestP;
|
||||
|
||||
@@ -219,7 +219,7 @@ void CompileModelCacheTestBase::run() {
|
||||
GTEST_FAIL() << "Plugin doesn't support import and export - skipping test" << std::endl;
|
||||
}
|
||||
if (importExportSupported(*core)) {
|
||||
ASSERT_NO_THROW(core->get_property(targetDevice, ov::caching_properties));
|
||||
ASSERT_NO_THROW(core->get_property(targetDevice, ov::internal::caching_properties));
|
||||
}
|
||||
configure_model();
|
||||
try {
|
||||
|
||||
@@ -449,6 +449,43 @@ TEST_P(OVClassSetDefaultDeviceIDPropTest, SetDefaultDeviceIDNoThrow) {
|
||||
ASSERT_EQ(value, "YES");
|
||||
}
|
||||
|
||||
TEST_P(OVSpecificDeviceSetConfigTest, GetConfigSpecificDeviceNoThrow) {
|
||||
ov::Core ie = createCoreWithTemplate();
|
||||
ov::Any p;
|
||||
|
||||
std::string deviceID, clear_target_device;
|
||||
auto pos = target_device.find('.');
|
||||
if (pos != std::string::npos) {
|
||||
clear_target_device = target_device.substr(0, pos);
|
||||
deviceID = target_device.substr(pos + 1, target_device.size());
|
||||
}
|
||||
auto deviceIDs = ie.get_property(clear_target_device, ov::available_devices);
|
||||
if (std::find(deviceIDs.begin(), deviceIDs.end(), deviceID) == deviceIDs.end()) {
|
||||
GTEST_FAIL() << "No DeviceID" << std::endl;
|
||||
}
|
||||
auto device_name = [&clear_target_device] (const std::string& id) {
|
||||
return clear_target_device + "." + id;
|
||||
};
|
||||
// Set default device id to target device
|
||||
OV_ASSERT_NO_THROW(ie.set_property(clear_target_device, ov::device::id(deviceID)));
|
||||
// Set num_streams to AUTO for clear device name
|
||||
OV_ASSERT_NO_THROW(ie.set_property(clear_target_device, ov::num_streams(ov::streams::AUTO)));
|
||||
ASSERT_EQ(ie.get_property(clear_target_device, ov::num_streams), ov::streams::AUTO);
|
||||
// Check if it is applied for all devices
|
||||
for (auto& id : deviceIDs) {
|
||||
ASSERT_EQ(ie.get_property(device_name(id), ov::num_streams), ov::streams::AUTO);
|
||||
}
|
||||
for (auto& id : deviceIDs) {
|
||||
// Set different properties for different devices
|
||||
OV_ASSERT_NO_THROW(ie.set_property(device_name(id), ov::num_streams(std::stoi(id))));
|
||||
ASSERT_EQ(ie.get_property(device_name(id), ov::num_streams), std::stoi(id));
|
||||
}
|
||||
// Check if default device id is still the same
|
||||
ASSERT_EQ(ie.get_property(clear_target_device, ov::device::id), deviceID);
|
||||
// Check if default property is still equal property to default device
|
||||
ASSERT_EQ(ie.get_property(clear_target_device, ov::num_streams), std::stoi(deviceID));
|
||||
}
|
||||
|
||||
TEST_P(OVSpecificDeviceGetConfigTest, GetConfigSpecificDeviceNoThrow) {
|
||||
ov::Core ie = createCoreWithTemplate();
|
||||
ov::Any p;
|
||||
|
||||
Reference in new issue
Block a user