Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into an/fp16_memory
  • Loading branch information
allnes committed Oct 30, 2023
2 parents 0d73f5e + 061d6b5 commit 842383e
Show file tree
Hide file tree
Showing 21 changed files with 93 additions and 224 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,53 @@

#pragma once

#include "api_conformance_helpers.hpp"
#include "conformance.hpp"
#include "common_test_utils/test_constants.hpp"

namespace ov {
namespace test {
namespace conformance {

inline const std::vector<ov::AnyMap> generate_ov_configs(const std::string& target_plugin,
const std::vector<ov::AnyMap>& config = {}) {
std::pair<std::string, ov::Any> default_config;
if (target_plugin == std::string(ov::test::utils::DEVICE_MULTI) ||
target_plugin == std::string(ov::test::utils::DEVICE_AUTO) ||
target_plugin == std::string(ov::test::utils::DEVICE_HETERO)) {
default_config = ov::device::priorities(ov::test::conformance::targetDevice);
} else if (target_plugin == std::string(ov::test::utils::DEVICE_BATCH)) {
default_config = { CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG) , std::string(ov::test::conformance::targetDevice)};
} else {
throw std::runtime_error("Incorrect target device: " + target_plugin);
}

inline const std::vector<ov::AnyMap> generate_ov_configs(const std::vector<ov::AnyMap>& config = {}) {
std::vector<ov::AnyMap> resultConfig;
if (config.empty()) {
return {{default_config}};
}
for (auto configItem : config) {
configItem.insert(default_config);
configItem.insert(ov::test::conformance::pluginConfig.begin(), ov::test::conformance::pluginConfig.end());
resultConfig.push_back(configItem);
}
return resultConfig;
}

inline const std::string get_plugin_lib_name_by_device(const std::string& deviceName) {
const std::map<std::string, std::string> devices{
{ "AUTO", "openvino_auto_plugin" },
{ "HETERO", "openvino_hetero_plugin" },
{ "BATCH", "openvino_auto_batch_plugin" },
{ "MULTI", "openvino_auto_plugin" },
{ "NPU", "openvino_intel_npu_plugin" },
{ "CPU", "openvino_intel_cpu_plugin" },
{ "GNA", "openvino_intel_gna_plugin" },
{ "GPU", "openvino_intel_gpu_plugin" },
{ "TEMPLATE", "openvino_template_plugin" },
{ "NVIDIA", "openvino_nvidia_gpu_plugin" },
};
if (devices.find(deviceName) == devices.end()) {
if (std::string(targetPluginName) != "") {
return targetPluginName;
}
throw std::runtime_error("Incorrect device name");
}
return devices.at(deviceName);
}

inline std::vector<std::pair<std::string, std::string>> generate_ov_pairs_plugin_name_by_device() {
std::vector<std::pair<std::string, std::string>> res;
std::string device(ov::test::conformance::targetDevice);
std::string real_device = device.substr(0, device.find(':'));
res.push_back(std::make_pair(get_plugin_lib_name_by_device(real_device),
real_device));
return res;
}

} // namespace conformance
} // namespace test
} // namespace ov
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ INSTANTIATE_TEST_SUITE_P(ov_compiled_model,
OVCompiledGraphImportExportTest,
::testing::Combine(
::testing::ValuesIn(ovExecGraphInfoElemTypes),
::testing::ValuesIn(return_all_possible_device_combination()),
::testing::Values(targetDevice),
::testing::Values(pluginConfig)),
OVCompiledGraphImportExportTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(
ov_compiled_model, OVClassCompiledModelImportExportTestP,
::testing::ValuesIn(return_all_possible_device_combination()));
::testing::Values(targetDevice));

} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ using namespace ov::test::conformance;

INSTANTIATE_TEST_SUITE_P(ov_compiled_model_mandatory, OVCompiledModelBaseTest,
::testing::Combine(
::testing::ValuesIn(return_all_possible_device_combination()),
::testing::Values(targetDevice),
::testing::Values(pluginConfig)),
OVCompiledModelBaseTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(ov_compiled_model, OVCompiledModelBaseTestOptional,
::testing::Combine(
::testing::ValuesIn(return_all_possible_device_combination()),
::testing::Values(targetDevice),
::testing::Values(pluginConfig)),
OVCompiledModelBaseTestOptional::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ using namespace ov::test::conformance;

INSTANTIATE_TEST_SUITE_P(
ov_compiled_model_mandatory, OVClassCompiledModelGetPropertyTest,
::testing::ValuesIn(return_all_possible_device_combination()));
::testing::Values(targetDevice));

//
// Executable Network GetConfig / SetConfig
//

INSTANTIATE_TEST_SUITE_P(
ov_compiled_model_mandatory, OVClassCompiledModelGetIncorrectPropertyTest,
::testing::ValuesIn(return_all_possible_device_combination()));
::testing::Values(targetDevice));

INSTANTIATE_TEST_SUITE_P(
ov_compiled_model_mandatory, OVClassCompiledModelGetConfigTest,
::testing::ValuesIn(return_all_possible_device_combination()));
::testing::Values(targetDevice));

INSTANTIATE_TEST_SUITE_P(
ov_compiled_model, OVClassCompiledModelSetIncorrectConfigTest,
::testing::ValuesIn(return_all_possible_device_combination()));
::testing::Values(targetDevice));


} // namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,55 +15,35 @@ const std::vector<ov::AnyMap> inproperties = {
{ov::device::id("UNSUPPORTED_DEVICE_ID_STRING")},
};

const std::vector<ov::AnyMap> auto_batch_inproperties = {};

INSTANTIATE_TEST_SUITE_P(ov_compiled_model_mandatory, OVClassCompiledModelPropertiesIncorrectTests,
::testing::Combine(
::testing::ValuesIn(ov::test::conformance::return_all_possible_device_combination()),
::testing::ValuesIn(inproperties)),
::testing::Values(targetDevice),
::testing::ValuesIn(generate_ov_configs(inproperties))),
OVClassCompiledModelPropertiesIncorrectTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(ov_compiled_model_AutoBatch, OVClassCompiledModelPropertiesIncorrectTests,
::testing::Combine(
::testing::Values(ov::test::utils::DEVICE_BATCH),
::testing::ValuesIn(generate_ov_configs(ov::test::utils::DEVICE_BATCH, auto_batch_inproperties))),
OVClassCompiledModelPropertiesIncorrectTests::getTestCaseName);


const std::vector<ov::AnyMap> default_properties = {
{ov::enable_profiling(false)}
};

INSTANTIATE_TEST_SUITE_P(ov_compiled_model_mandatory, OVClassCompiledModelPropertiesDefaultTests,
::testing::Combine(
::testing::ValuesIn(return_all_possible_device_combination()),
::testing::Values(targetDevice),
::testing::ValuesIn(default_properties)),
OVClassCompiledModelPropertiesDefaultTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(ov_compiled_model_mandatory, OVCompiledModelPropertiesDefaultSupportedTests,
::testing::ValuesIn(return_all_possible_device_combination()),
::testing::Values(targetDevice),
OVCompiledModelPropertiesDefaultSupportedTests::getTestCaseName);

const std::vector<ov::AnyMap> auto_batch_properties = {
{{CONFIG_KEY(AUTO_BATCH_TIMEOUT) , "1"}},
{{ov::auto_batch_timeout(10)}},
};

INSTANTIATE_TEST_SUITE_P(ov_compiled_model_mandatory, OVClassCompiledModelPropertiesTests,
::testing::Combine(
::testing::ValuesIn(ov::test::conformance::return_all_possible_device_combination()),
::testing::Values(targetDevice),
::testing::ValuesIn(default_properties)),
OVClassCompiledModelPropertiesTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(ov_compiled_model_AutoBatch, OVClassCompiledModelPropertiesTests,
::testing::Combine(
::testing::Values(ov::test::utils::DEVICE_BATCH),
::testing::ValuesIn(ov::test::conformance::generate_ov_configs(ov::test::utils::DEVICE_BATCH, auto_batch_properties))),
OVClassCompiledModelPropertiesTests::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(
ov_compiled_model, OVClassCompiledModelEmptyPropertiesTests,
::testing::ValuesIn(ov::test::conformance::return_all_possible_device_combination()));
::testing::Values(targetDevice));

// IE Class Load network

Expand All @@ -78,7 +58,7 @@ const std::vector<ov::AnyMap> multiModelPriorityConfigs = {

INSTANTIATE_TEST_SUITE_P(ov_compiled_model_mandatory,
OVClassCompiledModelGetPropertyTest_MODEL_PRIORITY,
::testing::Combine(::testing::ValuesIn(return_all_possible_device_combination()),
::testing::Combine(::testing::Values(targetDevice),
::testing::ValuesIn(multiModelPriorityConfigs)));

} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using namespace ov::test::conformance;

INSTANTIATE_TEST_SUITE_P(ov_infer_request_mandatory, OVInferRequestCallbackTests,
::testing::Combine(
::testing::ValuesIn(return_all_possible_device_combination()),
::testing::Values(targetDevice),
::testing::Values(pluginConfig)),
OVInferRequestCallbackTests::getTestCaseName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using namespace ov::test::conformance;

INSTANTIATE_TEST_SUITE_P(ov_infer_request_mandatory, OVInferRequestCancellationTests,
::testing::Combine(
::testing::ValuesIn(return_all_possible_device_combination()),
::testing::Values(targetDevice),
::testing::Values(pluginConfig)),
OVInferRequestCancellationTests::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ INSTANTIATE_TEST_SUITE_P(ov_infer_request_1, OVInferRequestDynamicTests,
::testing::Values(std::vector<std::pair<std::vector<size_t>, std::vector<size_t>>>{
{{1, 4, 20, 20}, {1, 4, 20, 20}},
{{2, 4, 20, 20}, {2, 4, 20, 20}}}),
::testing::ValuesIn(return_all_possible_device_combination()),
::testing::Values(targetDevice),
::testing::Values(pluginConfig)),
OVInferRequestDynamicTests::getTestCaseName);

Expand All @@ -70,7 +70,7 @@ INSTANTIATE_TEST_SUITE_P(ov_infer_request_2, OVInferRequestDynamicTests,
::testing::Values(std::vector<std::pair<std::vector<size_t>, std::vector<size_t>>>{
{{1, 4, 20, 20}, {1, 2, 20, 40}},
{{2, 4, 20, 20}, {2, 2, 20, 40}}}),
::testing::ValuesIn(return_all_possible_device_combination()),
::testing::Values(targetDevice),
::testing::Values(pluginConfig)),
OVInferRequestDynamicTests::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ using namespace ov::test::conformance;

INSTANTIATE_TEST_SUITE_P(ov_infer_request_mandatory, OVInferenceChainingStatic,
::testing::Combine(
::testing::ValuesIn(return_all_possible_device_combination()),
::testing::Values(targetDevice),
::testing::Values(pluginConfig)),
OVInferenceChaining::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(ov_infer_request, OVInferenceChaining,
::testing::Combine(
::testing::ValuesIn(return_all_possible_device_combination()),
::testing::Values(targetDevice),
::testing::Values(pluginConfig)),
OVInferenceChaining::getTestCaseName);
} // namespace
Loading

0 comments on commit 842383e

Please sign in to comment.