Remove plugin.hpp (#15229)

This commit is contained in:
Ilya Churaev 2023-01-21 04:30:38 +04:00 committed by GitHub
parent 595d447f2e
commit 7ff9f80c68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 55 additions and 228 deletions

View File

@ -21,7 +21,6 @@
#include "openvino/core/runtime_attribute.hpp" #include "openvino/core/runtime_attribute.hpp"
namespace InferenceEngine { namespace InferenceEngine {
struct InferencePlugin;
class ExecutableNetwork; class ExecutableNetwork;
} // namespace InferenceEngine } // namespace InferenceEngine
@ -627,7 +626,6 @@ class OPENVINO_API Any {
}; };
friend class ::ov::RuntimeAttribute; friend class ::ov::RuntimeAttribute;
friend struct ::InferenceEngine::InferencePlugin;
friend class ::InferenceEngine::ExecutableNetwork; friend class ::InferenceEngine::ExecutableNetwork;
friend class ::ov::CompiledModel; friend class ::ov::CompiledModel;
friend class ::ov::RemoteContext; friend class ::ov::RemoteContext;

View File

@ -6,7 +6,6 @@
#include "any_copy.hpp" #include "any_copy.hpp"
#include "cnn_network_ngraph_impl.hpp" #include "cnn_network_ngraph_impl.hpp"
#include "cpp/ie_plugin.hpp"
#include "dev/converter_utils.hpp" #include "dev/converter_utils.hpp"
#include "dev/core_impl.hpp" #include "dev/core_impl.hpp"
#include "ie_itt.hpp" #include "ie_itt.hpp"

View File

@ -1,139 +0,0 @@
// Copyright (C) 2018-2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
/**
* @brief This is a header file for the Inference Engine plugin C++ API
*
* @file ie_plugin_cpp.hpp
*/
#pragma once
#include <map>
#include <memory>
#include <string>
#include "any_copy.hpp"
#include "cpp/exception2status.hpp"
#include "cpp/ie_cnn_network.h"
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
#include "file_utils.h"
#include "ie_plugin_config.hpp"
#include "openvino/runtime/common.hpp"
#include "so_ptr.hpp"
#if defined __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wreturn-type"
#endif
#define PLUGIN_CALL_STATEMENT(...) \
if (!_ptr) \
IE_THROW() << "Wrapper used in the PLUGIN_CALL_STATEMENT was not initialized."; \
try { \
__VA_ARGS__; \
} catch (...) { \
::InferenceEngine::details::Rethrow(); \
}
namespace InferenceEngine {
/**
* @brief This class is a C++ API wrapper for IInferencePlugin.
*
* It can throw exceptions safely for the application, where it is properly handled.
*/
struct InferencePlugin {
std::shared_ptr<InferenceEngine::IInferencePlugin> _ptr;
std::shared_ptr<void> _so;
~InferencePlugin() {
_ptr = {};
}
void SetName(const std::string& deviceName) {
PLUGIN_CALL_STATEMENT(_ptr->SetName(deviceName));
}
void SetCore(std::weak_ptr<InferenceEngine::ICore> core) {
PLUGIN_CALL_STATEMENT(_ptr->SetCore(core));
}
const Version GetVersion() const {
PLUGIN_CALL_STATEMENT(return _ptr->GetVersion());
}
void AddExtension(const InferenceEngine::IExtensionPtr& extension) {
PLUGIN_CALL_STATEMENT(_ptr->AddExtension(extension));
}
void SetConfig(const std::map<std::string, std::string>& config) {
PLUGIN_CALL_STATEMENT(_ptr->SetConfig(config));
}
ov::SoPtr<IExecutableNetworkInternal> LoadNetwork(const CNNNetwork& network,
const std::map<std::string, std::string>& config) {
PLUGIN_CALL_STATEMENT(return {_ptr->LoadNetwork(network, config), _so});
}
ov::SoPtr<IExecutableNetworkInternal> LoadNetwork(const CNNNetwork& network,
const std::shared_ptr<RemoteContext>& context,
const std::map<std::string, std::string>& config) {
PLUGIN_CALL_STATEMENT(return {_ptr->LoadNetwork(network, config, context), _so});
}
ov::SoPtr<IExecutableNetworkInternal> LoadNetwork(const std::string& modelPath,
const std::map<std::string, std::string>& config) {
ov::SoPtr<IExecutableNetworkInternal> res;
PLUGIN_CALL_STATEMENT(res = _ptr->LoadNetwork(modelPath, config));
if (!res._so)
res._so = _so;
return res;
}
QueryNetworkResult QueryNetwork(const CNNNetwork& network, const std::map<std::string, std::string>& config) const {
QueryNetworkResult res;
PLUGIN_CALL_STATEMENT(res = _ptr->QueryNetwork(network, config));
if (res.rc != OK)
IE_THROW() << res.resp.msg;
return res;
}
ov::SoPtr<IExecutableNetworkInternal> ImportNetwork(const std::string& modelFileName,
const std::map<std::string, std::string>& config) {
PLUGIN_CALL_STATEMENT(return {_ptr->ImportNetwork(modelFileName, config), _so});
}
ov::SoPtr<IExecutableNetworkInternal> ImportNetwork(std::istream& networkModel,
const std::map<std::string, std::string>& config) {
PLUGIN_CALL_STATEMENT(return {_ptr->ImportNetwork(networkModel, config), _so});
}
ov::SoPtr<IExecutableNetworkInternal> ImportNetwork(std::istream& networkModel,
const std::shared_ptr<RemoteContext>& context,
const std::map<std::string, std::string>& config) {
PLUGIN_CALL_STATEMENT(return {_ptr->ImportNetwork(networkModel, context, config), _so});
}
Parameter GetMetric(const std::string& name, const std::map<std::string, Parameter>& options) const {
PLUGIN_CALL_STATEMENT(return {_ptr->GetMetric(name, options), {_so}});
}
ov::SoPtr<RemoteContext> CreateContext(const ParamMap& params) {
PLUGIN_CALL_STATEMENT(return {_ptr->CreateContext(params), {_so}});
}
ov::SoPtr<RemoteContext> GetDefaultContext(const ParamMap& params) {
PLUGIN_CALL_STATEMENT(return {_ptr->GetDefaultContext(params), {_so}});
}
Parameter GetConfig(const std::string& name, const std::map<std::string, Parameter>& options) const {
PLUGIN_CALL_STATEMENT(return {_ptr->GetConfig(name, options), {_so}});
}
};
} // namespace InferenceEngine
#if defined __GNUC__
# pragma GCC diagnostic pop
#endif
#undef PLUGIN_CALL_STATEMENT

View File

@ -21,7 +21,6 @@
#include "any_copy.hpp" #include "any_copy.hpp"
#include "cnn_network_ngraph_impl.hpp" #include "cnn_network_ngraph_impl.hpp"
#include "cpp/ie_plugin.hpp"
#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" #include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" #include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
#include "ie_icore.hpp" #include "ie_icore.hpp"

View File

@ -9,7 +9,6 @@
#include "any_copy.hpp" #include "any_copy.hpp"
#include "check_network_batchable.hpp" #include "check_network_batchable.hpp"
#include "compilation_context.hpp" #include "compilation_context.hpp"
#include "cpp/ie_plugin.hpp"
#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" #include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
#include "cpp_interfaces/interface/ie_internal_plugin_config.hpp" #include "cpp_interfaces/interface/ie_internal_plugin_config.hpp"
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" #include "cpp_interfaces/interface/ie_iplugin_internal.hpp"

View File

@ -139,7 +139,7 @@ public:
/** /**
* @brief Returns the instance of the legacy plugin * @brief Returns the instance of the legacy plugin
* *
* @return Legacy InferenceEngine::InferencePlugin object * @return Legacy InferenceEngine::IInferencePlugin object
*/ */
const std::shared_ptr<InferenceEngine::IInferencePlugin>& get_plugin() const; const std::shared_ptr<InferenceEngine::IInferencePlugin>& get_plugin() const;

View File

@ -18,7 +18,6 @@
#include "cnn_network_ngraph_impl.hpp" #include "cnn_network_ngraph_impl.hpp"
#include "compilation_context.hpp" #include "compilation_context.hpp"
#include "cpp/ie_cnn_network.h" #include "cpp/ie_cnn_network.h"
#include "cpp/ie_plugin.hpp"
#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" #include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
#include "cpp_interfaces/interface/ie_internal_plugin_config.hpp" #include "cpp_interfaces/interface/ie_internal_plugin_config.hpp"
#include "dev/core_impl.hpp" #include "dev/core_impl.hpp"

View File

@ -16,7 +16,6 @@
#include "common_test_utils/file_utils.hpp" #include "common_test_utils/file_utils.hpp"
#include "common_test_utils/test_constants.hpp" #include "common_test_utils/test_constants.hpp"
#include "common_test_utils/unicode_utils.hpp" #include "common_test_utils/unicode_utils.hpp"
#include "cpp/ie_plugin.hpp"
#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" #include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
#include "cpp_interfaces/interface/ie_internal_plugin_config.hpp" #include "cpp_interfaces/interface/ie_internal_plugin_config.hpp"
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" #include "cpp_interfaces/interface/ie_iplugin_internal.hpp"

View File

@ -5,9 +5,8 @@
#include <file_utils.h> #include <file_utils.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <cpp/ie_plugin.hpp>
#include "common_test_utils/file_utils.hpp" #include "common_test_utils/file_utils.hpp"
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
#include "openvino/util/shared_object.hpp" #include "openvino/util/shared_object.hpp"
using namespace ::testing; using namespace ::testing;

View File

@ -5,9 +5,8 @@
#include <file_utils.h> #include <file_utils.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <cpp/ie_plugin.hpp>
#include "common_test_utils/file_utils.hpp" #include "common_test_utils/file_utils.hpp"
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
#include "openvino/util/shared_object.hpp" #include "openvino/util/shared_object.hpp"
using namespace std; using namespace std;

View File

@ -8,8 +8,9 @@
#include <cpp/ie_executable_network.hpp> #include <cpp/ie_executable_network.hpp>
#include <cpp/ie_infer_async_request_base.hpp> #include <cpp/ie_infer_async_request_base.hpp>
#include <cpp/ie_infer_request.hpp> #include <cpp/ie_infer_request.hpp>
#include <cpp/ie_plugin.hpp>
#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
#include "so_ptr.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinfer_request_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinfer_request_internal.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinference_plugin.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinference_plugin.hpp"
@ -175,7 +176,7 @@ protected:
std::shared_ptr<MockIExecutableNetworkInternal> mockIExeNet; std::shared_ptr<MockIExecutableNetworkInternal> mockIExeNet;
InferenceEngine::SoExecutableNetworkInternal exeNetwork; InferenceEngine::SoExecutableNetworkInternal exeNetwork;
MockIInferencePlugin* mockIPlugin; MockIInferencePlugin* mockIPlugin;
InferencePlugin plugin; std::shared_ptr<InferenceEngine::IInferencePlugin> plugin;
shared_ptr<MockIInferRequestInternal> mockInferRequestInternal; shared_ptr<MockIInferRequestInternal> mockInferRequestInternal;
MockNotEmptyICNNNetwork mockNotEmptyNet; MockNotEmptyICNNNetwork mockNotEmptyNet;
std::string _incorrectName; std::string _incorrectName;
@ -196,8 +197,8 @@ protected:
ON_CALL(*mockIExeNet, CreateInferRequest()).WillByDefault(Return(mock_request)); ON_CALL(*mockIExeNet, CreateInferRequest()).WillByDefault(Return(mock_request));
auto mockIPluginPtr = std::make_shared<MockIInferencePlugin>(); auto mockIPluginPtr = std::make_shared<MockIInferencePlugin>();
ON_CALL(*mockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).WillByDefault(Return(mockIExeNet)); ON_CALL(*mockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).WillByDefault(Return(mockIExeNet));
plugin = InferenceEngine::InferencePlugin{mockIPluginPtr, {}}; plugin = mockIPluginPtr;
exeNetwork = plugin.LoadNetwork(CNNNetwork{}, {}); exeNetwork = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(plugin->LoadNetwork(CNNNetwork{}, {}), {});
request = exeNetwork->CreateInferRequest(); request = exeNetwork->CreateInferRequest();
_incorrectName = "incorrect_name"; _incorrectName = "incorrect_name";
_inputName = MockNotEmptyICNNNetwork::INPUT_BLOB_NAME; _inputName = MockNotEmptyICNNNetwork::INPUT_BLOB_NAME;
@ -218,8 +219,8 @@ protected:
ON_CALL(*mockIExeNet, CreateInferRequest()).WillByDefault(Return(mockInferRequestInternal)); ON_CALL(*mockIExeNet, CreateInferRequest()).WillByDefault(Return(mockInferRequestInternal));
auto mockIPluginPtr = std::make_shared<MockIInferencePlugin>(); auto mockIPluginPtr = std::make_shared<MockIInferencePlugin>();
ON_CALL(*mockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).WillByDefault(Return(mockIExeNet)); ON_CALL(*mockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).WillByDefault(Return(mockIExeNet));
auto plugin = InferenceEngine::InferencePlugin{mockIPluginPtr, {}}; plugin = mockIPluginPtr;
auto exeNetwork = plugin.LoadNetwork(CNNNetwork{}, {}); exeNetwork = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(plugin->LoadNetwork(CNNNetwork{}, {}), {});
return exeNetwork->CreateInferRequest(); return exeNetwork->CreateInferRequest();
} }

View File

@ -9,7 +9,8 @@
#include <cpp/ie_executable_network_base.hpp> #include <cpp/ie_executable_network_base.hpp>
#include <cpp/ie_infer_async_request_base.hpp> #include <cpp/ie_infer_async_request_base.hpp>
#include "cpp/ie_plugin.hpp" #include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinference_plugin.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinference_plugin.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_ivariable_state_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_ivariable_state_internal.hpp"
@ -25,7 +26,7 @@ protected:
shared_ptr<MockIInferRequestInternal> mockInferRequestInternal; shared_ptr<MockIInferRequestInternal> mockInferRequestInternal;
shared_ptr<MockIVariableStateInternal> mockVariableStateInternal; shared_ptr<MockIVariableStateInternal> mockVariableStateInternal;
MockIInferencePlugin* mockIPlugin; MockIInferencePlugin* mockIPlugin;
InferencePlugin plugin; std::shared_ptr<InferenceEngine::IInferencePlugin> plugin;
ov::SoPtr<IExecutableNetworkInternal> net; ov::SoPtr<IExecutableNetworkInternal> net;
IInferRequestInternal::Ptr req; IInferRequestInternal::Ptr req;
@ -37,8 +38,8 @@ protected:
auto mockIPluginPtr = std::make_shared<MockIInferencePlugin>(); auto mockIPluginPtr = std::make_shared<MockIInferencePlugin>();
ON_CALL(*mockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)) ON_CALL(*mockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _))
.WillByDefault(Return(mockExeNetworkInternal)); .WillByDefault(Return(mockExeNetworkInternal));
plugin = InferenceEngine::InferencePlugin{mockIPluginPtr, {}}; plugin = mockIPluginPtr;
net = plugin.LoadNetwork(CNNNetwork{}, {}); net = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(plugin->LoadNetwork(CNNNetwork{}, {}), {});
req = net->CreateInferRequest(); req = net->CreateInferRequest();
} }
}; };

View File

@ -6,7 +6,6 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <cpp/ie_infer_async_request_base.hpp> #include <cpp/ie_infer_async_request_base.hpp>
#include <cpp/ie_plugin.hpp>
#include <cpp_interfaces/interface/ie_iexecutable_network_internal.hpp> #include <cpp_interfaces/interface/ie_iexecutable_network_internal.hpp>
#include <ie_version.hpp> #include <ie_version.hpp>
@ -144,28 +143,3 @@ TEST_F(InferenceEnginePluginInternalTest, failToSetNotAllocatedBlob) {
<< "\tExpected: " << refError << "\n\tActual: " << ex.what(); << "\tExpected: " << refError << "\n\tActual: " << ex.what();
} }
} }
TEST(InferencePluginTests, throwsOnUninitializedGetVersion) {
InferencePlugin plg;
ASSERT_THROW(plg.GetVersion(), Exception);
}
TEST(InferencePluginTests, throwsOnUninitializedLoadNetwork) {
InferencePlugin plg;
ASSERT_THROW(plg.LoadNetwork(CNNNetwork(), {}), Exception);
}
TEST(InferencePluginTests, throwsOnUninitializedImportNetwork) {
InferencePlugin plg;
ASSERT_THROW(plg.ImportNetwork({}, {}), Exception);
}
TEST(InferencePluginTests, throwsOnUninitializedAddExtension) {
InferencePlugin plg;
ASSERT_THROW(plg.AddExtension(IExtensionPtr()), Exception);
}
TEST(InferencePluginTests, throwsOnUninitializedSetConfig) {
InferencePlugin plg;
ASSERT_THROW(plg.SetConfig({{}}), Exception);
}

View File

@ -11,7 +11,8 @@
#include <vector> #include <vector>
#include "cpp/ie_executable_network_base.hpp" #include "cpp/ie_executable_network_base.hpp"
#include "cpp/ie_plugin.hpp" #include "openvino/runtime/compiled_model.hpp"
#include "so_ptr.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/impl/mock_inference_plugin_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/impl/mock_inference_plugin_internal.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinference_plugin.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinference_plugin.hpp"
@ -40,7 +41,7 @@ protected:
std::shared_ptr<MockIExecutableNetworkInternal> mockIExeNet; std::shared_ptr<MockIExecutableNetworkInternal> mockIExeNet;
ov::SoPtr<IExecutableNetworkInternal> exeNetwork; ov::SoPtr<IExecutableNetworkInternal> exeNetwork;
MockIInferencePlugin* mockIPlugin; MockIInferencePlugin* mockIPlugin;
InferencePlugin plugin; std::shared_ptr<InferenceEngine::IInferencePlugin> plugin;
void TearDown() override { void TearDown() override {
mockIExeNet.reset(); mockIExeNet.reset();
@ -52,8 +53,8 @@ protected:
mockIExeNet = std::make_shared<MockIExecutableNetworkInternal>(); mockIExeNet = std::make_shared<MockIExecutableNetworkInternal>();
auto mockIPluginPtr = std::make_shared<MockIInferencePlugin>(); auto mockIPluginPtr = std::make_shared<MockIInferencePlugin>();
ON_CALL(*mockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).WillByDefault(Return(mockIExeNet)); ON_CALL(*mockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).WillByDefault(Return(mockIExeNet));
plugin = InferenceEngine::InferencePlugin{mockIPluginPtr, {}}; plugin = mockIPluginPtr;
exeNetwork = plugin.LoadNetwork(CNNNetwork{}, {}); exeNetwork = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(plugin->LoadNetwork(CNNNetwork{}, {}), {});
} }
}; };

View File

@ -8,7 +8,6 @@
#include <common_test_utils/test_constants.hpp> #include <common_test_utils/test_constants.hpp>
#include <ngraph_functions/subgraph_builders.hpp> #include <ngraph_functions/subgraph_builders.hpp>
#include "cpp/ie_plugin.hpp"
#include "plugin/mock_load_network_properties.hpp" #include "plugin/mock_load_network_properties.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_icore.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_icore.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp"
@ -44,13 +43,13 @@ public:
std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> cpuMockIExeNet; std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> cpuMockIExeNet;
ov::SoPtr<IExecutableNetworkInternal> cpuMockExeNetwork; ov::SoPtr<IExecutableNetworkInternal> cpuMockExeNetwork;
NiceMock<MockIInferencePlugin>* cpuMockIPlugin; NiceMock<MockIInferencePlugin>* cpuMockIPlugin;
InferenceEngine::InferencePlugin cpuMockPlugin; std::shared_ptr<InferenceEngine::IInferencePlugin> cpuMockPlugin;
// mock gpu exeNetwork // mock gpu exeNetwork
std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> gpuMockIExeNet; std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> gpuMockIExeNet;
ov::SoPtr<IExecutableNetworkInternal> gpuMockExeNetwork; ov::SoPtr<IExecutableNetworkInternal> gpuMockExeNetwork;
NiceMock<MockIInferencePlugin>* gpuMockIPlugin; NiceMock<MockIInferencePlugin>* gpuMockIPlugin;
InferenceEngine::InferencePlugin gpuMockPlugin; std::shared_ptr<InferenceEngine::IInferencePlugin> gpuMockPlugin;
std::shared_ptr<NiceMock<MockIInferRequestInternal>> inferReqInternal; std::shared_ptr<NiceMock<MockIInferRequestInternal>> inferReqInternal;
public: public:
@ -80,20 +79,20 @@ public:
auto cpuMockIPluginPtr = std::make_shared<NiceMock<MockIInferencePlugin>>(); auto cpuMockIPluginPtr = std::make_shared<NiceMock<MockIInferencePlugin>>();
ON_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)) ON_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _))
.WillByDefault(Return(cpuMockIExeNet)); .WillByDefault(Return(cpuMockIExeNet));
cpuMockPlugin = InferenceEngine::InferencePlugin{cpuMockIPluginPtr, {}}; cpuMockPlugin = cpuMockIPluginPtr;
// remove annoying ON CALL message // remove annoying ON CALL message
EXPECT_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1); EXPECT_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1);
cpuMockExeNetwork = cpuMockPlugin.LoadNetwork(CNNNetwork{}, {}); cpuMockExeNetwork = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(cpuMockPlugin->LoadNetwork(CNNNetwork{}, {}), {});
// prepare gpuMockExeNetwork // prepare gpuMockExeNetwork
gpuMockIExeNet = std::make_shared<NiceMock<MockIExecutableNetworkInternal>>(); gpuMockIExeNet = std::make_shared<NiceMock<MockIExecutableNetworkInternal>>();
auto gpuMockIPluginPtr = std::make_shared<NiceMock<MockIInferencePlugin>>(); auto gpuMockIPluginPtr = std::make_shared<NiceMock<MockIInferencePlugin>>();
ON_CALL(*gpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)) ON_CALL(*gpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _))
.WillByDefault(Return(gpuMockIExeNet)); .WillByDefault(Return(gpuMockIExeNet));
gpuMockPlugin = InferenceEngine::InferencePlugin{gpuMockIPluginPtr, {}}; gpuMockPlugin = gpuMockIPluginPtr;
// remove annoying ON CALL message // remove annoying ON CALL message
EXPECT_CALL(*gpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1); EXPECT_CALL(*gpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1);
gpuMockExeNetwork = gpuMockPlugin.LoadNetwork(CNNNetwork{}, {}); gpuMockExeNetwork = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(gpuMockPlugin->LoadNetwork(CNNNetwork{}, {}), {});
// prepare mockicore and cnnNetwork for loading // prepare mockicore and cnnNetwork for loading
core = std::shared_ptr<NiceMock<MockICore>>(new NiceMock<MockICore>()); core = std::shared_ptr<NiceMock<MockICore>>(new NiceMock<MockICore>());

View File

@ -12,9 +12,10 @@
#include <ngraph_functions/subgraph_builders.hpp> #include <ngraph_functions/subgraph_builders.hpp>
#include <openvino/runtime/core.hpp> #include <openvino/runtime/core.hpp>
#include "cpp/ie_plugin.hpp"
#include "mock_common.hpp" #include "mock_common.hpp"
#include "openvino/runtime/compiled_model.hpp"
#include "plugin/mock_load_network_properties.hpp" #include "plugin/mock_load_network_properties.hpp"
#include "so_ptr.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/impl/mock_inference_plugin_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/impl/mock_inference_plugin_internal.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_icore.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_icore.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp"
@ -59,13 +60,13 @@ public:
std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> cpuMockIExeNet; std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> cpuMockIExeNet;
ov::SoPtr<IExecutableNetworkInternal> cpuMockExeNetwork; ov::SoPtr<IExecutableNetworkInternal> cpuMockExeNetwork;
NiceMock<MockIInferencePlugin>* cpuMockIPlugin; NiceMock<MockIInferencePlugin>* cpuMockIPlugin;
InferenceEngine::InferencePlugin cpuMockPlugin; std::shared_ptr<InferenceEngine::IInferencePlugin> cpuMockPlugin;
// mock gpu exeNetwork // mock gpu exeNetwork
std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> gpuMockIExeNet; std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> gpuMockIExeNet;
ov::SoPtr<IExecutableNetworkInternal> gpuMockExeNetwork; ov::SoPtr<IExecutableNetworkInternal> gpuMockExeNetwork;
NiceMock<MockIInferencePlugin>* gpuMockIPlugin; NiceMock<MockIInferencePlugin>* gpuMockIPlugin;
InferenceEngine::InferencePlugin gpuMockPlugin; std::shared_ptr<InferenceEngine::IInferencePlugin> gpuMockPlugin;
std::shared_ptr<NiceMock<MockIInferRequestInternal>> inferReqInternal; std::shared_ptr<NiceMock<MockIInferRequestInternal>> inferReqInternal;
public: public:
@ -255,20 +256,20 @@ public:
auto cpuMockIPluginPtr = std::make_shared<NiceMock<MockIInferencePlugin>>(); auto cpuMockIPluginPtr = std::make_shared<NiceMock<MockIInferencePlugin>>();
ON_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)) ON_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _))
.WillByDefault(Return(cpuMockIExeNet)); .WillByDefault(Return(cpuMockIExeNet));
cpuMockPlugin = InferenceEngine::InferencePlugin{cpuMockIPluginPtr, {}}; cpuMockPlugin = cpuMockIPluginPtr;
// remove annoying ON CALL message // remove annoying ON CALL message
EXPECT_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1); EXPECT_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1);
cpuMockExeNetwork = cpuMockPlugin.LoadNetwork(CNNNetwork{}, {}); cpuMockExeNetwork = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(cpuMockPlugin->LoadNetwork(CNNNetwork{}, {}), {});
// prepare gpuMockExeNetwork // prepare gpuMockExeNetwork
gpuMockIExeNet = std::make_shared<NiceMock<MockIExecutableNetworkInternal>>(); gpuMockIExeNet = std::make_shared<NiceMock<MockIExecutableNetworkInternal>>();
auto gpuMockIPluginPtr = std::make_shared<NiceMock<MockIInferencePlugin>>(); auto gpuMockIPluginPtr = std::make_shared<NiceMock<MockIInferencePlugin>>();
ON_CALL(*gpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)) ON_CALL(*gpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _))
.WillByDefault(Return(gpuMockIExeNet)); .WillByDefault(Return(gpuMockIExeNet));
gpuMockPlugin = InferenceEngine::InferencePlugin{gpuMockIPluginPtr, {}}; gpuMockPlugin = gpuMockIPluginPtr;
// remove annoying ON CALL message // remove annoying ON CALL message
EXPECT_CALL(*gpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1); EXPECT_CALL(*gpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1);
gpuMockExeNetwork = gpuMockPlugin.LoadNetwork(CNNNetwork{}, {}); gpuMockExeNetwork = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(gpuMockPlugin->LoadNetwork(CNNNetwork{}, {}), {});
// prepare mockicore and cnnNetwork for loading // prepare mockicore and cnnNetwork for loading
core = std::shared_ptr<NiceMock<MockICore>>(new NiceMock<MockICore>()); core = std::shared_ptr<NiceMock<MockICore>>(new NiceMock<MockICore>());

View File

@ -12,7 +12,6 @@
#include <ngraph_functions/subgraph_builders.hpp> #include <ngraph_functions/subgraph_builders.hpp>
#include <openvino/runtime/core.hpp> #include <openvino/runtime/core.hpp>
#include "cpp/ie_plugin.hpp"
#include "mock_common.hpp" #include "mock_common.hpp"
#include "plugin/mock_load_network_properties.hpp" #include "plugin/mock_load_network_properties.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/impl/mock_inference_plugin_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/impl/mock_inference_plugin_internal.hpp"
@ -65,13 +64,13 @@ public:
std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> cpuMockIExeNet; std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> cpuMockIExeNet;
ov::SoPtr<IExecutableNetworkInternal> cpuMockExeNetwork; ov::SoPtr<IExecutableNetworkInternal> cpuMockExeNetwork;
NiceMock<MockIInferencePlugin>* cpuMockIPlugin; NiceMock<MockIInferencePlugin>* cpuMockIPlugin;
InferenceEngine::InferencePlugin cpuMockPlugin; std::shared_ptr<InferenceEngine::IInferencePlugin> cpuMockPlugin;
// mock gpu exeNetwork // mock gpu exeNetwork
std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> gpuMockIExeNet; std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> gpuMockIExeNet;
ov::SoPtr<IExecutableNetworkInternal> gpuMockExeNetwork; ov::SoPtr<IExecutableNetworkInternal> gpuMockExeNetwork;
NiceMock<MockIInferencePlugin>* gpuMockIPlugin; NiceMock<MockIInferencePlugin>* gpuMockIPlugin;
InferenceEngine::InferencePlugin gpuMockPlugin; std::shared_ptr<InferenceEngine::IInferencePlugin> gpuMockPlugin;
std::shared_ptr<NiceMock<MockIInferRequestInternal>> inferReqInternal; std::shared_ptr<NiceMock<MockIInferRequestInternal>> inferReqInternal;
public: public:
@ -136,20 +135,20 @@ public:
auto cpuMockIPluginPtr = std::make_shared<NiceMock<MockIInferencePlugin>>(); auto cpuMockIPluginPtr = std::make_shared<NiceMock<MockIInferencePlugin>>();
ON_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)) ON_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _))
.WillByDefault(Return(cpuMockIExeNet)); .WillByDefault(Return(cpuMockIExeNet));
cpuMockPlugin = InferenceEngine::InferencePlugin{cpuMockIPluginPtr, {}}; cpuMockPlugin = cpuMockIPluginPtr;
// remove annoying ON CALL message // remove annoying ON CALL message
EXPECT_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1); EXPECT_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1);
cpuMockExeNetwork = cpuMockPlugin.LoadNetwork(CNNNetwork{}, {}); cpuMockExeNetwork = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(cpuMockPlugin->LoadNetwork(CNNNetwork{}, {}), {});
// prepare gpuMockExeNetwork // prepare gpuMockExeNetwork
gpuMockIExeNet = std::make_shared<NiceMock<MockIExecutableNetworkInternal>>(); gpuMockIExeNet = std::make_shared<NiceMock<MockIExecutableNetworkInternal>>();
auto gpuMockIPluginPtr = std::make_shared<NiceMock<MockIInferencePlugin>>(); auto gpuMockIPluginPtr = std::make_shared<NiceMock<MockIInferencePlugin>>();
ON_CALL(*gpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)) ON_CALL(*gpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _))
.WillByDefault(Return(gpuMockIExeNet)); .WillByDefault(Return(gpuMockIExeNet));
gpuMockPlugin = InferenceEngine::InferencePlugin{gpuMockIPluginPtr, {}}; gpuMockPlugin = gpuMockIPluginPtr;
// remove annoying ON CALL message // remove annoying ON CALL message
EXPECT_CALL(*gpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1); EXPECT_CALL(*gpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1);
gpuMockExeNetwork = gpuMockPlugin.LoadNetwork(CNNNetwork{}, {}); gpuMockExeNetwork = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(gpuMockPlugin->LoadNetwork(CNNNetwork{}, {}), {});
// prepare mockicore and cnnNetwork for loading // prepare mockicore and cnnNetwork for loading
core = std::shared_ptr<NiceMock<MockICore>>(new NiceMock<MockICore>()); core = std::shared_ptr<NiceMock<MockICore>>(new NiceMock<MockICore>());

View File

@ -16,7 +16,6 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include "plugin/mock_auto_device_plugin.hpp" #include "plugin/mock_auto_device_plugin.hpp"
#include "cpp/ie_plugin.hpp"
#include "mock_common.hpp" #include "mock_common.hpp"
#include <thread> #include <thread>

View File

@ -4,6 +4,7 @@
#include <ie_metric_helpers.hpp> #include <ie_metric_helpers.hpp>
#include <common_test_utils/test_constants.hpp> #include <common_test_utils/test_constants.hpp>
#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_icore.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_icore.hpp"
#include "unit_test_utils/mocks/mock_iinfer_request.hpp" #include "unit_test_utils/mocks/mock_iinfer_request.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/impl/mock_inference_plugin_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/impl/mock_inference_plugin_internal.hpp"
@ -16,7 +17,6 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include "plugin/mock_auto_device_plugin.hpp" #include "plugin/mock_auto_device_plugin.hpp"
#include "cpp/ie_plugin.hpp"
#include "mock_common.hpp" #include "mock_common.hpp"
using ::testing::MatcherCast; using ::testing::MatcherCast;
@ -63,7 +63,7 @@ public:
std::shared_ptr<MockIExecutableNetworkInternal> mockIExeNet; std::shared_ptr<MockIExecutableNetworkInternal> mockIExeNet;
ov::SoPtr<IExecutableNetworkInternal> mockExeNetwork; ov::SoPtr<IExecutableNetworkInternal> mockExeNetwork;
MockIInferencePlugin* mockIPlugin; MockIInferencePlugin* mockIPlugin;
InferenceEngine::InferencePlugin mockPlugin; std::shared_ptr<InferenceEngine::IInferencePlugin> mockPlugin;
// config for Auto device // config for Auto device
std::map<std::string, std::string> config; std::map<std::string, std::string> config;
std::vector<DeviceInformation> metaDevices; std::vector<DeviceInformation> metaDevices;
@ -130,10 +130,10 @@ public:
mockIExeNet = std::make_shared<MockIExecutableNetworkInternal>(); mockIExeNet = std::make_shared<MockIExecutableNetworkInternal>();
auto mockIPluginPtr = std::make_shared<MockIInferencePlugin>(); auto mockIPluginPtr = std::make_shared<MockIInferencePlugin>();
ON_CALL(*mockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).WillByDefault(Return(mockIExeNet)); ON_CALL(*mockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).WillByDefault(Return(mockIExeNet));
mockPlugin = InferenceEngine::InferencePlugin{mockIPluginPtr, {}}; mockPlugin = mockIPluginPtr;
// remove annoying ON CALL message // remove annoying ON CALL message
EXPECT_CALL(*mockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1); EXPECT_CALL(*mockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1);
mockExeNetwork = mockPlugin.LoadNetwork(CNNNetwork{}, {}); mockExeNetwork = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(mockPlugin->LoadNetwork(CNNNetwork{}, {}), {});
// prepare mockicore and cnnNetwork for loading // prepare mockicore and cnnNetwork for loading
core = std::shared_ptr<MockICore>(new MockICore()); core = std::shared_ptr<MockICore>(new MockICore());

View File

@ -4,6 +4,10 @@
#include <ie_metric_helpers.hpp> #include <ie_metric_helpers.hpp>
#include <common_test_utils/test_constants.hpp> #include <common_test_utils/test_constants.hpp>
#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
#include "openvino/runtime/compiled_model.hpp"
#include "so_ptr.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_icore.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_icore.hpp"
#include "unit_test_utils/mocks/mock_iinfer_request.hpp" #include "unit_test_utils/mocks/mock_iinfer_request.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/impl/mock_inference_plugin_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/impl/mock_inference_plugin_internal.hpp"
@ -11,12 +15,12 @@
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_ivariable_state_internal.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_ivariable_state_internal.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinference_plugin.hpp" #include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinference_plugin.hpp"
#include <ie_core.hpp> #include <ie_core.hpp>
#include <memory>
#include <multi-device/multi_device_config.hpp> #include <multi-device/multi_device_config.hpp>
#include <ngraph_functions/subgraph_builders.hpp> #include <ngraph_functions/subgraph_builders.hpp>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include "plugin/mock_auto_device_plugin.hpp" #include "plugin/mock_auto_device_plugin.hpp"
#include "cpp/ie_plugin.hpp"
#include <chrono> #include <chrono>
#include <thread> #include <thread>
#include "mock_common.hpp" #include "mock_common.hpp"
@ -61,13 +65,13 @@ public:
std::shared_ptr<MockIExecutableNetworkInternal> cpuMockIExeNet; std::shared_ptr<MockIExecutableNetworkInternal> cpuMockIExeNet;
ov::SoPtr<IExecutableNetworkInternal> cpuMockExeNetwork; ov::SoPtr<IExecutableNetworkInternal> cpuMockExeNetwork;
MockIInferencePlugin* cpuMockIPlugin; MockIInferencePlugin* cpuMockIPlugin;
InferenceEngine::InferencePlugin cpuMockPlugin; std::shared_ptr<InferenceEngine::IInferencePlugin> cpuMockPlugin;
//mock actual exeNetwork //mock actual exeNetwork
std::shared_ptr<MockIExecutableNetworkInternal> actualMockIExeNet; std::shared_ptr<MockIExecutableNetworkInternal> actualMockIExeNet;
ov::SoPtr<IExecutableNetworkInternal> actualMockExeNetwork; ov::SoPtr<IExecutableNetworkInternal> actualMockExeNetwork;
MockIInferencePlugin* actualMockIPlugin; MockIInferencePlugin* actualMockIPlugin;
InferenceEngine::InferencePlugin actualMockPlugin; std::shared_ptr<InferenceEngine::IInferencePlugin> actualMockPlugin;
// config for Auto device // config for Auto device
std::map<std::string, std::string> config; std::map<std::string, std::string> config;
@ -132,19 +136,19 @@ public:
cpuMockIExeNet = std::make_shared<MockIExecutableNetworkInternal>(); cpuMockIExeNet = std::make_shared<MockIExecutableNetworkInternal>();
auto cpuMockIPluginPtr = std::make_shared<MockIInferencePlugin>(); auto cpuMockIPluginPtr = std::make_shared<MockIInferencePlugin>();
ON_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).WillByDefault(Return(cpuMockIExeNet)); ON_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).WillByDefault(Return(cpuMockIExeNet));
cpuMockPlugin = InferenceEngine::InferencePlugin{cpuMockIPluginPtr, {}}; cpuMockPlugin = cpuMockIPluginPtr;
// remove annoying ON CALL message // remove annoying ON CALL message
EXPECT_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1); EXPECT_CALL(*cpuMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1);
cpuMockExeNetwork = cpuMockPlugin.LoadNetwork(CNNNetwork{}, {}); cpuMockExeNetwork = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(cpuMockPlugin->LoadNetwork(CNNNetwork{}, {}), {});
// prepare actualMockExeNetwork // prepare actualMockExeNetwork
actualMockIExeNet = std::make_shared<MockIExecutableNetworkInternal>(); actualMockIExeNet = std::make_shared<MockIExecutableNetworkInternal>();
auto actualMockIPluginPtr = std::make_shared<MockIInferencePlugin>(); auto actualMockIPluginPtr = std::make_shared<MockIInferencePlugin>();
ON_CALL(*actualMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).WillByDefault(Return(actualMockIExeNet)); ON_CALL(*actualMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).WillByDefault(Return(actualMockIExeNet));
actualMockPlugin = InferenceEngine::InferencePlugin{actualMockIPluginPtr, {}}; actualMockPlugin = actualMockIPluginPtr;
// remove annoying ON CALL message // remove annoying ON CALL message
EXPECT_CALL(*actualMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1); EXPECT_CALL(*actualMockIPluginPtr, LoadNetwork(MatcherCast<const CNNNetwork&>(_), _)).Times(1);
actualMockExeNetwork = actualMockPlugin.LoadNetwork(CNNNetwork{}, {}); actualMockExeNetwork = ov::SoPtr<InferenceEngine::IExecutableNetworkInternal>(actualMockPlugin->LoadNetwork(CNNNetwork{}, {}), {});
// prepare mockicore and cnnNetwork for loading // prepare mockicore and cnnNetwork for loading
core = std::shared_ptr<MockICore>(new MockICore()); core = std::shared_ptr<MockICore>(new MockICore());

View File

@ -16,7 +16,6 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include "plugin/mock_auto_device_plugin.hpp" #include "plugin/mock_auto_device_plugin.hpp"
#include "cpp/ie_plugin.hpp"
#include "mock_common.hpp" #include "mock_common.hpp"
using ::testing::Return; using ::testing::Return;

View File

@ -16,7 +16,6 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include "plugin/mock_auto_device_plugin.hpp" #include "plugin/mock_auto_device_plugin.hpp"
#include "cpp/ie_plugin.hpp"
#include "mock_common.hpp" #include "mock_common.hpp"
using ::testing::MatcherCast; using ::testing::MatcherCast;

View File

@ -16,7 +16,6 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include "plugin/mock_auto_device_plugin.hpp" #include "plugin/mock_auto_device_plugin.hpp"
#include "cpp/ie_plugin.hpp"
#include "mock_common.hpp" #include "mock_common.hpp"
using ::testing::MatcherCast; using ::testing::MatcherCast;

View File

@ -16,7 +16,6 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include "plugin/mock_auto_device_plugin.hpp" #include "plugin/mock_auto_device_plugin.hpp"
#include "cpp/ie_plugin.hpp"
#include "mock_common.hpp" #include "mock_common.hpp"
using ::testing::MatcherCast; using ::testing::MatcherCast;