[apiConformance] Fix issues in core properties tests (#17608)

This commit is contained in:
Sofya Balandina 2023-05-24 12:29:31 +01:00 committed by GitHub
parent 13c966f293
commit be96f5438c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 127 additions and 99 deletions

View File

@ -151,6 +151,22 @@ INSTANTIATE_TEST_SUITE_P(smoke_AutoMultiHeteroOVGetMetricPropsTest,
INSTANTIATE_TEST_SUITE_P(smoke_OVGetMetricPropsTest, OVGetMetricPropsTest, ::testing::Values("CPU")); INSTANTIATE_TEST_SUITE_P(smoke_OVGetMetricPropsTest, OVGetMetricPropsTest, ::testing::Values("CPU"));
INSTANTIATE_TEST_SUITE_P(
smoke_AutoMultiHeteroOVCheckGetSupportedROMetricsPropsTests,
OVCheckGetSupportedROMetricsPropsTests,
::testing::Combine(::testing::Values("MULTI", "HETERO", "AUTO"),
::testing::ValuesIn(OVCheckGetSupportedROMetricsPropsTests::configureProperties(
{ov::device::full_name.name()}))),
OVCheckGetSupportedROMetricsPropsTests::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
smoke_OVCheckGetSupportedROMetricsPropsTests,
OVCheckGetSupportedROMetricsPropsTests,
::testing::Combine(::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::ValuesIn(OVCheckGetSupportedROMetricsPropsTests::configureProperties(
{ov::device::full_name.name()}))),
OVCheckGetSupportedROMetricsPropsTests::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(smoke_OVGetAvailableDevicesPropsTest, INSTANTIATE_TEST_SUITE_P(smoke_OVGetAvailableDevicesPropsTest,
OVGetAvailableDevicesPropsTest, OVGetAvailableDevicesPropsTest,
::testing::Values("CPU")); ::testing::Values("CPU"));
@ -158,7 +174,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_OVGetAvailableDevicesPropsTest,
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P(
OVCheckSetSupportedRWMandatoryMetricsPropsTests, OVCheckSetSupportedRWMandatoryMetricsPropsTests,
OVCheckSetSupportedRWMetricsPropsTests, OVCheckSetSupportedRWMetricsPropsTests,
::testing::Combine(::testing::Values("MULTI", "AUTO"), ::testing::Combine(::testing::Values("MULTI:CPU", "AUTO:CPU"),
::testing::ValuesIn(OVCheckSetSupportedRWMetricsPropsTests::getRWMandatoryPropertiesValues( ::testing::ValuesIn(OVCheckSetSupportedRWMetricsPropsTests::getRWMandatoryPropertiesValues(
{ov::hint::model_priority.name(), ov::log::level.name()}))), {ov::hint::model_priority.name(), ov::log::level.name()}))),
OVCheckSetSupportedRWMetricsPropsTests::getTestCaseName); OVCheckSetSupportedRWMetricsPropsTests::getTestCaseName);
@ -166,7 +182,7 @@ INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P(
OVCheckSetSupportedRWOptionalMetricsPropsTests, OVCheckSetSupportedRWOptionalMetricsPropsTests,
OVCheckSetSupportedRWMetricsPropsTests, OVCheckSetSupportedRWMetricsPropsTests,
::testing::Combine(::testing::Values("MULTI", "AUTO"), ::testing::Combine(::testing::Values("MULTI:CPU", "AUTO:CPU"),
::testing::ValuesIn(OVCheckSetSupportedRWMetricsPropsTests::getRWOptionalPropertiesValues( ::testing::ValuesIn(OVCheckSetSupportedRWMetricsPropsTests::getRWOptionalPropertiesValues(
{ov::hint::enable_hyper_threading.name(), {ov::hint::enable_hyper_threading.name(),
ov::hint::enable_cpu_pinning.name(), ov::hint::enable_cpu_pinning.name(),

View File

@ -104,7 +104,7 @@ std::vector<std::string> disabledTestPatterns() {
R"(.*smoke_Auto_BehaviorTests.*DynamicOutputToDynamicInput.*)", R"(.*smoke_Auto_BehaviorTests.*DynamicOutputToDynamicInput.*)",
R"(.*smoke_Auto_BehaviorTests.*DynamicInputToDynamicOutput.*)", R"(.*smoke_Auto_BehaviorTests.*DynamicInputToDynamicOutput.*)",
// unsupported metrics // unsupported metrics
R"(.*OVGetMetricPropsTest.*OVGetMetricPropsTest.*(DEVICE_ID|MAX_BATCH_SIZE).*)", R"(.*OVGetMetricPropsTest.*OVGetMetricPropsTest.*(MAX_BATCH_SIZE).*)",
R"(.*smoke_AutoMultiHeteroOVGetMetricPropsTest.*OVGetMetricPropsTest.*(AVAILABLE_DEVICES|OPTIMIZATION_CAPABILITIES|RANGE_FOR_ASYNC_INFER_REQUESTS|RANGE_FOR_STREAMS).*)", R"(.*smoke_AutoMultiHeteroOVGetMetricPropsTest.*OVGetMetricPropsTest.*(AVAILABLE_DEVICES|OPTIMIZATION_CAPABILITIES|RANGE_FOR_ASYNC_INFER_REQUESTS|RANGE_FOR_STREAMS).*)",
// supports only '' as device id // supports only '' as device id
R"(.*OVClassQueryModelTest.*QueryModelWithDeviceID.*)", R"(.*OVClassQueryModelTest.*QueryModelWithDeviceID.*)",

View File

@ -36,6 +36,22 @@ INSTANTIATE_TEST_SUITE_P(smoke_MultiHeteroOVGetMetricPropsTest,
INSTANTIATE_TEST_SUITE_P(nightly_OVGetMetricPropsTest, OVGetMetricPropsTest, ::testing::Values("GNA")); INSTANTIATE_TEST_SUITE_P(nightly_OVGetMetricPropsTest, OVGetMetricPropsTest, ::testing::Values("GNA"));
INSTANTIATE_TEST_SUITE_P(
smoke_MultiHeteroOVCheckGetSupportedROMetricsPropsTests,
OVCheckGetSupportedROMetricsPropsTests,
::testing::Combine(::testing::Values("MULTI", "HETERO"),
::testing::ValuesIn(OVCheckGetSupportedROMetricsPropsTests::configureProperties(
{ov::device::full_name.name()}))),
OVCheckGetSupportedROMetricsPropsTests::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(
smoke_OVCheckGetSupportedROMetricsPropsTests,
OVCheckGetSupportedROMetricsPropsTests,
::testing::Combine(::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::ValuesIn(OVCheckGetSupportedROMetricsPropsTests::configureProperties(
{ov::device::full_name.name()}))),
OVCheckGetSupportedROMetricsPropsTests::getTestCaseName);
const std::vector<std::tuple<std::string, std::pair<ov::AnyMap, std::string>>> GetMetricTest_ExecutionDevice_GNA = { const std::vector<std::tuple<std::string, std::pair<ov::AnyMap, std::string>>> GetMetricTest_ExecutionDevice_GNA = {
{"GNA", std::make_pair(ov::AnyMap{}, "GNA")}}; {"GNA", std::make_pair(ov::AnyMap{}, "GNA")}};

View File

@ -97,7 +97,6 @@ std::vector<std::string> disabledTestPatterns() {
R"(.*CachingSupportCase.*LoadNet.*(ConvPoolRelu|TIwithLSTMcell1)_f32_batch2.*)", R"(.*CachingSupportCase.*LoadNet.*(ConvPoolRelu|TIwithLSTMcell1)_f32_batch2.*)",
R"(.*smoke_Multi_BehaviorTests.*)", R"(.*smoke_Multi_BehaviorTests.*)",
// unsupported metrics // unsupported metrics
R"(.*OVGetMetricPropsTest.*OVGetMetricPropsTest.*DEVICE_ID.*)",
R"(.*smoke_MultiHeteroOVGetMetricPropsTest.*OVGetMetricPropsTest.*(AVAILABLE_DEVICES|OPTIMIZATION_CAPABILITIES|RANGE_FOR_ASYNC_INFER_REQUESTS|RANGE_FOR_STREAMS).*)", R"(.*smoke_MultiHeteroOVGetMetricPropsTest.*OVGetMetricPropsTest.*(AVAILABLE_DEVICES|OPTIMIZATION_CAPABILITIES|RANGE_FOR_ASYNC_INFER_REQUESTS|RANGE_FOR_STREAMS).*)",
}; };
} }

View File

@ -159,7 +159,7 @@ INSTANTIATE_TEST_SUITE_P(nightly_OVGetAvailableDevicesPropsTest,
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P(
smoke_MultiAutoOVCheckSetSupportedRWMetricsPropsTests, smoke_MultiAutoOVCheckSetSupportedRWMetricsPropsTests,
OVCheckSetSupportedRWMetricsPropsTests, OVCheckSetSupportedRWMetricsPropsTests,
::testing::Combine(::testing::Values("MULTI", "AUTO"), ::testing::Combine(::testing::Values("MULTI:GPU", "AUTO:GPU"),
::testing::ValuesIn(OVCheckSetSupportedRWMetricsPropsTests::getRWMandatoryPropertiesValues( ::testing::ValuesIn(OVCheckSetSupportedRWMetricsPropsTests::getRWMandatoryPropertiesValues(
{ov::hint::model_priority.name(), ov::log::level.name()}))), {ov::hint::model_priority.name(), ov::log::level.name()}))),
OVCheckSetSupportedRWMetricsPropsTests::getTestCaseName); OVCheckSetSupportedRWMetricsPropsTests::getTestCaseName);
@ -169,9 +169,21 @@ INSTANTIATE_TEST_SUITE_P(
OVCheckGetSupportedROMetricsPropsTests, OVCheckGetSupportedROMetricsPropsTests,
::testing::Combine(::testing::Values(CommonTestUtils::DEVICE_GPU), ::testing::Combine(::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::ValuesIn(OVCheckGetSupportedROMetricsPropsTests::configureProperties( ::testing::ValuesIn(OVCheckGetSupportedROMetricsPropsTests::configureProperties(
{ov::device::uuid.name(), ov::device::gops.name(), ov::device::type.name()}))), {ov::device::uuid.name(), ov::device::gops.name(), ov::device::type.name(), ov::device::full_name.name()}))),
OVCheckGetSupportedROMetricsPropsTests::getTestCaseName); OVCheckGetSupportedROMetricsPropsTests::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(nightly_MultiHeteroAutoBatchOVCheckChangePropComplieModleGetPropTests_DEVICE_ID,
OVCheckChangePropComplieModleGetPropTests_DEVICE_ID,
::testing::Combine(::testing::Values("MULTI", "HETERO", "AUTO", "BATCH"),
::testing::Values(ov::AnyMap({}))),
OVCheckChangePropComplieModleGetPropTests_DEVICE_ID::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(nightly_gpuOVCheckChangePropComplieModleGetPropTests_DEVICE_ID,
OVCheckChangePropComplieModleGetPropTests_DEVICE_ID,
::testing::Combine(::testing::Values("GPU"),
::testing::Values(ov::AnyMap({}))),
OVCheckChangePropComplieModleGetPropTests_DEVICE_ID::getTestCaseName);
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P(
smoke_OVCheckSetSupportedRWMetricsPropsTests, smoke_OVCheckSetSupportedRWMetricsPropsTests,
OVCheckSetSupportedRWMetricsPropsTests, OVCheckSetSupportedRWMetricsPropsTests,

View File

@ -87,6 +87,15 @@ INSTANTIATE_TEST_SUITE_P(smoke_AutoBatch_BehaviorTests,
INSTANTIATE_TEST_SUITE_P(smoke_OVGetMetricPropsTest, INSTANTIATE_TEST_SUITE_P(smoke_OVGetMetricPropsTest,
OVGetMetricPropsTest, OVGetMetricPropsTest,
::testing::Values(CommonTestUtils::DEVICE_TEMPLATE)); ::testing::Values(CommonTestUtils::DEVICE_TEMPLATE));
INSTANTIATE_TEST_SUITE_P(
smoke_OVCheckGetSupportedROMetricsPropsTests,
OVCheckGetSupportedROMetricsPropsTests,
::testing::Combine(::testing::Values(CommonTestUtils::DEVICE_TEMPLATE),
::testing::ValuesIn(OVCheckGetSupportedROMetricsPropsTests::configureProperties(
{ov::device::full_name.name()}))),
OVCheckGetSupportedROMetricsPropsTests::getTestCaseName);
// //
// OV Class GetConfig // OV Class GetConfig
// //

View File

@ -19,7 +19,7 @@ std::vector<std::string> disabledTestPatterns() {
R"(.*smoke_(Multi|Auto|Hetero)_BehaviorTests.*OVPropertiesTests.*canSetPropertyAndCheckGetProperty.*)", R"(.*smoke_(Multi|Auto|Hetero)_BehaviorTests.*OVPropertiesTests.*canSetPropertyAndCheckGetProperty.*)",
// //
// unsupported metrics // unsupported metrics
R"(.*smoke_OVGetMetricPropsTest.*OVGetMetricPropsTest.*(DEVICE_ID|RANGE_FOR_STREAMS|MAX_BATCH_SIZE).*)", R"(.*smoke_OVGetMetricPropsTest.*OVGetMetricPropsTest.*(RANGE_FOR_STREAMS|MAX_BATCH_SIZE).*)",
// CVS-55937 // CVS-55937
R"(.*SplitLayerTest.*numSplits=30.*)", R"(.*SplitLayerTest.*numSplits=30.*)",

View File

@ -35,7 +35,6 @@ INSTANTIATE_TEST_SUITE_P(ov_plugin_AutoBatch, OVPropertiesIncorrectTests,
const std::vector<ov::AnyMap> default_properties = { const std::vector<ov::AnyMap> default_properties = {
{}, {},
{ov::enable_profiling(true)}, {ov::enable_profiling(true)},
{ov::device::id("0")},
}; };
const std::vector<ov::AnyMap> auto_batch_properties = { const std::vector<ov::AnyMap> auto_batch_properties = {
@ -80,14 +79,10 @@ INSTANTIATE_TEST_SUITE_P(ov_plugin, OVCheckSetSupportedRWMetricsPropsTests,
::testing::ValuesIn(OVCheckSetSupportedRWMetricsPropsTests::getRWOptionalPropertiesValues())), ::testing::ValuesIn(OVCheckSetSupportedRWMetricsPropsTests::getRWOptionalPropertiesValues())),
OVCheckSetSupportedRWMetricsPropsTests::getTestCaseName); OVCheckSetSupportedRWMetricsPropsTests::getTestCaseName);
const std::vector<ov::AnyMap> device_properties = {
{ov::device::id("0")},
};
INSTANTIATE_TEST_SUITE_P(ov_plugin_mandatory, OVCheckChangePropComplieModleGetPropTests_DEVICE_ID, INSTANTIATE_TEST_SUITE_P(ov_plugin_mandatory, OVCheckChangePropComplieModleGetPropTests_DEVICE_ID,
::testing::Combine( ::testing::Combine(
::testing::ValuesIn(return_all_possible_device_combination()), ::testing::ValuesIn(return_all_possible_device_combination()),
::testing::ValuesIn(device_properties)), ::testing::Values(ov::AnyMap({}))),
OVCheckChangePropComplieModleGetPropTests_DEVICE_ID::getTestCaseName); OVCheckChangePropComplieModleGetPropTests_DEVICE_ID::getTestCaseName);
INSTANTIATE_TEST_SUITE_P(ov_plugin, OVCheckMetricsPropsTests_ModelDependceProps, INSTANTIATE_TEST_SUITE_P(ov_plugin, OVCheckMetricsPropsTests_ModelDependceProps,

View File

@ -56,7 +56,7 @@ public:
AnyMap compileModelProperties; AnyMap compileModelProperties;
}; };
class OVPropertiesTestsWithComplieModelProps : public testing::WithParamInterface<PropertiesParams>, class OVPropertiesTestsWithCompileModelProps : public testing::WithParamInterface<PropertiesParams>,
public OVPropertiesBase { public OVPropertiesBase {
public: public:
static std::string getTestCaseName(testing::TestParamInfo<PropertiesParams> obj); static std::string getTestCaseName(testing::TestParamInfo<PropertiesParams> obj);
@ -77,10 +77,10 @@ public:
static std::vector<ov::AnyMap> getModelDependcePropertiesValues(); static std::vector<ov::AnyMap> getModelDependcePropertiesValues();
}; };
using OVCheckSetSupportedRWMetricsPropsTests = OVPropertiesTestsWithComplieModelProps; using OVCheckSetSupportedRWMetricsPropsTests = OVPropertiesTestsWithCompileModelProps;
using OVCheckGetSupportedROMetricsPropsTests = OVPropertiesTestsWithComplieModelProps; using OVCheckGetSupportedROMetricsPropsTests = OVPropertiesTestsWithCompileModelProps;
using OVCheckChangePropComplieModleGetPropTests_DEVICE_ID = OVPropertiesTestsWithComplieModelProps; using OVCheckChangePropComplieModleGetPropTests_DEVICE_ID = OVPropertiesTestsWithCompileModelProps;
using OVCheckMetricsPropsTests_ModelDependceProps = OVPropertiesTestsWithComplieModelProps; using OVCheckMetricsPropsTests_ModelDependceProps = OVPropertiesTestsWithCompileModelProps;
class OVClassSetDefaultDeviceIDPropTest : public OVPluginTestBase, class OVClassSetDefaultDeviceIDPropTest : public OVPluginTestBase,
public ::testing::WithParamInterface<std::pair<std::string, std::string>> { public ::testing::WithParamInterface<std::pair<std::string, std::string>> {

View File

@ -60,7 +60,7 @@ void OVSetPropComplieModleGetPropTests::SetUp() {
model = ngraph::builder::subgraph::makeSplitConcat(); model = ngraph::builder::subgraph::makeSplitConcat();
} }
std::string OVPropertiesTestsWithComplieModelProps::getTestCaseName(testing::TestParamInfo<PropertiesParams> obj) { std::string OVPropertiesTestsWithCompileModelProps::getTestCaseName(testing::TestParamInfo<PropertiesParams> obj) {
std::string target_device; std::string target_device;
AnyMap properties; AnyMap properties;
std::tie(target_device, properties) = obj.param; std::tie(target_device, properties) = obj.param;
@ -73,7 +73,7 @@ std::string OVPropertiesTestsWithComplieModelProps::getTestCaseName(testing::Tes
return result.str(); return result.str();
} }
void OVPropertiesTestsWithComplieModelProps::SetUp() { void OVPropertiesTestsWithCompileModelProps::SetUp() {
SKIP_IF_CURRENT_TEST_IS_DISABLED(); SKIP_IF_CURRENT_TEST_IS_DISABLED();
std::string temp_device; std::string temp_device;
std::tie(temp_device, properties) = this->GetParam(); std::tie(temp_device, properties) = this->GetParam();
@ -96,10 +96,11 @@ void OVPropertiesTestsWithComplieModelProps::SetUp() {
} else if (target_device == std::string(CommonTestUtils::DEVICE_BATCH)) { } else if (target_device == std::string(CommonTestUtils::DEVICE_BATCH)) {
compileModelProperties = {{ CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG) , hw_device}}; compileModelProperties = {{ CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG) , hw_device}};
} }
model = ngraph::builder::subgraph::makeSplitConcat(); model = ngraph::builder::subgraph::makeSplitConcat();
} }
void OVPropertiesTestsWithComplieModelProps::TearDown() { void OVPropertiesTestsWithCompileModelProps::TearDown() {
if (!properties.empty()) { if (!properties.empty()) {
utils::PluginCache::get().reset(); utils::PluginCache::get().reset();
} }
@ -204,9 +205,10 @@ TEST_P(OVSetPropComplieModleGetPropTests, SetPropertyAndComplieModelWithPropsWor
} }
} }
std::vector<ov::AnyMap> OVPropertiesTestsWithComplieModelProps::getROMandatoryProperties() { std::vector<ov::AnyMap> OVPropertiesTestsWithCompileModelProps::getROMandatoryProperties() {
std::vector<ov::AnyMap> res; 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::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::optimal_number_of_infer_requests.name(), ov::optimal_number_of_infer_requests.mutability), nullptr}});
res.push_back({{ov::PropertyName(ov::device::architecture.name(), ov::device::architecture.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::device::type.name(), ov::device::type.mutability), nullptr}});
@ -215,7 +217,7 @@ std::vector<ov::AnyMap> OVPropertiesTestsWithComplieModelProps::getROMandatoryPr
return res; return res;
} }
std::vector<ov::AnyMap> OVPropertiesTestsWithComplieModelProps::getROOptionalProperties() { std::vector<ov::AnyMap> OVPropertiesTestsWithCompileModelProps::getROOptionalProperties() {
std::vector<ov::AnyMap> res; std::vector<ov::AnyMap> res;
res.push_back({{ov::PropertyName(ov::loaded_from_cache.name(), ov::loaded_from_cache.mutability), nullptr}}); res.push_back({{ov::PropertyName(ov::loaded_from_cache.name(), ov::loaded_from_cache.mutability), nullptr}});
res.push_back({{ov::PropertyName(ov::device::uuid.name(), ov::device::uuid.mutability), nullptr}}); res.push_back({{ov::PropertyName(ov::device::uuid.name(), ov::device::uuid.mutability), nullptr}});
@ -225,7 +227,7 @@ std::vector<ov::AnyMap> OVPropertiesTestsWithComplieModelProps::getROOptionalPro
return res; return res;
} }
std::vector<ov::AnyMap> OVPropertiesTestsWithComplieModelProps::configureProperties(std::vector<std::string> props) { std::vector<ov::AnyMap> OVPropertiesTestsWithCompileModelProps::configureProperties(std::vector<std::string> props) {
std::vector<ov::AnyMap> res; std::vector<ov::AnyMap> res;
for (auto &prop : props) { for (auto &prop : props) {
@ -235,7 +237,7 @@ std::vector<ov::AnyMap> OVPropertiesTestsWithComplieModelProps::configurePropert
return res; return res;
} }
std::vector<ov::AnyMap> OVPropertiesTestsWithComplieModelProps::getRWMandatoryPropertiesValues(std::vector<std::string> props) { std::vector<ov::AnyMap> OVPropertiesTestsWithCompileModelProps::getRWMandatoryPropertiesValues(std::vector<std::string> props) {
std::vector<ov::AnyMap> res; std::vector<ov::AnyMap> res;
if (props.empty() || std::find(props.begin(), props.end(), ov::hint::inference_precision.name()) != props.end()) { if (props.empty() || std::find(props.begin(), props.end(), ov::hint::inference_precision.name()) != props.end()) {
@ -246,14 +248,14 @@ std::vector<ov::AnyMap> OVPropertiesTestsWithComplieModelProps::getRWMandatoryPr
ov::element::boolean, ov::element::undefined, ov::element::dynamic ov::element::boolean, ov::element::undefined, ov::element::dynamic
}; };
for (auto &precision : ovElemTypes) { for (auto &precision : ovElemTypes) {
res.push_back({{ov::PropertyName(ov::hint::inference_precision.name(), ov::hint::inference_precision.mutability), precision}}); res.push_back({{ov::hint::inference_precision(precision)}});
} }
} }
if (props.empty() || std::find(props.begin(), props.end(), ov::hint::model_priority.name()) != props.end()) { if (props.empty() || std::find(props.begin(), props.end(), ov::hint::model_priority.name()) != props.end()) {
ov::hint::Priority priorities[] = {ov::hint::Priority::LOW , ov::hint::Priority::MEDIUM, ov::hint::Priority::HIGH}; ov::hint::Priority priorities[] = {ov::hint::Priority::LOW , ov::hint::Priority::MEDIUM, ov::hint::Priority::HIGH};
for (auto &priority : priorities) { for (auto &priority : priorities) {
res.push_back({{ov::PropertyName(ov::hint::model_priority.name(), ov::hint::model_priority.mutability), priority}}); res.push_back({{ov::hint::model_priority(priority)}});
} }
} }
@ -261,73 +263,69 @@ std::vector<ov::AnyMap> OVPropertiesTestsWithComplieModelProps::getRWMandatoryPr
ov::hint::PerformanceMode performance_modes[] = {ov::hint::PerformanceMode::LATENCY, ov::hint::PerformanceMode performance_modes[] = {ov::hint::PerformanceMode::LATENCY,
ov::hint::PerformanceMode::THROUGHPUT, ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT}; ov::hint::PerformanceMode::THROUGHPUT, ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT};
for (auto &performance_mode : performance_modes) { for (auto &performance_mode : performance_modes) {
res.push_back({{ov::PropertyName(ov::hint::performance_mode.name(), ov::hint::performance_mode.mutability), performance_mode}}); res.push_back({{ov::hint::performance_mode(performance_mode)}});
} }
} }
if (props.empty() || std::find(props.begin(), props.end(), ov::hint::num_requests.name()) != props.end()) { if (props.empty() || std::find(props.begin(), props.end(), ov::hint::num_requests.name()) != props.end()) {
res.push_back({{ov::PropertyName(ov::hint::num_requests.name(), ov::hint::num_requests.mutability), 1}}); res.push_back({{ov::hint::num_requests(1)}});
} }
if (props.empty() || std::find(props.begin(), props.end(), ov::hint::execution_mode.name()) != props.end()) { if (props.empty() || std::find(props.begin(), props.end(), ov::hint::execution_mode.name()) != props.end()) {
ov::hint::ExecutionMode execution_modes[] = {ov::hint::ExecutionMode::PERFORMANCE, ov::hint::ExecutionMode::ACCURACY}; ov::hint::ExecutionMode execution_modes[] = {ov::hint::ExecutionMode::PERFORMANCE, ov::hint::ExecutionMode::ACCURACY};
for (auto &execution_mode : execution_modes) { for (auto &execution_mode : execution_modes) {
res.push_back({{ov::PropertyName(ov::hint::execution_mode.name(), ov::hint::execution_mode.mutability), execution_mode}}); res.push_back({{ov::hint::execution_mode(execution_mode)}});
} }
} }
if (props.empty() || std::find(props.begin(), props.end(), ov::enable_profiling.name()) != props.end()) { if (props.empty() || std::find(props.begin(), props.end(), ov::enable_profiling.name()) != props.end()) {
res.push_back({{ov::PropertyName(ov::enable_profiling.name(), ov::enable_profiling.mutability), true}}); res.push_back({{ov::enable_profiling(true)}});
res.push_back({{ov::PropertyName(ov::enable_profiling.name(), ov::enable_profiling.mutability), false}}); res.push_back({{ov::enable_profiling(false)}});
} }
if (props.empty() || std::find(props.begin(), props.end(), ov::log::level.name()) != props.end()) { 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 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}; ov::log::Level::INFO, ov::log::Level::DEBUG, ov::log::Level::TRACE};
for (auto &log_level : log_levels) { for (auto &log_level : log_levels) {
res.push_back({{ov::PropertyName(ov::log::level.name(), ov::log::level.mutability), log_level}}); res.push_back({ov::log::level(log_level)});
} }
} }
if (props.empty() || std::find(props.begin(), props.end(), ov::enable_mmap.name()) != props.end()) { if (props.empty() || std::find(props.begin(), props.end(), ov::enable_mmap.name()) != props.end()) {
res.push_back({{ov::PropertyName(ov::enable_mmap.name(), ov::enable_mmap.mutability), true}}); res.push_back({ov::enable_mmap(true)});
res.push_back({{ov::PropertyName(ov::enable_mmap.name(), ov::enable_mmap.mutability), false}}); res.push_back({ov::enable_mmap(false)});
} }
if (props.empty() || std::find(props.begin(), props.end(), ov::streams::num.name()) != props.end()) { if (props.empty() || std::find(props.begin(), props.end(), ov::streams::num.name()) != props.end()) {
ov::streams::Num nums[] = {ov::streams::AUTO, ov::streams::NUMA}; res.push_back({ov::streams::num(3)});
for (auto &num : nums) {
res.push_back({{ov::PropertyName(ov::streams::num.name(), ov::streams::num.mutability), num}});
// res.push_back({{ov::PropertyName(ov::num_streams.name(), ov::num_streams.mutability), num}});
}
} }
return res; return res;
} }
std::vector<ov::AnyMap> OVPropertiesTestsWithComplieModelProps::getRWOptionalPropertiesValues(std::vector<std::string> props) { std::vector<ov::AnyMap> OVPropertiesTestsWithCompileModelProps::getRWOptionalPropertiesValues(std::vector<std::string> props) {
std::vector<ov::AnyMap> res; std::vector<ov::AnyMap> res;
if (props.empty() || std::find(props.begin(), props.end(), ov::inference_num_threads.name()) != props.end()) { if (props.empty() || std::find(props.begin(), props.end(), ov::inference_num_threads.name()) != props.end()) {
res.push_back({{ov::PropertyName(ov::inference_num_threads.name(), ov::inference_num_threads.mutability), 1}}); res.push_back({ov::inference_num_threads(1)});
res.push_back({{ov::PropertyName(ov::compilation_num_threads.name(), ov::compilation_num_threads.mutability), 1}}); res.push_back({ov::compilation_num_threads(1)});
} }
if (props.empty() || std::find(props.begin(), props.end(), ov::affinity.name()) != props.end()) { if (props.empty() || std::find(props.begin(), props.end(), ov::affinity.name()) != props.end()) {
ov::Affinity affinities[] = {ov::Affinity::NONE , ov::Affinity::CORE, ov::Affinity::NUMA, ov::Affinity::HYBRID_AWARE}; ov::Affinity affinities[] = {ov::Affinity::NONE , ov::Affinity::CORE, ov::Affinity::NUMA, ov::Affinity::HYBRID_AWARE};
for (auto &affinity : affinities) { for (auto &affinity : affinities) {
res.push_back({{ov::PropertyName(ov::affinity.name(), ov::affinity.mutability), affinity}}); res.push_back({ov::affinity(affinity)});
} }
} }
if (props.empty() || std::find(props.begin(), props.end(), ov::hint::enable_hyper_threading.name()) != props.end()) { if (props.empty() || std::find(props.begin(), props.end(), ov::hint::enable_hyper_threading.name()) != props.end()) {
res.push_back({{ov::PropertyName(ov::hint::enable_hyper_threading.name(), ov::hint::enable_hyper_threading.mutability), true}}); res.push_back({ov::hint::enable_hyper_threading(true)});
res.push_back({{ov::PropertyName(ov::hint::enable_hyper_threading.name(), ov::hint::enable_hyper_threading.mutability), false}}); res.push_back({ov::hint::enable_hyper_threading(false)});
} }
if (props.empty() || std::find(props.begin(), props.end(), ov::hint::enable_cpu_pinning.name()) != props.end()) { if (props.empty() || std::find(props.begin(), props.end(), ov::hint::enable_cpu_pinning.name()) != props.end()) {
res.push_back({{ov::PropertyName(ov::hint::enable_cpu_pinning.name(), ov::hint::enable_cpu_pinning.mutability), true}}); res.push_back({ov::hint::enable_cpu_pinning(true)});
res.push_back({{ov::PropertyName(ov::hint::enable_cpu_pinning.name(), ov::hint::enable_cpu_pinning.mutability), false}}); res.push_back({ov::hint::enable_cpu_pinning(false)});
} }
if (props.empty() || std::find(props.begin(), props.end(), ov::hint::scheduling_core_type.name()) != props.end()) { if (props.empty() || std::find(props.begin(), props.end(), ov::hint::scheduling_core_type.name()) != props.end()) {
@ -335,7 +333,7 @@ std::vector<ov::AnyMap> OVPropertiesTestsWithComplieModelProps::getRWOptionalPro
ov::hint::SchedulingCoreType::PCORE_ONLY, ov::hint::SchedulingCoreType::PCORE_ONLY,
ov::hint::SchedulingCoreType::ECORE_ONLY}; ov::hint::SchedulingCoreType::ECORE_ONLY};
for (auto &schedulingCoreType : schedulingCoreTypes) { for (auto &schedulingCoreType : schedulingCoreTypes) {
res.push_back({{ov::PropertyName(ov::hint::scheduling_core_type.name(), ov::hint::scheduling_core_type.mutability), schedulingCoreType}}); res.push_back({ov::hint::scheduling_core_type(schedulingCoreType)});
} }
} }
@ -356,13 +354,13 @@ TEST_P(OVCheckSetSupportedRWMetricsPropsTests, ChangeCorrectProperties) {
if (property_item.first.is_mutable() && !property_item.second.empty()) { if (property_item.first.is_mutable() && !property_item.second.empty()) {
OV_ASSERT_NO_THROW(core->set_property(target_device, {property_item})); OV_ASSERT_NO_THROW(core->set_property(target_device, {property_item}));
core->compile_model(model, target_device, compileModelProperties); core->compile_model(model, target_device, compileModelProperties);
ov::Any new_property_value; ov::Any actual_property_value;
OV_ASSERT_NO_THROW(new_property_value = core->get_property(target_device, property_item.first)); OV_ASSERT_NO_THROW(actual_property_value = core->get_property(target_device, property_item.first));
if (default_property != property_item.second) { ASSERT_FALSE(actual_property_value.empty());
ASSERT_TRUE(new_property_value == property_item.second) << "Peoperty is not changed";
} else { std::string expect_value = property_item.second.as<std::string>();
ASSERT_TRUE(new_property_value == property_item.second) << "Peoperty is changed in wrong way"; std::string actual_value = actual_property_value.as<std::string>();
} EXPECT_EQ(actual_value, expect_value) << "Peoperty is changed in wrong way";
} }
} }
} }
@ -383,29 +381,34 @@ TEST_P(OVCheckGetSupportedROMetricsPropsTests, ChangeCorrectProperties) {
TEST_P(OVCheckChangePropComplieModleGetPropTests_DEVICE_ID, ChangeCorrectDeviceProperties) { TEST_P(OVCheckChangePropComplieModleGetPropTests_DEVICE_ID, ChangeCorrectDeviceProperties) {
std::vector<ov::PropertyName> supported_properties; std::vector<ov::PropertyName> supported_properties;
OV_ASSERT_NO_THROW(supported_properties = core->get_property(target_device, ov::supported_properties)); OV_ASSERT_NO_THROW(supported_properties = core->get_property(target_device, ov::supported_properties));
std::vector<std::string> availableDevices = core->get_available_devices();
for (int id = 0; id < availableDevices.size(); id++) {
std::string deviceName = availableDevices[id];
auto supported = util::contains(supported_properties, ov::device::id); auto supported = util::contains(supported_properties, ov::device::id);
ASSERT_TRUE(supported) << "property is not supported: " << ov::device::id; ASSERT_TRUE(supported) << "property is not supported: " << ov::device::id;
ov::Any default_property; auto device_ids = core->get_available_devices();
OV_ASSERT_NO_THROW(default_property = core->get_property(target_device, ov::device::id)); for (auto&& device_name_with_id : device_ids) {
ASSERT_FALSE(default_property.empty()); std::string device_name = device_name_with_id;
OV_ASSERT_NO_THROW(core->set_property(target_device, {ov::device::id(id)})); std::string device_id = "";
core->compile_model(model, target_device, compileModelProperties); auto pos = device_name_with_id.find('.');
ov::Any new_property_value; if (pos != std::string::npos) {
OV_ASSERT_NO_THROW(new_property_value = core->get_property(target_device, ov::device::id)); device_name = device_name_with_id.substr(0, pos);
if (default_property != deviceName) { device_id = device_name_with_id.substr(pos + 1, device_name_with_id.size());
ASSERT_TRUE(new_property_value == deviceName) << "Peoperty is not changed"; }
} else {
ASSERT_TRUE(new_property_value == deviceName) << "Peoperty is changed in wrong way"; std::string full_name;
OV_ASSERT_NO_THROW(full_name = core->get_property(device_name, ov::device::full_name, ov::device::id(device_id)));
ASSERT_FALSE(full_name.empty());
if (device_id != "") {
OV_ASSERT_NO_THROW(core->set_property(device_name, {ov::device::id(device_id)}));
core->compile_model(model, device_name, compileModelProperties);
std::string actual_device_id;
OV_ASSERT_NO_THROW(actual_device_id = core->get_property(device_name, ov::device::id));
EXPECT_EQ(device_id, actual_device_id) << "DeviceID is changed, but new value is not correct";
} }
} }
} }
std::vector<ov::AnyMap> OVPropertiesTestsWithComplieModelProps::getModelDependcePropertiesValues() { std::vector<ov::AnyMap> OVPropertiesTestsWithCompileModelProps::getModelDependcePropertiesValues() {
std::vector<ov::AnyMap> res; std::vector<ov::AnyMap> res;
// Read Only // Read Only
res.push_back({{ov::PropertyName(ov::optimal_batch_size.name(), ov::optimal_batch_size.mutability), nullptr}}); res.push_back({{ov::PropertyName(ov::optimal_batch_size.name(), ov::optimal_batch_size.mutability), nullptr}});
@ -428,6 +431,7 @@ TEST_P(OVCheckMetricsPropsTests_ModelDependceProps, ChangeCorrectDevicePropertie
ov::Any default_property; ov::Any default_property;
OV_ASSERT_NO_THROW(default_property = core->get_property(target_device, property_item.first)); OV_ASSERT_NO_THROW(default_property = core->get_property(target_device, property_item.first));
ASSERT_FALSE(default_property.empty());
} }
} }
@ -535,29 +539,6 @@ TEST_P(OVGetMetricPropsTest, GetMetricAndPrintNoThrow_AVAILABLE_DEVICES) {
OV_ASSERT_PROPERTY_SUPPORTED(ov::available_devices); OV_ASSERT_PROPERTY_SUPPORTED(ov::available_devices);
} }
TEST_P(OVGetMetricPropsTest, GetMetricAndPrintNoThrow_FULL_DEVICE_NAME) {
ov::Core ie = createCoreWithTemplate();
std::string t;
OV_ASSERT_NO_THROW(t = ie.get_property(target_device, ov::device::full_name));
std::cout << "Full device name: " << std::endl << t << std::endl;
ASSERT_FALSE(t.empty());
OV_ASSERT_PROPERTY_SUPPORTED(ov::device::full_name);
}
TEST_P(OVGetMetricPropsTest, GetMetricAndPrintNoThrow_DEVICE_ID) {
ov::Core ie = createCoreWithTemplate();
std::string t;
auto device_ids = ie.get_property(target_device, ov::available_devices);
ASSERT_GT(device_ids.size(), 0);
OV_ASSERT_NO_THROW(t = ie.get_property(target_device, ov::device::full_name, ov::device::id(device_ids.front())));
std::cout << "Device " << device_ids.front() << " " << ", Full device name: " << std::endl << t << std::endl;
ASSERT_FALSE(t.empty());
OV_ASSERT_PROPERTY_SUPPORTED(ov::device::full_name);
}
TEST_P(OVGetMetricPropsTest, GetMetricAndPrintNoThrow_OPTIMIZATION_CAPABILITIES) { TEST_P(OVGetMetricPropsTest, GetMetricAndPrintNoThrow_OPTIMIZATION_CAPABILITIES) {
ov::Core ie = createCoreWithTemplate(); ov::Core ie = createCoreWithTemplate();
std::vector<std::string> capabilities; std::vector<std::string> capabilities;