From 40ffca6fa2a949ce085bb1abaf677076520c4437 Mon Sep 17 00:00:00 2001 From: Shoujiang Ma Date: Thu, 13 May 2021 22:04:38 +0800 Subject: [PATCH] [Auto Plugin] Auto plugin component in IE (#5366) * Implement AUTO plugin Usage: 1. -d AUTO 2. -d "" Signed-off-by: Shoujiang Ma * Add tests for AUTO plugin Signed-off-by: Shoujiang Ma * cleaned impl, that was incorrect from the async perspective, ansl also capturing the blobs in the constructor * Revert benchmark_app modification Signed-off-by: Shoujiang Ma * Address reviewer's comments: need CI tests to verify Signed-off-by: Shoujiang Ma Co-authored-by: myshevts --- inference-engine/src/CMakeLists.txt | 2 + .../src/auto_plugin/CMakeLists.txt | 19 ++ .../src/auto_plugin/auto_exec_network.cpp | 59 ++++++ .../src/auto_plugin/auto_exec_network.hpp | 51 +++++ .../src/auto_plugin/auto_infer_request.cpp | 39 ++++ .../src/auto_plugin/auto_infer_request.hpp | 40 ++++ .../src/auto_plugin/auto_plugin.cpp | 199 ++++++++++++++++++ .../src/auto_plugin/auto_plugin.hpp | 37 ++++ .../src/inference_engine/ie_core.cpp | 42 +++- .../behavior/config.cpp | 33 ++- .../behavior/core_integration.cpp | 22 +- .../behavior/core_threading_tests.cpp | 1 + .../behavior/exec_graph_info.cpp | 10 + .../behavior/infer_request.cpp | 10 + .../behavior/infer_request_callback.cpp | 11 + .../behavior/infer_request_config.cpp | 18 ++ .../behavior/infer_request_input.cpp | 11 + .../behavior/infer_request_output.cpp | 11 + .../behavior/perf_counters.cpp | 11 + .../behavior/set_preprocess.cpp | 25 +++ .../behavior/test_plugin.cpp | 25 +++ .../plugin/shared/include/behavior/config.hpp | 3 +- .../include/behavior/exec_graph_info.hpp | 5 +- .../shared/include/behavior/infer_request.hpp | 2 +- .../common_test_utils/test_constants.hpp | 1 + 25 files changed, 670 insertions(+), 17 deletions(-) create mode 100644 inference-engine/src/auto_plugin/CMakeLists.txt create mode 100644 inference-engine/src/auto_plugin/auto_exec_network.cpp create mode 100644 inference-engine/src/auto_plugin/auto_exec_network.hpp create mode 100644 inference-engine/src/auto_plugin/auto_infer_request.cpp create mode 100644 inference-engine/src/auto_plugin/auto_infer_request.hpp create mode 100644 inference-engine/src/auto_plugin/auto_plugin.cpp create mode 100644 inference-engine/src/auto_plugin/auto_plugin.hpp diff --git a/inference-engine/src/CMakeLists.txt b/inference-engine/src/CMakeLists.txt index 086c06fc167..cd78cd959ec 100644 --- a/inference-engine/src/CMakeLists.txt +++ b/inference-engine/src/CMakeLists.txt @@ -30,6 +30,8 @@ endif() add_subdirectory(hetero_plugin) +add_subdirectory(auto_plugin) + add_subdirectory(multi_device) add_subdirectory(transformations) diff --git a/inference-engine/src/auto_plugin/CMakeLists.txt b/inference-engine/src/auto_plugin/CMakeLists.txt new file mode 100644 index 00000000000..8556d8940ed --- /dev/null +++ b/inference-engine/src/auto_plugin/CMakeLists.txt @@ -0,0 +1,19 @@ +# Copyright (C) 2018-2021 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +set (TARGET_NAME "AutoPlugin") + +file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) + +ie_add_plugin(NAME ${TARGET_NAME} + DEVICE_NAME "AUTO" + SOURCES ${SOURCES} ${HEADERS} + VERSION_DEFINES_FOR auto_plugin.cpp) + +target_link_libraries(${TARGET_NAME} PRIVATE inference_engine) + +ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME}) + +set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO}) diff --git a/inference-engine/src/auto_plugin/auto_exec_network.cpp b/inference-engine/src/auto_plugin/auto_exec_network.cpp new file mode 100644 index 00000000000..0d691214835 --- /dev/null +++ b/inference-engine/src/auto_plugin/auto_exec_network.cpp @@ -0,0 +1,59 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include +#include +#include +#include +#include + +#include "ie_metric_helpers.hpp" +#include "auto_exec_network.hpp" +#include "auto_infer_request.hpp" + +namespace AutoPlugin { + using namespace InferenceEngine; + +AutoExecutableNetwork::AutoExecutableNetwork(const ExecutableNetwork& network, + const DeviceInformation& deviceInfo, + const bool needPerfCounters) : + _deviceInfo(deviceInfo), + _network(network), + _config(deviceInfo.config.begin(), deviceInfo.config.end()), + _needPerfCounters(needPerfCounters) { +} + +AutoExecutableNetwork::~AutoExecutableNetwork() = default; + +IInferRequestInternal::Ptr AutoExecutableNetwork::CreateInferRequestImpl(InputsDataMap networkInputs, + OutputsDataMap networkOutputs) { + auto inferRequest = _network.CreateInferRequest(); + return std::make_shared(networkInputs, networkOutputs, inferRequest); +} + +void AutoExecutableNetwork::Export(std::ostream& networkModel) { + _network.Export(networkModel); +} + +RemoteContext::Ptr AutoExecutableNetwork::GetContext() const { + return _network.GetContext(); +} + +InferenceEngine::CNNNetwork AutoExecutableNetwork::GetExecGraphInfo() { + return _network.GetExecGraphInfo(); +} + +Parameter AutoExecutableNetwork::GetMetric(const std::string &name) const { + return _network.GetMetric(name); +} + +void AutoExecutableNetwork::SetConfig(const std::map& config) { + _network.SetConfig(config); +} + +Parameter AutoExecutableNetwork::GetConfig(const std::string& name) const { + return _network.GetConfig(name); +} + +} // namespace AutoPlugin diff --git a/inference-engine/src/auto_plugin/auto_exec_network.hpp b/inference-engine/src/auto_plugin/auto_exec_network.hpp new file mode 100644 index 00000000000..635d9573b9d --- /dev/null +++ b/inference-engine/src/auto_plugin/auto_exec_network.hpp @@ -0,0 +1,51 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace AutoPlugin { + +using DeviceName = std::string; + +struct DeviceInformation { + DeviceName deviceName; + std::map config; +}; + +class AutoExecutableNetwork : public InferenceEngine::ExecutableNetworkThreadSafeDefault { +public: + using Ptr = std::shared_ptr; + + AutoExecutableNetwork(const InferenceEngine::ExecutableNetwork& network, + const DeviceInformation& deviceInfo, + const bool needPerfCounters = false); + + void Export(std::ostream& networkModel) override; + InferenceEngine::RemoteContext::Ptr GetContext() const override; + InferenceEngine::CNNNetwork GetExecGraphInfo() override; + InferenceEngine::Parameter GetMetric(const std::string &name) const override; + void SetConfig(const std::map& config) override; + InferenceEngine::Parameter GetConfig(const std::string& name) const override; + InferenceEngine::IInferRequestInternal::Ptr CreateInferRequestImpl(InferenceEngine::InputsDataMap networkInputs, + InferenceEngine::OutputsDataMap networkOutputs) override; + ~AutoExecutableNetwork() override; + + DeviceInformation _deviceInfo; + InferenceEngine::ExecutableNetwork _network; + std::unordered_map _config; + bool _needPerfCounters = false; +}; + +} // namespace AutoPlugin diff --git a/inference-engine/src/auto_plugin/auto_infer_request.cpp b/inference-engine/src/auto_plugin/auto_infer_request.cpp new file mode 100644 index 00000000000..0adc4ba0938 --- /dev/null +++ b/inference-engine/src/auto_plugin/auto_infer_request.cpp @@ -0,0 +1,39 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "auto_infer_request.hpp" +#include +#include + +namespace AutoPlugin { + using namespace InferenceEngine; + +AutoInferRequest::AutoInferRequest(const InputsDataMap& networkInputs, + const OutputsDataMap& networkOutputs, + const InferRequest& inferRequest) + : IInferRequestInternal(networkInputs, networkOutputs) + , _inferRequest(inferRequest) { +} + +std::map AutoInferRequest::GetPerformanceCounts() const { + return _inferRequest.GetPerformanceCounts(); +} + +void AutoInferRequest::InferImpl() { + _inferRequest.Infer(); +} + +void AutoInferRequest::SetBlob(const std::string& name, const InferenceEngine::Blob::Ptr& data) { + _inferRequest.SetBlob(name, data); +} + +Blob::Ptr AutoInferRequest::GetBlob(const std::string& name) { + return _inferRequest.GetBlob(name); +} + +void AutoInferRequest::Cancel() { + _inferRequest.Cancel(); +} + +} // namespace AutoPlugin diff --git a/inference-engine/src/auto_plugin/auto_infer_request.hpp b/inference-engine/src/auto_plugin/auto_infer_request.hpp new file mode 100644 index 00000000000..49da8a117e1 --- /dev/null +++ b/inference-engine/src/auto_plugin/auto_infer_request.hpp @@ -0,0 +1,40 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace AutoPlugin { + +class AutoInferRequest : public InferenceEngine::IInferRequestInternal { +public: + using Ptr = std::shared_ptr; + explicit AutoInferRequest(const InferenceEngine::InputsDataMap& networkInputs, + const InferenceEngine::OutputsDataMap& networkOutputs, + const InferenceEngine::InferRequest& inferRequest); + std::map GetPerformanceCounts() const override; + void InferImpl() override; + void SetBlob(const std::string& name, const InferenceEngine::Blob::Ptr& data) override; + InferenceEngine::Blob::Ptr GetBlob(const std::string& name) override; + void Cancel() override; + +private: + InferenceEngine::InferRequest _inferRequest; +}; + +} // namespace AutoPlugin diff --git a/inference-engine/src/auto_plugin/auto_plugin.cpp b/inference-engine/src/auto_plugin/auto_plugin.cpp new file mode 100644 index 00000000000..692d8955a09 --- /dev/null +++ b/inference-engine/src/auto_plugin/auto_plugin.cpp @@ -0,0 +1,199 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "auto_plugin.hpp" + +namespace AutoPlugin { +namespace { + ConfigType mergeConfigs(ConfigType config, const ConfigType& local) { + for (auto && kvp : local) { + config[kvp.first] = kvp.second; + } + return config; + } + + DeviceInformation SelectDevice(const std::vector& metaDevices) { + for (auto& item : metaDevices) { + if (item.deviceName.find("CPU") == 0) { + return item; + } + } + IE_THROW(NotFound) << "No available device could be used"; + } +} // namespace + +AutoInferencePlugin::AutoInferencePlugin() { + _pluginName = "AUTO"; +} + +IE::ExecutableNetworkInternal::Ptr AutoInferencePlugin::LoadExeNetworkImpl(const IE::CNNNetwork& network, + const ConfigType& config) { + if (GetCore() == nullptr) { + IE_THROW() << "Please, work with AUTO device via InferencEngine::Core object"; + } + + if (network.getFunction() == nullptr) { + IE_THROW() << "AUTO device supports just ngraph network representation"; + } + + auto fullConfig = mergeConfigs(_config, config); + auto metaDevices = GetDeviceChoice(fullConfig); + + // FIXME: always select CPU device now + DeviceInformation selectedDevice = SelectDevice(metaDevices); + IE::ExecutableNetwork executableNetwork; + try { + executableNetwork = GetCore()->LoadNetwork(network, selectedDevice.deviceName, selectedDevice.config); + } catch(const IE::Exception &iie) { + IE_THROW() << "Failed to load network to device named " << selectedDevice.deviceName + << " with exception " << iie.what(); + } + + bool enablePerfCounters = false; + try { + enablePerfCounters = + executableNetwork.GetConfig(IE::PluginConfigParams::KEY_PERF_COUNT).as() == + IE::PluginConfigParams::YES; + } catch (...) { + } + + return std::make_shared(executableNetwork, + selectedDevice, + enablePerfCounters); +} + +IE::QueryNetworkResult AutoInferencePlugin::QueryNetwork(const IE::CNNNetwork& network, const ConfigType& config) const { + IE::QueryNetworkResult queryResult = {}; + if (GetCore() == nullptr) { + IE_THROW() << "Please, work with AUTO device via InferencEngine::Core object"; + } + + if (network.getFunction() == nullptr) { + IE_THROW() << "AUTO device supports just ngraph network representation"; + } + + auto fullConfig = mergeConfigs(_config, config); + auto metaDevices = GetDeviceChoice(fullConfig); + std::unordered_set supportedLayers; + for (auto&& value : metaDevices) { + try { + auto deviceQr = GetCore()->QueryNetwork(network, value.deviceName, value.config); + std::unordered_set deviceSupportedLayers; + for (auto &&layerQr : deviceQr.supportedLayersMap) { + deviceSupportedLayers.emplace(layerQr.first); + } + supportedLayers = supportedLayers.empty() + ? deviceSupportedLayers : (deviceSupportedLayers.empty() + ? supportedLayers : IE::details::Intersection( + supportedLayers, deviceSupportedLayers)); + break; + } catch (...) { + } + } + + for (auto&& supportedLayer : supportedLayers) { + queryResult.supportedLayersMap[supportedLayer] = GetName(); + } + return queryResult; +} + +IE::Parameter AutoInferencePlugin::GetConfig(const std::string& name, + const std::map & options) const { + auto it = _config.find(name); + if (it == _config.end()) { + IE_THROW() << "Unsupported config key: " << name; + } else { + return { it->second }; + } +} + +void AutoInferencePlugin::SetConfig(const ConfigType& config) { + for (auto && kvp : config) { + _config[kvp.first] = kvp.second; + } +} + +IE::Parameter AutoInferencePlugin::GetMetric(const std::string& name, + const std::map & options) const { + if (name == METRIC_KEY(SUPPORTED_METRICS)) { + std::vector metrics; + metrics.emplace_back(METRIC_KEY(SUPPORTED_METRICS)); + metrics.emplace_back(METRIC_KEY(FULL_DEVICE_NAME)); + metrics.emplace_back(METRIC_KEY(SUPPORTED_CONFIG_KEYS)); + metrics.emplace_back(METRIC_KEY(OPTIMIZATION_CAPABILITIES)); + IE_SET_METRIC_RETURN(SUPPORTED_METRICS, metrics); + } else if (name == METRIC_KEY(FULL_DEVICE_NAME)) { + std::string device_name = {"Inference Engine AUTO device"}; + IE_SET_METRIC_RETURN(FULL_DEVICE_NAME, device_name); + } else if (name == METRIC_KEY(SUPPORTED_CONFIG_KEYS)) { + std::vector configKeys; + IE_SET_METRIC_RETURN(SUPPORTED_CONFIG_KEYS, configKeys); + } else if (name == METRIC_KEY(OPTIMIZATION_CAPABILITIES)) { + std::vector capabilities = { "" }; + IE_SET_METRIC_RETURN(OPTIMIZATION_CAPABILITIES, capabilities); + } else { + IE_THROW() << "Unsupported metric key " << name; + } +} + +std::vector AutoInferencePlugin::GetDeviceChoice(const ConfigType& config) const { + std::vector metaDevices; + std::vector availableDevices = GetCore()->GetAvailableDevices(); + + auto getDeviceConfig = [&] (const DeviceName & deviceWithID) { + IE::DeviceIDParser deviceParser(deviceWithID); + std::string deviceName = deviceParser.getDeviceName(); + ConfigType tconfig = mergeConfigs(_config, config); + + // set device ID if any + std::string deviceIDLocal = deviceParser.getDeviceID(); + if (!deviceIDLocal.empty()) { + tconfig[IE::PluginConfigParams::KEY_DEVICE_ID] = deviceIDLocal; + } + + return GetSupportedConfig(tconfig, deviceName); + }; + + for (auto && d : availableDevices) { + if (d != _pluginName) { + metaDevices.push_back({ d, getDeviceConfig(d)}); + } + } + + if (metaDevices.empty()) { + IE_THROW() << "Please, check environment due to no supported devices can be used"; + } + + return metaDevices; +} + +//////////////////////////////////// private & protected functions /////////////////// +ConfigType AutoInferencePlugin::GetSupportedConfig(const ConfigType& config, + const std::string& deviceName) const { + std::vector supportedConfigKeys = GetCore()->GetMetric(deviceName, METRIC_KEY(SUPPORTED_CONFIG_KEYS)); + ConfigType supportedConfig; + for (auto&& key : supportedConfigKeys) { + auto itKey = config.find(key); + if (config.end() != itKey) { + supportedConfig[key] = itKey->second; + } + } + return supportedConfig; +} + +// define CreatePluginEngine to create plugin instance +static const IE::Version version = {{2, 1}, CI_BUILD_NUMBER, "AutoPlugin"}; +IE_DEFINE_PLUGIN_CREATE_FUNCTION(AutoInferencePlugin, version) +} // namespace AutoPlugin diff --git a/inference-engine/src/auto_plugin/auto_plugin.hpp b/inference-engine/src/auto_plugin/auto_plugin.hpp new file mode 100644 index 00000000000..a2a885d4f1f --- /dev/null +++ b/inference-engine/src/auto_plugin/auto_plugin.hpp @@ -0,0 +1,37 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include +#include +#include + +#include +#include +#include "auto_exec_network.hpp" + +namespace AutoPlugin { +namespace IE = InferenceEngine; +using ConfigType = std::map; + +class AutoInferencePlugin : public IE::InferencePluginInternal { +public: + AutoInferencePlugin(); + ~AutoInferencePlugin() = default; + IE::ExecutableNetworkInternal::Ptr LoadExeNetworkImpl(const IE::CNNNetwork& network, const ConfigType& config) override; + IE::QueryNetworkResult QueryNetwork(const IE::CNNNetwork& network, const ConfigType& config) const override; + IE::Parameter GetMetric(const std::string& name, const std::map& options) const override; + IE::Parameter GetConfig(const std::string& name, const std::map & options) const override; + void SetConfig(const ConfigType& config) override; + +private: + std::vector GetDeviceChoice(const ConfigType& config) const; + +protected: + ConfigType GetSupportedConfig(const ConfigType& config, const AutoPlugin::DeviceName & deviceName) const; +}; + +} // namespace AutoPlugin diff --git a/inference-engine/src/inference_engine/ie_core.cpp b/inference-engine/src/inference_engine/ie_core.cpp index 14cd4d9a40e..8d9a6bb475c 100644 --- a/inference-engine/src/inference_engine/ie_core.cpp +++ b/inference-engine/src/inference_engine/ie_core.cpp @@ -51,6 +51,9 @@ Parsed parseDeviceNameIntoConfig(const std::string& deviceName, const std::ma deviceName_ = "MULTI"; config_[InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES] = deviceName.substr(6); } else { + if (deviceName_.empty()) { + deviceName_ = "AUTO"; + } DeviceIDParser parser(deviceName_); deviceName_ = parser.getDeviceName(); std::string deviceIDLocal = parser.getDeviceID(); @@ -583,6 +586,15 @@ public: } } + // AUTO case + { + if (deviceName.find("AUTO:") == 0) { + IE_THROW() + << "You can get specific metrics with the GetMetric only for the AUTO itself (without devices). " + "To get individual devices's metrics call GetMetric for each device separately"; + } + } + auto parsed = parseDeviceNameIntoConfig(deviceName); // we need to return a copy of Parameter object which is created on Core side, @@ -753,7 +765,7 @@ public: * @brief Sets config values for a plugin or set of plugins * @param deviceName A device name to set config to * If empty, config is set for all the plugins / plugin's meta-data - * @note `deviceName` is not allowed in form of MULTI:CPU, HETERO:FPGA,CPU + * @note `deviceName` is not allowed in form of MULTI:CPU, HETERO:FPGA,CPU, AUTO:CPU * just simple forms like CPU, GPU, MULTU, GPU.0, etc */ void SetConfigForPlugins(const std::map& configMap, const std::string& deviceName) { @@ -909,6 +921,10 @@ RemoteContext::Ptr Core::CreateContext(const std::string& deviceName, const Para if (deviceName.find("MULTI") == 0) { IE_THROW() << "MULTI device does not support remote context"; } + if (deviceName.find("AUTO") == 0) { + IE_THROW() << "AUTO device does not support remote context"; + } + auto parsed = parseDeviceNameIntoConfig(deviceName, params); return _impl->GetCPPPluginByName(parsed._deviceName).CreateContext(parsed._config); @@ -921,6 +937,9 @@ RemoteContext::Ptr Core::GetDefaultContext(const std::string& deviceName) { if (deviceName.find("MULTI") == 0) { IE_THROW() << "MULTI device does not support remote context"; } + if (deviceName.find("AUTO") == 0) { + IE_THROW() << "AUTO device does not support remote context"; + } auto parsed = parseDeviceNameIntoConfig(deviceName, ParamMap()); return _impl->GetCPPPluginByName(parsed._deviceName).GetDefaultContext(parsed._config); @@ -935,6 +954,10 @@ void Core::AddExtension(IExtensionPtr extension, const std::string& deviceName_) IE_THROW() << "MULTI device does not support extensions. Please, set extensions directly to fallback devices"; } + if (deviceName_.find("AUTO") == 0) { + IE_THROW() + << "AUTO device does not support extensions. Please, set extensions directly to fallback devices"; + } _impl->AddExtension(extension); } @@ -954,6 +977,9 @@ ExecutableNetwork Core::ImportNetwork(const std::string& modelFileName, const st if (deviceName.find("MULTI") == 0) { IE_THROW() << "MULTI device does not support ImportNetwork"; } + if (deviceName.find("AUTO") == 0) { + IE_THROW() << "AUTO device does not support ImportNetwork"; + } auto parsed = parseDeviceNameIntoConfig(deviceName, config); return _impl->GetCPPPluginByName(parsed._deviceName).ImportNetwork(modelFileName, parsed._config); @@ -999,6 +1025,12 @@ void Core::SetConfig(const std::map& config, const std "You can configure the devices with SetConfig before creating the MULTI on top."; } + // AUTO case + if (deviceName.find("AUTO:") == 0) { + IE_THROW() << "SetConfig is supported only for AUTO itself (without devices). " + "You can configure the devices with SetConfig before creating the AUTO on top."; + } + // GPU.0, FPGA.1 cases if (deviceName.find(".") != std::string::npos) { IE_THROW() << "SetConfig is supported only for device family itself (without particular device .#). " @@ -1030,6 +1062,14 @@ Parameter Core::GetConfig(const std::string& deviceName, const std::string& name "GetConfig is also possible for the individual devices before creating the MULTI on top."; } } + // AUTO case + { + if (deviceName.find("AUTO:") == 0) { + IE_THROW() + << "You can only GetConfig of the AUTO itself (without devices). " + "GetConfig is also possible for the individual devices before creating the AUTO on top."; + } + } auto parsed = parseDeviceNameIntoConfig(deviceName); diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/config.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/config.cpp index e2a09cc6e80..00081645107 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/config.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/config.cpp @@ -42,6 +42,10 @@ namespace { {InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_LIMIT, "10"}} }; + const std::vector> AutoConfigs = { + {} + }; + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, CorrectConfigTests, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -56,6 +60,13 @@ namespace { ::testing::ValuesIn(MultiConfigs)), CorrectConfigTests::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, CorrectConfigTests, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(AutoConfigs)), + CorrectConfigTests::getTestCaseName); + const std::vector> inconfigs = { {{InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, "OFF"}}, {{InferenceEngine::PluginConfigParams::KEY_CPU_BIND_THREAD, "OFF"}}, @@ -75,7 +86,6 @@ namespace { {{InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_CPU}} }; - INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, CorrectConfigAPITests, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -90,6 +100,13 @@ namespace { ::testing::ValuesIn(multiconf)), CorrectConfigAPITests::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, CorrectConfigAPITests, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(AutoConfigs)), + CorrectConfigAPITests::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, IncorrectConfigTests, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -104,6 +121,13 @@ namespace { ::testing::ValuesIn(multiinconfigs)), IncorrectConfigTests::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, IncorrectConfigTests, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(inconfigs)), + IncorrectConfigTests::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, IncorrectConfigAPITests, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -118,4 +142,11 @@ namespace { ::testing::ValuesIn(multiinconfigs)), IncorrectConfigAPITests::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, IncorrectConfigAPITests, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(inconfigs)), + IncorrectConfigAPITests::getTestCaseName); + } // namespace \ No newline at end of file diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/core_integration.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/core_integration.cpp index 79ff8fe40e8..cbab53c64a2 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/core_integration.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/core_integration.cpp @@ -31,11 +31,11 @@ INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P( smoke_IEClassGetMetricTest, IEClassGetMetricTest_SUPPORTED_CONFIG_KEYS, - ::testing::Values("CPU", "MULTI", "HETERO")); + ::testing::Values("CPU", "MULTI", "HETERO", "AUTO")); INSTANTIATE_TEST_CASE_P( smoke_IEClassGetMetricTest, IEClassGetMetricTest_SUPPORTED_METRICS, - ::testing::Values("CPU", "MULTI", "HETERO")); + ::testing::Values("CPU", "MULTI", "HETERO", "AUTO")); INSTANTIATE_TEST_CASE_P( smoke_IEClassGetMetricTest, IEClassGetMetricTest_AVAILABLE_DEVICES, @@ -43,11 +43,11 @@ INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P( smoke_IEClassGetMetricTest, IEClassGetMetricTest_FULL_DEVICE_NAME, - ::testing::Values("CPU", "MULTI", "HETERO")); + ::testing::Values("CPU", "MULTI", "HETERO", "AUTO")); INSTANTIATE_TEST_CASE_P( smoke_IEClassGetMetricTest, IEClassGetMetricTest_OPTIMIZATION_CAPABILITIES, - ::testing::Values("CPU")); + ::testing::Values("CPU", "AUTO")); INSTANTIATE_TEST_CASE_P( smoke_IEClassGetMetricTest, IEClassGetMetricTest_RANGE_FOR_ASYNC_INFER_REQUESTS, @@ -59,11 +59,11 @@ INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P( smoke_IEClassGetMetricTest, IEClassGetMetricTest_ThrowUnsupported, - ::testing::Values("CPU", "MULTI", "HETERO")); + ::testing::Values("CPU", "MULTI", "HETERO", "AUTO")); INSTANTIATE_TEST_CASE_P( smoke_IEClassGetConfigTest, IEClassGetConfigTest_ThrowUnsupported, - ::testing::Values("CPU", "MULTI", "HETERO")); + ::testing::Values("CPU", "MULTI", "HETERO", "AUTO")); INSTANTIATE_TEST_CASE_P( smoke_IEClassGetAvailableDevices, IEClassGetAvailableDevices, @@ -83,23 +83,23 @@ INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P( smoke_IEClassExecutableNetworkGetMetricTest, IEClassExecutableNetworkGetMetricTest_SUPPORTED_CONFIG_KEYS, - ::testing::Values("CPU", "MULTI:CPU", "HETERO:CPU")); + ::testing::Values("CPU", "MULTI:CPU", "HETERO:CPU", "AUTO")); INSTANTIATE_TEST_CASE_P( smoke_IEClassExecutableNetworkGetMetricTest, IEClassExecutableNetworkGetMetricTest_SUPPORTED_METRICS, - ::testing::Values("CPU", "MULTI:CPU", "HETERO:CPU")); + ::testing::Values("CPU", "MULTI:CPU", "HETERO:CPU", "AUTO")); INSTANTIATE_TEST_CASE_P( smoke_IEClassExecutableNetworkGetMetricTest, IEClassExecutableNetworkGetMetricTest_NETWORK_NAME, - ::testing::Values("CPU", "MULTI:CPU", "HETERO:CPU")); + ::testing::Values("CPU", "MULTI:CPU", "HETERO:CPU", "AUTO")); INSTANTIATE_TEST_CASE_P( smoke_IEClassExecutableNetworkGetMetricTest, IEClassExecutableNetworkGetMetricTest_OPTIMAL_NUMBER_OF_INFER_REQUESTS, - ::testing::Values("CPU", "MULTI:CPU", "HETERO:CPU")); + ::testing::Values("CPU", "MULTI:CPU", "HETERO:CPU", "AUTO")); INSTANTIATE_TEST_CASE_P( smoke_IEClassExecutableNetworkGetMetricTest, IEClassExecutableNetworkGetMetricTest_ThrowsUnsupported, - ::testing::Values("CPU", "MULTI:CPU", "HETERO:CPU")); + ::testing::Values("CPU", "MULTI:CPU", "HETERO:CPU", "AUTO")); // // Executable Network GetConfig / SetConfig diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/core_threading_tests.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/core_threading_tests.cpp index 3802907904d..09806c12e16 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/core_threading_tests.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/core_threading_tests.cpp @@ -10,6 +10,7 @@ const Params params[] = { std::tuple{ CommonTestUtils::DEVICE_CPU, {{ CONFIG_KEY(PERF_COUNT), CONFIG_VALUE(YES) }}}, std::tuple{ CommonTestUtils::DEVICE_HETERO, {{ "TARGET_FALLBACK", CommonTestUtils::DEVICE_CPU }}}, std::tuple{ CommonTestUtils::DEVICE_MULTI, {{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_CPU }}}, + std::tuple{ CommonTestUtils::DEVICE_AUTO, {{}}}, }; const Params paramsStreams[] = { diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/exec_graph_info.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/exec_graph_info.cpp index 32c789d1f54..474b6f6c7ce 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/exec_graph_info.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/exec_graph_info.cpp @@ -18,6 +18,9 @@ namespace { const std::vector> multiConfigs = { {{ InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_CPU}} }; + const std::vector> autoConfigs = { + {} + }; INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, ExecGraphTests, ::testing::Combine( @@ -32,4 +35,11 @@ namespace { ::testing::Values(CommonTestUtils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), ExecGraphTests::getTestCaseName); + + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, ExecGraphTests, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(autoConfigs)), + ExecGraphTests::getTestCaseName); } // namespace diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request.cpp index 4323e803058..1f0bebc3fcb 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request.cpp @@ -24,6 +24,8 @@ namespace { {{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_CPU}} }; + const std::vector> Autoconfigs = {{}}; + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, InferRequestTests, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -37,4 +39,12 @@ namespace { ::testing::Values(CommonTestUtils::DEVICE_MULTI), ::testing::ValuesIn(Multiconfigs)), InferRequestTests::getTestCaseName); + + INSTANTIATE_TEST_CASE_P(smoke_AutoPlugin_BehaviorTests, InferRequestTests, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(Autoconfigs)), + InferRequestTests::getTestCaseName); + } // namespace diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_callback.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_callback.cpp index 6d616300a5c..e85179ac5fb 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_callback.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_callback.cpp @@ -23,6 +23,10 @@ const std::vector> multiConfigs = { {{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_CPU}} }; +const std::vector> autoConfigs = { + {} +}; + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, CallbackTests, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -36,4 +40,11 @@ INSTANTIATE_TEST_CASE_P(smoke_Multi_BehaviorTests, CallbackTests, ::testing::Values(CommonTestUtils::DEVICE_MULTI), ::testing::ValuesIn(multiConfigs)), CallbackTests::getTestCaseName); + +INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, CallbackTests, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(autoConfigs)), + CallbackTests::getTestCaseName); } // namespace diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_config.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_config.cpp index 40f6c58d9aa..13f6acf76d8 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_config.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_config.cpp @@ -48,6 +48,10 @@ namespace { {InferenceEngine::PluginConfigParams::KEY_DYN_BATCH_LIMIT, "10"}} }; + const std::vector> autoConfigs = { + {} + }; + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, InferConfigTests, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -62,6 +66,13 @@ namespace { ::testing::ValuesIn(multiConfigs)), InferConfigTests::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, InferConfigTests, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(autoConfigs)), + InferConfigTests::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, InferConfigInTests, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -75,4 +86,11 @@ namespace { ::testing::Values(CommonTestUtils::DEVICE_MULTI), ::testing::ValuesIn(MultiInConfigs)), InferConfigInTests::getTestCaseName); + + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, InferConfigInTests, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(autoConfigs)), + InferConfigInTests::getTestCaseName); } // namespace diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_input.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_input.cpp index efd3684a5c0..5cada3a10a5 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_input.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_input.cpp @@ -27,6 +27,10 @@ namespace { {InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, InferenceEngine::PluginConfigParams::CPU_THROUGHPUT_AUTO}} }; + const std::vector> autoConfigs = { + {} + }; + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, InferRequestInputTests, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -41,4 +45,11 @@ namespace { ::testing::ValuesIn(multiConfigs)), InferRequestInputTests::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, InferRequestInputTests, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(autoConfigs)), + InferRequestInputTests::getTestCaseName); + } // namespace diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_output.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_output.cpp index d041a358182..18815f3b937 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_output.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/infer_request_output.cpp @@ -23,6 +23,10 @@ namespace { {InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, InferenceEngine::PluginConfigParams::CPU_THROUGHPUT_AUTO}} }; + const std::vector> autoConfigs = { + {} + }; + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, InferRequestOutputTests, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -37,4 +41,11 @@ namespace { ::testing::ValuesIn(multiConfigs)), InferRequestOutputTests::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, InferRequestOutputTests, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(autoConfigs)), + InferRequestOutputTests::getTestCaseName); + } // namespace diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/perf_counters.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/perf_counters.cpp index ff9a8063ae0..cde809a64dd 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/perf_counters.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/perf_counters.cpp @@ -15,6 +15,10 @@ namespace { {{ MULTI_CONFIG_KEY(DEVICE_PRIORITIES) , CommonTestUtils::DEVICE_CPU}} }; + const std::vector> Autoconfigs = { + {} + }; + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, PerfCountersTest, ::testing::Combine( ::testing::Values(InferenceEngine::Precision::FP32), @@ -29,4 +33,11 @@ namespace { ::testing::ValuesIn(Multiconfigs)), PerfCountersTest::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, PerfCountersTest, + ::testing::Combine( + ::testing::Values(InferenceEngine::Precision::FP32), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(Autoconfigs)), + PerfCountersTest::getTestCaseName); + } // namespace diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/set_preprocess.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/set_preprocess.cpp index 6086c902524..d8e228061c8 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/set_preprocess.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/set_preprocess.cpp @@ -28,6 +28,10 @@ namespace { {{ InferenceEngine::MultiDeviceConfigParams::KEY_MULTI_DEVICE_PRIORITIES , CommonTestUtils::DEVICE_CPU}} }; + const std::vector> autoConfigs = { + {} + }; + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, PreprocessTest, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -49,6 +53,13 @@ namespace { ::testing::ValuesIn(multiConfigs)), PreprocessTest::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, PreprocessTest, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(autoConfigs)), + PreprocessTest::getTestCaseName); + const std::vector ioPrecisions = { InferenceEngine::Precision::FP32, @@ -106,4 +117,18 @@ namespace { ::testing::ValuesIn(multiConfigs)), PreprocessConversionTest::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, PreprocessConversionTest, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::ValuesIn(ioPrecisions), + ::testing::ValuesIn(ioPrecisions), + ::testing::ValuesIn(netLayouts), + ::testing::ValuesIn(ioLayouts), + ::testing::ValuesIn(ioLayouts), + ::testing::Bool(), + ::testing::Bool(), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(autoConfigs)), + PreprocessConversionTest::getTestCaseName); + } // namespace \ No newline at end of file diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/test_plugin.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/test_plugin.cpp index 286563e3217..ea61aa7e055 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/test_plugin.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/behavior/test_plugin.cpp @@ -39,6 +39,10 @@ namespace { {{InferenceEngine::PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS, InferenceEngine::PluginConfigParams::CPU_THROUGHPUT_AUTO}} }; + const std::vector> Autoconfigs = { + {} + }; + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTestOutput, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -53,6 +57,13 @@ namespace { ::testing::ValuesIn(MultiConfigsInputOutput)), BehaviorTestOutput::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, BehaviorTestOutput, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(Autoconfigs)), + BehaviorTestOutput::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTests, ::testing::Combine( ::testing::Values(InferenceEngine::Precision::FP32), @@ -67,6 +78,13 @@ namespace { ::testing::ValuesIn(MultiConfigs)), BehaviorTests::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, BehaviorTests, + ::testing::Combine( + ::testing::Values(InferenceEngine::Precision::FP32), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(Autoconfigs)), + BehaviorTests::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_BehaviorTests, BehaviorTestInput, ::testing::Combine( ::testing::ValuesIn(netPrecisions), @@ -81,4 +99,11 @@ namespace { ::testing::ValuesIn(MultiConfigsInputOutput)), BehaviorTestInput::getTestCaseName); + INSTANTIATE_TEST_CASE_P(smoke_Auto_BehaviorTests, BehaviorTestInput, + ::testing::Combine( + ::testing::ValuesIn(netPrecisions), + ::testing::Values(CommonTestUtils::DEVICE_AUTO), + ::testing::ValuesIn(Autoconfigs)), + BehaviorTestInput::getTestCaseName); + } // namespace diff --git a/inference-engine/tests/functional/plugin/shared/include/behavior/config.hpp b/inference-engine/tests/functional/plugin/shared/include/behavior/config.hpp index 2e2f91067f7..833398f670b 100644 --- a/inference-engine/tests/functional/plugin/shared/include/behavior/config.hpp +++ b/inference-engine/tests/functional/plugin/shared/include/behavior/config.hpp @@ -58,7 +58,8 @@ namespace BehaviorTestsDefinitions { // Create CNNNetwork from ngrpah::Function InferenceEngine::CNNNetwork cnnNet(function); if (targetDevice.find(CommonTestUtils::DEVICE_MULTI) == std::string::npos && - targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos) { + targetDevice.find(CommonTestUtils::DEVICE_HETERO) == std::string::npos && + targetDevice.find(CommonTestUtils::DEVICE_AUTO) == std::string::npos) { ASSERT_NO_THROW(ie->GetMetric(targetDevice, METRIC_KEY(SUPPORTED_CONFIG_KEYS))); ASSERT_THROW(ie->SetConfig(configuration, targetDevice), InferenceEngine::Exception); diff --git a/inference-engine/tests/functional/plugin/shared/include/behavior/exec_graph_info.hpp b/inference-engine/tests/functional/plugin/shared/include/behavior/exec_graph_info.hpp index 6c92a9e45fa..c4e0f4ee395 100644 --- a/inference-engine/tests/functional/plugin/shared/include/behavior/exec_graph_info.hpp +++ b/inference-engine/tests/functional/plugin/shared/include/behavior/exec_graph_info.hpp @@ -72,12 +72,13 @@ TEST_P(ExecGraphTests, CheckExecGraphInfoBeforeExecution) { const auto originalLayers = function->get_ops(); std::map originalLayersMap; for (const auto &layer : originalLayers) { - if (layer->description() == "Result" && targetDevice != CommonTestUtils::DEVICE_CPU) + if (layer->description() == "Result" && + targetDevice != CommonTestUtils::DEVICE_CPU && + targetDevice != CommonTestUtils::DEVICE_AUTO) continue; originalLayersMap[layer->get_friendly_name()] = 0; } int IteratorForLayersConstant = 0; - if (auto function = execGraph.getFunction()) { for (const auto & op : function->get_ops()) { const auto & rtInfo = op->get_rt_info(); diff --git a/inference-engine/tests/functional/plugin/shared/include/behavior/infer_request.hpp b/inference-engine/tests/functional/plugin/shared/include/behavior/infer_request.hpp index 7adc5edbd4c..3a1efd4b07f 100644 --- a/inference-engine/tests/functional/plugin/shared/include/behavior/infer_request.hpp +++ b/inference-engine/tests/functional/plugin/shared/include/behavior/infer_request.hpp @@ -324,7 +324,7 @@ TEST_P(InferRequestTests, canProcessDeallocatedOutputBlobAfterGetBlobForAsync) { ASSERT_NO_THROW(req.SetBlob(cnnNet.getOutputsInfo().begin()->first, blob)); blob->deallocate(); ASSERT_THROW(req.Infer(), InferenceEngine::Exception); - ASSERT_THROW(req.StartAsync(), InferenceEngine::Exception); + ASSERT_THROW({ req.StartAsync(); req.Wait(); }, InferenceEngine::Exception); } TEST_P(InferRequestTests, canProcessDeallocatedOutputBlobAfterGetAndSetBlob) { diff --git a/inference-engine/tests/ie_test_utils/common_test_utils/test_constants.hpp b/inference-engine/tests/ie_test_utils/common_test_utils/test_constants.hpp index 327439cfa65..a8089bd3937 100644 --- a/inference-engine/tests/ie_test_utils/common_test_utils/test_constants.hpp +++ b/inference-engine/tests/ie_test_utils/common_test_utils/test_constants.hpp @@ -6,6 +6,7 @@ namespace CommonTestUtils { +const char DEVICE_AUTO[] = "AUTO"; const char DEVICE_CPU[] = "CPU"; const char DEVICE_GNA[] = "GNA"; const char DEVICE_GPU[] = "GPU";