Move all base wrapper classes from Plugin API to source folder (#5419)

* Small refactoring in TEMPLATE plugin

* Fixed compilation on Windows

* Fixed code style

* Hide CALL_STATUS_FNC helpers to private API

* Moved some base classes to private place from plugin_api

* Updates for VariableState creation

* Take Jane's changes for Demension names

* Revert "Take Jane's changes for Demension names"

This reverts commit 9f6c8fa5a6.

* Removed ICNNNetwork include

* removed more icnnnetwork includes

* Added missed include with ie_input_info.hpp

* Fixed GNA plugin to provide names w/o \0
This commit is contained in:
Ilya Lavrenov 2021-04-29 19:50:46 +03:00 committed by GitHub
parent 2062a648a7
commit c350f61a42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
63 changed files with 122 additions and 259 deletions

View File

@ -4,7 +4,6 @@
#include <ie_plugin_config.hpp>
#include <cpp_interfaces/interface/ie_internal_plugin_config.hpp>
#include <cpp_interfaces/exception2status.hpp>
#include "template_config.hpp"
#include "template/template_config.hpp"

View File

@ -190,18 +190,12 @@ public:
/**
* @brief Method maps framework tensor name to OpenVINO name
*
* @param orig_name Framework tensor name
*
* @return OpenVINO name
*/
std::string getOVNameForTensor(const std::string& orig_name) const {
std::string ov_name;
CALL_STATUS_FNC(getOVNameForTensor, ov_name, orig_name);
return ov_name;
}
std::string getOVNameForTensor(const std::string& orig_name) const;
protected:
private:
IE_SUPPRESS_DEPRECATED_START
/**
* @brief Network extra interface, might be nullptr
@ -213,11 +207,6 @@ protected:
*/
ICNNNetwork* actual = nullptr;
IE_SUPPRESS_DEPRECATED_END
/**
* @brief A pointer to output data
*/
DataPtr output;
};
} // namespace InferenceEngine

View File

@ -17,29 +17,31 @@
namespace InferenceEngine {
IE_SUPPRESS_DEPRECATED_START
class IVariableState;
IE_SUPPRESS_DEPRECATED_END
namespace details {
class SharedObjectLoader;
}
class IVariableStateInternal;
/**
* @brief C++ exception based error reporting wrapper of API class IVariableState
*/
class INFERENCE_ENGINE_API_CLASS(VariableState) {
IE_SUPPRESS_DEPRECATED_START
std::shared_ptr<IVariableState> actual = nullptr;
IE_SUPPRESS_DEPRECATED_END
details::SharedObjectLoader::Ptr plugin = nullptr;
std::shared_ptr<IVariableStateInternal> _impl = nullptr;
details::SharedObjectLoader::Ptr _so = nullptr;
/**
* @brief Constructs VariableState from the initialized std::shared_ptr
* @param impl Initialized shared pointer
* @param so Optional: Plugin to use. This is required to ensure that VariableState can work properly even if plugin object is destroyed.
*/
explicit VariableState(const std::shared_ptr<IVariableStateInternal>& impl,
const details::SharedObjectLoader::Ptr& so = {});
friend class InferRequest;
friend class ExecutableNetwork;
public:
IE_SUPPRESS_DEPRECATED_START
/**
* @brief constructs VariableState from the initialized std::shared_ptr
* @param pState Initialized shared pointer
* @param plg Optional: Plugin to use. This is required to ensure that VariableState can work properly even if plugin object is destroyed.
*/
explicit VariableState(std::shared_ptr<IVariableState> pState, details::SharedObjectLoader::Ptr plg = {});
IE_SUPPRESS_DEPRECATED_END
/**
* @copybrief IVariableState::Reset
*

View File

@ -473,39 +473,6 @@ struct NullStream {
default: IE_ASSERT(!"Unreachable"); \
}
/**
* @private
*/
#define CALL_STATUS_FNC(function, ...) \
if (!actual) IE_THROW() << "Wrapper used was not initialized."; \
ResponseDesc resp; \
auto res = actual->function(__VA_ARGS__, &resp); \
if (res != OK) IE_EXCEPTION_SWITCH(res, ExceptionType, \
InferenceEngine::details::ThrowNow<ExceptionType>{} \
<<= std::stringstream{} << IE_LOCATION << resp.msg)
/**
* @private
*/
#define CALL_STATUS_FNC_NO_ARGS(function) \
if (!actual) IE_THROW() << "Wrapper used in the CALL_STATUS_FNC_NO_ARGS was not initialized."; \
ResponseDesc resp; \
auto res = actual->function(&resp); \
if (res != OK) IE_EXCEPTION_SWITCH(res, ExceptionType, \
InferenceEngine::details::ThrowNow<ExceptionType>{} \
<<= std::stringstream{} << IE_LOCATION)
/**
* @private
*/
#define CALL_FNC_NO_ARGS(function) \
if (!actual) IE_THROW() << "Wrapper used in the CALL_FNC_NO_ARGS was not initialized."; \
ResponseDesc resp; \
auto result = actual->function(&resp); \
if (resp.msg[0] != '\0') { \
IE_THROW() << resp.msg \
} \
return result;
} // namespace details
} // namespace InferenceEngine
#if defined(_WIN32)

View File

@ -5,7 +5,6 @@
#pragma once
#include <ie_layouts.h>
#include <cpp_interfaces/exception2status.hpp>
#include <api/layout.hpp>
#include "ngraph/type/element_type.hpp"

View File

@ -6,7 +6,6 @@
#include <cldnn/cldnn_config.hpp>
#include "cldnn_config.h"
#include "cpp_interfaces/exception2status.hpp"
#include "cpp_interfaces/interface/ie_internal_plugin_config.hpp"
#include "ie_api.h"
#include "file_utils.h"

View File

@ -61,8 +61,6 @@ class GNAExecutableNetwork : public InferenceEngine::ExecutableNetworkInternal {
INFERENCE_ENGINE_DEPRECATED("Use InferRequest::QueryState instead")
std::vector<InferenceEngine::IVariableStateInternal::Ptr> QueryState() override {
IE_SUPPRESS_DEPRECATED_START
auto pluginStates = plg->QueryState();
std::vector<InferenceEngine::IVariableStateInternal::Ptr> state(pluginStates.begin(), pluginStates.end());
return plg->QueryState();
IE_SUPPRESS_DEPRECATED_END
}

View File

@ -308,12 +308,12 @@ void GNAModelSerial::Import(void *basePointer,
readBits(segmentSz, is);
uint32_t nameSize = 0;
readNBits<32>(nameSize, is);
std::string inName("", nameSize);
std::string inName(nameSize, '\0');
readNBytes(&inName[0], nameSize, is);
float scale_factor = 1.0f;
readBits(scale_factor, is);
if (pstates) {
(*pstates)[i] = std::make_tuple( pSegment, segmentSz, inName, scale_factor);
(*pstates)[i] = std::make_tuple( pSegment, segmentSz, inName.substr(0, nameSize - 1), scale_factor);
}
}
}
@ -617,12 +617,12 @@ void GNAModelSerial::Import(void *basePointer,
readBits(segmentSz, is);
uint32_t nameSize = 0;
readNBits<32>(nameSize, is);
std::string inName("", nameSize);
std::string inName(nameSize, '\0');
readNBytes(&inName[0], nameSize, is);
float scale_factor = 1.0f;
readBits(scale_factor, is);
if (pstates) {
(*pstates)[i] = std::make_tuple( pSegment, segmentSz, inName, scale_factor );
(*pstates)[i] = std::make_tuple( pSegment, segmentSz, inName.substr(0, nameSize - 1), scale_factor );
}
}
}

View File

@ -8,7 +8,6 @@
#include <vector>
#include <utility>
#include <ie_input_info.hpp>
#include <ie_icnn_network.hpp>
#include "descriptions/gna_input_desc.hpp"
#include "descriptions/gna_output_desc.hpp"
@ -158,7 +157,6 @@ private:
/**
* save gna graph to an outpus stream
* @param ptr_nnet
* @param basePtr
* @param gnaGraphSize
* @param os

View File

@ -19,7 +19,6 @@
#include <limits>
#include <legacy/graph_tools.hpp>
#include <cpp_interfaces/exception2status.hpp>
#include <legacy/net_pass.h>
#include <debug.h>
#include <gna/gna_config.hpp>

View File

@ -4,7 +4,6 @@
#include <string>
#include <unordered_set>
#include <ie_icnn_network.hpp>
#include <legacy/graph_tools.hpp>
#include "gna_layer_type.hpp"
#include "gna_layer_info.hpp"

View File

@ -7,7 +7,6 @@
#include <vector>
#include <string>
#include <ie_icnn_network.hpp>
#include <caseless.hpp>
#include "backend/dnn_types.h"

View File

@ -13,7 +13,6 @@
#include <xml_parse_utils.h>
#include "ie_itt.hpp"
#include "cpp_interfaces/exception2status.hpp"
#include "transformations/serialize.hpp"
#include "cpp/ie_cnn_network.h"
#include "details/ie_exception.hpp"

View File

@ -63,4 +63,21 @@ namespace InferenceEngine {
CATCH_IE_EXCEPTION(InferNotStarted) \
CATCH_IE_EXCEPTION(NetworkNotRead) \
CATCH_IE_EXCEPTION(InferCancelled)
#define CALL_STATUS_FNC(function, ...) \
if (!actual) IE_THROW() << "Wrapper used was not initialized."; \
ResponseDesc resp; \
auto res = actual->function(__VA_ARGS__, &resp); \
if (res != OK) IE_EXCEPTION_SWITCH(res, ExceptionType, \
InferenceEngine::details::ThrowNow<ExceptionType>{} \
<<= std::stringstream{} << IE_LOCATION << resp.msg)
#define CALL_STATUS_FNC_NO_ARGS(function) \
if (!actual) IE_THROW() << "Wrapper used in the CALL_STATUS_FNC_NO_ARGS was not initialized."; \
ResponseDesc resp; \
auto res = actual->function(&resp); \
if (res != OK) IE_EXCEPTION_SWITCH(res, ExceptionType, \
InferenceEngine::details::ThrowNow<ExceptionType>{} \
<<= std::stringstream{} << IE_LOCATION)
} // namespace InferenceEngine

View File

@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "ie_icnn_network.hpp"
#include "cpp/ie_cnn_network.h"
#include "exception2status.hpp"
#include "cnn_network_ngraph_impl.hpp"
#include "ie_itt.hpp"
@ -11,7 +11,7 @@
namespace InferenceEngine {
CNNNetwork::CNNNetwork() :
network(), actual(), output() {
network(), actual() {
}
CNNNetwork::CNNNetwork(std::shared_ptr<ICNNNetwork> network)
@ -123,4 +123,10 @@ void CNNNetwork::serialize(const std::string& xmlPath, const std::string& binPat
CALL_STATUS_FNC(serialize, xmlPath, binPath);
}
std::string CNNNetwork::getOVNameForTensor(const std::string& orig_name) const {
std::string ov_name;
CALL_STATUS_FNC(getOVNameForTensor, ov_name, orig_name);
return ov_name;
}
} // namespace InferenceEngine

View File

@ -2,15 +2,15 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "cpp/ie_executable_network.hpp"
#include "ie_common.h"
#include "cpp/ie_executable_network.hpp"
#include "ie_executable_network_base.hpp"
#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
#include "cpp_interfaces/exception2status.hpp"
#include "cpp_interfaces/base/ie_executable_network_base.hpp"
namespace InferenceEngine {
#define EXEC_NET_CALL_STATEMENT(...) \
#define EXEC_NET_CALL_STATEMENT(...) \
if (_impl == nullptr) IE_THROW() << "ExecutableNetwork was not initialized."; \
try { \
__VA_ARGS__; \
@ -58,7 +58,7 @@ std::vector<VariableState> ExecutableNetwork::QueryState() {
std::vector<VariableState> controller;
EXEC_NET_CALL_STATEMENT(
for (auto&& state : _impl->QueryState()) {
controller.emplace_back(std::make_shared<VariableStateBase>(state), _so);
controller.emplace_back(VariableState(state, _so));
});
return controller;
}

View File

@ -16,11 +16,11 @@
#include <ie_iexecutable_network.hpp>
#include <cpp/ie_executable_network.hpp>
#include <cpp_interfaces/base/ie_variable_state_base.hpp>
#include <cpp_interfaces/interface/ie_ivariable_state_internal.hpp>
#include <cpp_interfaces/interface/ie_iexecutable_network_internal.hpp>
#include "cpp_interfaces/exception2status.hpp"
#include "cpp_interfaces/base/ie_infer_async_request_base.hpp"
#include "cpp/exception2status.hpp"
#include "ie_variable_state_base.hpp"
#include "ie_infer_async_request_base.hpp"
namespace InferenceEngine {

View File

@ -8,9 +8,9 @@
#include <memory>
#include <string>
#include "cpp_interfaces/exception2status.hpp"
#include "cpp/exception2status.hpp"
#include "cpp_interfaces/plugin_itt.hpp"
#include <cpp_interfaces/base/ie_variable_state_base.hpp>
#include "ie_variable_state_base.hpp"
#include <cpp_interfaces/interface/ie_iinfer_request_internal.hpp>
#include "ie_iinfer_request.hpp"
#include "ie_preprocess.hpp"

View File

@ -6,11 +6,12 @@
#include <memory>
#include <string>
#include "cpp/ie_infer_request.hpp"
#include "cpp_interfaces/interface/ie_iinfer_request_internal.hpp"
#include "cpp_interfaces/base/ie_infer_async_request_base.hpp"
#include "ie_remote_context.hpp"
#include "cpp/ie_infer_request.hpp"
#include "ie_infer_async_request_base.hpp"
#include "cpp_interfaces/interface/ie_iinfer_request_internal.hpp"
namespace InferenceEngine {
#define CATCH_IE_EXCEPTION(ExceptionType) catch (const InferenceEngine::ExceptionType& e) {throw e;}
@ -30,8 +31,8 @@ namespace InferenceEngine {
CATCH_IE_EXCEPTION(NetworkNotRead) \
CATCH_IE_EXCEPTION(InferCancelled)
#define INFER_REQ_CALL_STATEMENT(...) \
if (_impl == nullptr) IE_THROW() << "Inference Requst is not initialized"; \
#define INFER_REQ_CALL_STATEMENT(...) \
if (_impl == nullptr) IE_THROW() << "Inference Request is not initialized"; \
try { \
__VA_ARGS__ \
} CATCH_IE_EXCEPTIONS catch (const std::exception& ex) { \
@ -197,7 +198,7 @@ std::vector<VariableState> InferRequest::QueryState() {
std::vector<VariableState> controller;
INFER_REQ_CALL_STATEMENT(
for (auto&& state : _impl->QueryState()) {
controller.emplace_back(std::make_shared<VariableStateBase>(state), _so);
controller.emplace_back(VariableState(state, _so));
}
)
return controller;

View File

@ -2,19 +2,31 @@
// SPDX-License-Identifier: Apache-2.0
//
#include "ie_imemory_state.hpp"
#include "cpp/ie_memory_state.hpp"
#include "cpp_interfaces/interface/ie_ivariable_state_internal.hpp"
#include "exception2status.hpp"
#define VARIABLE_CALL_STATEMENT(...) \
if (_impl == nullptr) IE_THROW() << "VariableState was not initialized."; \
try { \
__VA_ARGS__; \
} CATCH_IE_EXCEPTIONS catch (const std::exception& ex) { \
IE_THROW() << ex.what(); \
} catch (...) { \
IE_THROW(Unexpected); \
}
namespace InferenceEngine {
IE_SUPPRESS_DEPRECATED_START
VariableState::VariableState(IVariableState::Ptr pState, details::SharedObjectLoader::Ptr plg) : actual(pState), plugin(plg) {
if (actual == nullptr) {
IE_THROW() << "VariableState wrapper was not initialized.";
VariableState::VariableState(const std::shared_ptr<IVariableStateInternal>& impl,
const details::SharedObjectLoader::Ptr& so) : _impl(impl), _so(so) {
if (impl == nullptr) {
IE_THROW(NotAllocated) << "VariableState wrapper was not initialized.";
}
}
IE_SUPPRESS_DEPRECATED_START
Blob::CPtr VariableState::GetLastState() const {
return GetState();
}
@ -22,23 +34,19 @@ Blob::CPtr VariableState::GetLastState() const {
IE_SUPPRESS_DEPRECATED_END
void VariableState::Reset() {
CALL_STATUS_FNC_NO_ARGS(Reset);
VARIABLE_CALL_STATEMENT(_impl->Reset());
}
std::string VariableState::GetName() const {
char name[256];
CALL_STATUS_FNC(GetName, name, sizeof(name));
return name;
VARIABLE_CALL_STATEMENT(return _impl->GetName());
}
Blob::CPtr VariableState::GetState() const {
Blob::CPtr stateBlob;
CALL_STATUS_FNC(GetState, stateBlob);
return stateBlob;
VARIABLE_CALL_STATEMENT(return _impl->GetState());
}
void VariableState::SetState(Blob::Ptr state) {
CALL_STATUS_FNC(SetState, state);
VARIABLE_CALL_STATEMENT(_impl->SetState(state));
}
} // namespace InferenceEngine

View File

@ -6,7 +6,7 @@
#include <memory>
#include "cpp_interfaces/exception2status.hpp"
#include "cpp/exception2status.hpp"
#include "cpp_interfaces/impl/ie_variable_state_internal.hpp"
#include "ie_imemory_state.hpp"

View File

@ -17,7 +17,6 @@
#include <exec_graph_info.hpp>
#include <ngraph/opsets/opset.hpp>
#include <cpp_interfaces/exception2status.hpp>
namespace ExecGraphInfoSerialization {
//

View File

@ -16,7 +16,6 @@
#include <ngraph/graph_util.hpp>
#include <ngraph/pass/constant_folding.hpp>
#include <cpp_interfaces/exception2status.hpp>
#include "compilation_context.hpp"
#include "ie_plugin_cpp.hpp"
#include "ie_plugin_config.hpp"

View File

@ -17,21 +17,21 @@
#include "cpp/ie_executable_network.hpp"
#include "cpp/ie_cnn_network.h"
#include "ie_plugin_ptr.hpp"
#include "cpp_interfaces/exception2status.hpp"
#include "cpp/exception2status.hpp"
#if defined __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wreturn-type"
#endif
#define CALL_STATEMENT(...) \
if (!actual) IE_THROW() << "Wrapper used in the CALL_STATEMENT was not initialized."; \
try { \
__VA_ARGS__; \
} CATCH_IE_EXCEPTIONS catch (const std::exception& ex) { \
IE_THROW() << ex.what(); \
} catch (...) { \
IE_THROW(Unexpected); \
#define PLUGIN_CALL_STATEMENT(...) \
if (!actual) IE_THROW() << "Wrapper used in the PLUGIN_CALL_STATEMENT was not initialized."; \
try { \
__VA_ARGS__; \
} CATCH_IE_EXCEPTIONS catch (const std::exception& ex) { \
IE_THROW() << ex.what(); \
} catch (...) { \
IE_THROW(Unexpected); \
}
namespace InferenceEngine {
@ -61,71 +61,71 @@ public:
}
void SetName(const std::string & deviceName) {
CALL_STATEMENT(actual->SetName(deviceName));
PLUGIN_CALL_STATEMENT(actual->SetName(deviceName));
}
void SetCore(ICore* core) {
CALL_STATEMENT(actual->SetCore(core));
PLUGIN_CALL_STATEMENT(actual->SetCore(core));
}
const Version GetVersion() const {
CALL_STATEMENT(return actual->GetVersion());
PLUGIN_CALL_STATEMENT(return actual->GetVersion());
}
void AddExtension(InferenceEngine::IExtensionPtr extension) {
CALL_STATEMENT(actual->AddExtension(extension));
PLUGIN_CALL_STATEMENT(actual->AddExtension(extension));
}
void SetConfig(const std::map<std::string, std::string>& config) {
CALL_STATEMENT(actual->SetConfig(config));
PLUGIN_CALL_STATEMENT(actual->SetConfig(config));
}
ExecutableNetwork LoadNetwork(const CNNNetwork& network, const std::map<std::string, std::string>& config) {
CALL_STATEMENT(return ExecutableNetwork(actual->LoadNetwork(network, config), actual));
PLUGIN_CALL_STATEMENT(return ExecutableNetwork(actual->LoadNetwork(network, config), actual));
}
ExecutableNetwork LoadNetwork(const CNNNetwork& network, RemoteContext::Ptr context, const std::map<std::string, std::string>& config) {
CALL_STATEMENT(return ExecutableNetwork(actual->LoadNetwork(network, config, context), actual));
PLUGIN_CALL_STATEMENT(return ExecutableNetwork(actual->LoadNetwork(network, config, context), actual));
}
QueryNetworkResult QueryNetwork(const CNNNetwork& network,
const std::map<std::string, std::string>& config) const {
QueryNetworkResult res;
CALL_STATEMENT(res = actual->QueryNetwork(network, config));
PLUGIN_CALL_STATEMENT(res = actual->QueryNetwork(network, config));
if (res.rc != OK) IE_THROW() << res.resp.msg;
return res;
}
ExecutableNetwork ImportNetwork(const std::string& modelFileName,
const std::map<std::string, std::string>& config) {
CALL_STATEMENT(return ExecutableNetwork(actual->ImportNetwork(modelFileName, config), actual));
PLUGIN_CALL_STATEMENT(return ExecutableNetwork(actual->ImportNetwork(modelFileName, config), actual));
}
ExecutableNetwork ImportNetwork(std::istream& networkModel,
const std::map<std::string, std::string>& config) {
CALL_STATEMENT(return ExecutableNetwork(actual->ImportNetwork(networkModel, config), actual));
PLUGIN_CALL_STATEMENT(return ExecutableNetwork(actual->ImportNetwork(networkModel, config), actual));
}
ExecutableNetwork ImportNetwork(std::istream& networkModel,
const RemoteContext::Ptr& context,
const std::map<std::string, std::string>& config) {
CALL_STATEMENT(return ExecutableNetwork(actual->ImportNetwork(networkModel, context, config), actual));
PLUGIN_CALL_STATEMENT(return ExecutableNetwork(actual->ImportNetwork(networkModel, context, config), actual));
}
Parameter GetMetric(const std::string& name, const std::map<std::string, Parameter>& options) const {
CALL_STATEMENT(return actual->GetMetric(name, options));
PLUGIN_CALL_STATEMENT(return actual->GetMetric(name, options));
}
RemoteContext::Ptr CreateContext(const ParamMap& params) {
CALL_STATEMENT(return actual->CreateContext(params));
PLUGIN_CALL_STATEMENT(return actual->CreateContext(params));
}
RemoteContext::Ptr GetDefaultContext(const ParamMap& params) {
CALL_STATEMENT(return actual->GetDefaultContext(params));
PLUGIN_CALL_STATEMENT(return actual->GetDefaultContext(params));
}
Parameter GetConfig(const std::string& name, const std::map<std::string, Parameter>& options) const {
CALL_STATEMENT(return actual->GetConfig(name, options));
PLUGIN_CALL_STATEMENT(return actual->GetConfig(name, options));
}
/**
@ -145,7 +145,7 @@ public:
};
} // namespace InferenceEngine
#undef CALL_STATEMENT
#undef PLUGIN_CALL_STATEMENT
#if defined __GNUC__
# pragma GCC diagnostic pop

View File

@ -10,7 +10,6 @@
#pragma once
#include <caseless.hpp>
#include <ie_icnn_network.hpp>
#include <map>
#include <string>
#include <vector>

View File

@ -4,7 +4,6 @@
#pragma once
#include <ie_icnn_network.hpp>
#include <legacy/ie_layers.h>
#include <string>

View File

@ -13,7 +13,6 @@
#include "ie_metric_helpers.hpp"
#include <cpp_interfaces/base/ie_infer_async_request_base.hpp>
#include <multi-device/multi_device_config.hpp>
#include <ie_plugin_config.hpp>
#include "multi_device_exec_network.hpp"

View File

@ -6,7 +6,6 @@
#include "multi_device_infer_request.hpp"
#include <ie_input_info.hpp>
#include <ie_icnn_network.hpp>
#include <cpp_interfaces/interface/ie_iinfer_request_internal.hpp>
#include <blob_factory.hpp>

View File

@ -9,7 +9,6 @@
#include <string>
#include <vector>
#include "cpp_interfaces/base/ie_infer_async_request_base.hpp"
#include "cpp_interfaces/impl/ie_executable_network_internal.hpp"
#include "cpp_interfaces/impl/ie_infer_async_request_thread_safe_default.hpp"
#include "threading/ie_cpu_streams_executor.hpp"

View File

@ -9,7 +9,6 @@
#include <threading/ie_istreams_executor.hpp>
#include <cpp_interfaces/interface/ie_iinfer_request_internal.hpp>
#include <cpp_interfaces/exception2status.hpp>
#include <ie_system_conf.h>
#include <exception>

View File

@ -16,7 +16,6 @@
#include <string>
#include <limits>
#include "cpp_interfaces/base/ie_executable_network_base.hpp"
#include "cpp_interfaces/impl/ie_executable_network_internal.hpp"
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
#include "cpp_interfaces/plugin_itt.hpp"

View File

@ -8,7 +8,6 @@
#include <ie_common.h>
#include <ie_preprocess_data.hpp>
#include <ie_input_info.hpp>
#include <ie_icnn_network.hpp>
#include <cpp/ie_infer_request.hpp>
#include <map>

View File

@ -11,7 +11,6 @@
#include <ie_iextension.h>
#include <ie_input_info.hpp>
#include <ie_icnn_network.hpp>
#include <ie_icore.hpp>
#include <ie_parameter.hpp>
#include <ie_remote_context.hpp>

View File

@ -9,7 +9,6 @@
#include <ie_common.h>
#include <ie_iextension.h>
#include <ie_icnn_network.hpp>
#include <ie_reader.hpp>
#include <map>
#include <memory>

View File

@ -4,8 +4,6 @@
#pragma once
#include <ie_icnn_network.hpp>
#include <legacy/cnn_network_impl.hpp>
namespace pugi {

View File

@ -12,7 +12,6 @@
#include <memory>
#include <map>
#include <cpp_interfaces/exception2status.hpp>
#include <ie_plugin_config.hpp>
namespace vpu {

View File

@ -8,7 +8,6 @@
#include <utility>
#include <ie_input_info.hpp>
#include <ie_icnn_network.hpp>
#include <vpu/backend/blob_format.hpp>
#include <vpu/model/data_desc.hpp>

View File

@ -15,7 +15,6 @@
#include <utility>
#include <ie_icore.hpp>
#include <ie_icnn_network.hpp>
#include <caseless.hpp>
#include <vpu/utils/enums.hpp>

View File

@ -9,8 +9,6 @@
#include <functional>
#include <set>
#include <ie_icnn_network.hpp>
#include <vpu/model/base.hpp>
#include <vpu/model/edges.hpp>
#include <vpu/model/data.hpp>

View File

@ -13,7 +13,6 @@
#include <map>
#include <debug.h>
#include <cpp_interfaces/exception2status.hpp>
#include <ie_plugin_config.hpp>
#include <vpu/utils/string.hpp>

View File

@ -9,8 +9,6 @@
#include <unordered_map>
#include <unordered_set>
#include <cpp_interfaces/exception2status.hpp>
#include <vpu/vpu_plugin_config.hpp>
#include <vpu/myriad_config.hpp>

View File

@ -5,7 +5,6 @@
#include <gtest/gtest.h>
#include <cpp/ie_infer_request.hpp>
#include <cpp_interfaces/exception2status.hpp>
using namespace ::testing;
using namespace std;

View File

@ -22,7 +22,6 @@
#include <functional_test_utils/skip_tests_config.hpp>
#include <common_test_utils/common_utils.hpp>
#include <common_test_utils/test_assertions.hpp>
#include <cpp_interfaces/exception2status.hpp>
#ifdef ENABLE_UNICODE_PATH_SUPPORT
#include <iostream>

View File

@ -18,7 +18,6 @@
#include "multi-device/multi_device_config.hpp"
#include <string>
#include <ie_core.hpp>
#include <cpp_interfaces/exception2status.hpp>
#include <thread>
#include <base/behavior_test_utils.hpp>
#include "common_test_utils/common_utils.hpp"

View File

@ -15,7 +15,6 @@
#include "ngraph_functions/builders.hpp"
#include "multi-device/multi_device_config.hpp"
#include <ie_core.hpp>
#include <cpp_interfaces/exception2status.hpp>
#include <base/behavior_test_utils.hpp>
#include "common_test_utils/common_utils.hpp"
#include "functional_test_utils/plugin_cache.hpp"

View File

@ -15,7 +15,6 @@
#include "ngraph_functions/builders.hpp"
#include "multi-device/multi_device_config.hpp"
#include <ie_core.hpp>
#include <cpp_interfaces/exception2status.hpp>
#include <base/behavior_test_utils.hpp>
#include "common_test_utils/common_utils.hpp"
#include "functional_test_utils/plugin_cache.hpp"

View File

@ -7,10 +7,10 @@
#include <string>
#include <ie_data.h>
#include <ie_input_info.hpp>
#include <ie_blob.h>
#include <ie_common.h>
#include <ie_preprocess.hpp>
#include <ie_icnn_network.hpp>
inline bool strContains(const std::string & str, const std::string & substr) {
return str.find(substr) != std::string::npos;

View File

@ -11,7 +11,6 @@
#include <gmock/gmock.h>
#include "ie_input_info.hpp"
#include "ie_icnn_network.hpp"
#include <cpp_interfaces/impl/ie_executable_network_internal.hpp>
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinfer_request_internal.hpp"

View File

@ -8,7 +8,6 @@
#include <string>
#include "mock_plugin.hpp"
#include <cpp_interfaces/exception2status.hpp>
#include "description_buffer.hpp"
using namespace std;

View File

@ -8,7 +8,6 @@
#include <string>
#include <cpp_interfaces/impl/ie_plugin_internal.hpp>
#include <ie_icnn_network.hpp>
class MockPlugin : public InferenceEngine::InferencePluginInternal {
InferenceEngine::IInferencePlugin * _target = nullptr;

View File

@ -4,7 +4,7 @@
#include <gtest/gtest.h>
#include <cpp_interfaces/exception2status.hpp>
#include <cpp/exception2status.hpp>
using namespace InferenceEngine;

View File

@ -1,68 +0,0 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <gtest/gtest.h>
#include <gmock/gmock-spec-builders.h>
#include <cpp_interfaces/base/ie_executable_network_base.hpp>
#include "unit_test_utils/mocks/cpp_interfaces/impl/mock_executable_thread_safe_default.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinfer_request_internal.hpp"
using namespace ::testing;
using namespace std;
using namespace InferenceEngine;
using namespace InferenceEngine::details;
IE_SUPPRESS_DEPRECATED_START
class ExecutableNetworkThreadSafeTests : public ::testing::Test {
protected:
shared_ptr<MockExecutableNetworkThreadSafe> mockExeNetwork;
shared_ptr<IExecutableNetwork> exeNetwork;
shared_ptr<MockIInferRequestInternal> mockInferRequestInternal;
ResponseDesc dsc;
StatusCode sts;
virtual void TearDown() {
EXPECT_TRUE(Mock::VerifyAndClearExpectations(mockInferRequestInternal.get()));
EXPECT_TRUE(Mock::VerifyAndClearExpectations(mockExeNetwork.get()));
}
virtual void SetUp() {
mockExeNetwork = make_shared<MockExecutableNetworkThreadSafe>();
exeNetwork = std::make_shared<ExecutableNetworkBase>(mockExeNetwork);
InputsDataMap networkInputs;
OutputsDataMap networkOutputs;
mockInferRequestInternal = make_shared<MockIInferRequestInternal>(networkInputs, networkOutputs);
}
};
TEST_F(ExecutableNetworkThreadSafeTests, createInferRequestCallsThreadSafeImplAndSetNetworkIO) {
IInferRequest::Ptr req;
EXPECT_CALL(*mockExeNetwork.get(), CreateInferRequestImpl(_, _)).WillOnce(Return(mockInferRequestInternal));
EXPECT_NO_THROW(exeNetwork->CreateInferRequest(req, &dsc));
auto threadSafeReq = dynamic_pointer_cast<InferRequestBase>(req);
ASSERT_NE(threadSafeReq, nullptr);
}
TEST_F(ExecutableNetworkThreadSafeTests, returnErrorIfInferThrowsException) {
IInferRequest::Ptr req;
EXPECT_CALL(*mockExeNetwork.get(), CreateInferRequestImpl(_, _)).WillOnce(Return(mockInferRequestInternal));
EXPECT_NO_THROW(exeNetwork->CreateInferRequest(req, &dsc));
EXPECT_CALL(*mockInferRequestInternal.get(), checkBlobs()).WillOnce(Throw(std::runtime_error("")));
EXPECT_NO_THROW(sts = req->Infer(&dsc));
ASSERT_EQ(StatusCode::GENERAL_ERROR, sts) << dsc.msg;
}
TEST_F(ExecutableNetworkThreadSafeTests, returnErrorIfStartAsyncThrowsException) {
IInferRequest::Ptr req;
EXPECT_CALL(*mockExeNetwork.get(), CreateInferRequestImpl(_, _)).WillOnce(Return(mockInferRequestInternal));
EXPECT_NO_THROW(exeNetwork->CreateInferRequest(req, &dsc));
EXPECT_CALL(*mockInferRequestInternal.get(), InferImpl()).WillOnce(Throw(std::runtime_error("")));
EXPECT_NO_THROW(sts = req->StartAsync(&dsc));
ASSERT_TRUE(StatusCode::OK == sts) << dsc.msg;
EXPECT_NO_THROW(sts = req->Wait(InferRequest::WaitMode::RESULT_READY, &dsc));
ASSERT_EQ(StatusCode::GENERAL_ERROR, sts) << dsc.msg;
}

View File

@ -9,8 +9,7 @@
#include <cpp/ie_infer_request.hpp>
#include <cpp/ie_executable_network.hpp>
#include <ie_plugin_cpp.hpp>
#include <cpp_interfaces/exception2status.hpp>
#include <cpp_interfaces/base/ie_infer_async_request_base.hpp>
#include <cpp/ie_infer_async_request_base.hpp>
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iinference_plugin.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp"

View File

@ -9,7 +9,7 @@
#include <inference_engine.hpp>
#include <cpp_interfaces/impl/ie_infer_async_request_thread_safe_default.hpp>
#include <cpp_interfaces/base/ie_infer_async_request_base.hpp>
#include <cpp/ie_infer_async_request_base.hpp>
#include <threading/ie_cpu_streams_executor.hpp>
#include "unit_test_utils/mocks/cpp_interfaces/mock_task_executor.hpp"

View File

@ -6,8 +6,8 @@
#include <gmock/gmock-spec-builders.h>
#include <cpp/ie_executable_network.hpp>
#include <cpp_interfaces/base/ie_executable_network_base.hpp>
#include <cpp_interfaces/base/ie_infer_async_request_base.hpp>
#include <cpp/ie_executable_network_base.hpp>
#include <cpp/ie_infer_async_request_base.hpp>
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_ivariable_state_internal.hpp"
#include "unit_test_utils/mocks/cpp_interfaces/interface/mock_iexecutable_network_internal.hpp"

View File

@ -8,7 +8,7 @@
#include <ie_version.hpp>
#include <ie_plugin_cpp.hpp>
#include <cpp_interfaces/base/ie_infer_async_request_base.hpp>
#include <cpp/ie_infer_async_request_base.hpp>
#include <cpp_interfaces/interface/ie_iexecutable_network_internal.hpp>
#include "unit_test_utils/mocks/mock_not_empty_icnn_network.hpp"

View File

@ -7,9 +7,7 @@
#include <gmock/gmock.h>
#include "ie_common.h"
#include "cpp_interfaces/exception2status.hpp"
// TODO: cover <cpp_interfaces/exception2status.hpp> and <details/ie_exception_conversion.hpp> from
// tests/unit/inference_engine/exception_test.cpp
TEST(ExceptionTests, CanThrowUsingMacro) {

View File

@ -8,6 +8,7 @@
#include <vector>
#include "cpp/ie_executable_network.hpp"
#include "cpp/ie_executable_network_base.hpp"
#include "ie_plugin_cpp.hpp"
#include "unit_test_utils/mocks/mock_iexecutable_network.hpp"

View File

@ -13,7 +13,6 @@
#include <vpu/private_plugin_config.hpp>
#include <gna/gna_config.hpp>
#include <multi-device/multi_device_config.hpp>
#include <cpp_interfaces/exception2status.hpp>
#include <common_test_utils/test_assertions.hpp>
#include <memory>
#include <fstream>

View File

@ -9,7 +9,6 @@
#include <gtest/gtest.h>
#include "base_matcher.hpp"
#include <math.h>
#include <ie_icnn_network.hpp>
namespace Regression {
namespace Matchers {

View File

@ -18,7 +18,6 @@
#include <legacy/ie_layers.h>
#include <ie_blob.h>
#include <ie_input_info.hpp>
#include <ie_icnn_network.hpp>
#include "test_model_repo.hpp"
#include "test_model_path.hpp"
@ -166,14 +165,6 @@ public:
# error Unsupported architecture
#endif
inline InferenceEngine::InputInfo::Ptr getFirstInput(InferenceEngine::ICNNNetwork *pNet)
{
InferenceEngine::InputsDataMap inputs;
pNet->getInputsInfo(inputs);
//ASSERT_GT(inputs.size(), 0);
return inputs.begin()->second;
}
/**
* @brief Splits the RGB channels to either I16 Blob or float blob.
*

View File

@ -18,7 +18,6 @@
#include <legacy/graph_tools.hpp>
#include <ngraph/function.hpp>
#include <ie_precision.hpp>
#include <ie_icnn_network.hpp>
#include <ie_blob.h>
#include <ie_plugin_config.hpp>
#include <cpp/ie_cnn_network.h>

View File

@ -20,10 +20,6 @@ public:
}
};
struct TestExecutableNetworkBase : public InferenceEngine::ExecutableNetworkBase {
using InferenceEngine::ExecutableNetworkBase::_impl;
};
static MKLDNNPlugin::MKLDNNGraph& getGraph(InferenceEngine::IExecutableNetworkInternal::Ptr execNetwork) {
return static_cast<MKLDNNTestExecNetwork*>(execNetwork.get())->getGraph();
}