Moved plugin to hidden folder (#999)

This commit is contained in:
Ilya Lavrenov
2020-06-19 21:04:12 +03:00
committed by GitHub
parent 79ff221957
commit 0b2827e027
35 changed files with 22 additions and 82 deletions

View File

@@ -1,182 +0,0 @@
// Copyright (C) 2018-2020 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 "cpp/ie_executable_network.hpp"
#include "details/ie_exception_conversion.hpp"
#include "cpp/ie_cnn_network.h"
#include "ie_plugin.hpp"
#include "ie_plugin_ptr.hpp"
namespace InferenceEngine {
/**
* @deprecated Use InferenceEngine::Core instead. Will be removed in 2021.1
* @brief This class is a C++ API wrapper for IInferencePlugin.
*
* It can throw exceptions safely for the application, where it is properly handled.
*/
class INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::Core instead. Will be removed in 2021.1") InferencePlugin {
IE_SUPPRESS_DEPRECATED_START
InferenceEnginePluginPtr actual;
public:
/** @brief A default constructor */
InferencePlugin() = default;
/**
* @brief Constructs a plugin instance from the given pointer.
*
* @param pointer Initialized Plugin pointer
*/
explicit InferencePlugin(const InferenceEnginePluginPtr& pointer): actual(pointer) {
if (actual == nullptr) {
THROW_IE_EXCEPTION << "InferencePlugin wrapper was not initialized.";
}
}
IE_SUPPRESS_DEPRECATED_END
/**
* @copybrief IInferencePlugin::GetVersion
*
* Wraps IInferencePlugin::GetVersion
* @return A plugin version
*/
const Version* GetVersion() {
const Version* versionInfo = nullptr;
IE_SUPPRESS_DEPRECATED_START
if (actual == nullptr) THROW_IE_EXCEPTION << "InferencePlugin wrapper was not initialized";
actual->GetVersion(versionInfo);
IE_SUPPRESS_DEPRECATED_END
if (versionInfo == nullptr) {
THROW_IE_EXCEPTION << "Unknown device is used";
}
return versionInfo;
}
/**
* @copybrief IInferencePlugin::LoadNetwork
*
* Wraps IInferencePlugin::LoadNetwork
*
* @param network A network object to load
* @param config A map of configuration options
* @return Created Executable Network object
*/
ExecutableNetwork LoadNetwork(const ICNNNetwork& network, const std::map<std::string, std::string>& config) {
IExecutableNetwork::Ptr ret;
IE_SUPPRESS_DEPRECATED_START
CALL_STATUS_FNC(LoadNetwork, ret, network, config);
return ExecutableNetwork(ret, actual);
IE_SUPPRESS_DEPRECATED_END
}
/**
* @copybrief InferencePlugin::LoadNetwork
*
* Wraps IInferencePlugin::LoadNetwork
* @param network A network object to load
* @param config A map of configuration options
* @return Created Executable Network object
*/
ExecutableNetwork LoadNetwork(CNNNetwork network, const std::map<std::string, std::string>& config) {
IExecutableNetwork::Ptr ret;
IE_SUPPRESS_DEPRECATED_START
CALL_STATUS_FNC(LoadNetwork, ret, network, config);
if (ret.get() == nullptr) THROW_IE_EXCEPTION << "Internal error: pointer to executable network is null";
return ExecutableNetwork(ret, actual);
IE_SUPPRESS_DEPRECATED_END
}
/**
* @copybrief IInferencePlugin::AddExtension
*
* Wraps IInferencePlugin::AddExtension
*
* @param extension Pointer to loaded Extension
*/
void AddExtension(InferenceEngine::IExtensionPtr extension) {
IE_SUPPRESS_DEPRECATED_START
CALL_STATUS_FNC(AddExtension, extension);
IE_SUPPRESS_DEPRECATED_END
}
/**
* @copybrief IInferencePlugin::SetConfig
*
* Wraps IInferencePlugin::SetConfig
* @param config A configuration map
*/
void SetConfig(const std::map<std::string, std::string>& config) {
IE_SUPPRESS_DEPRECATED_START
CALL_STATUS_FNC(SetConfig, config);
IE_SUPPRESS_DEPRECATED_END
}
/**
* @copybrief IInferencePlugin::ImportNetwork
*
* Wraps IInferencePlugin::ImportNetwork
* @param modelFileName A path to the imported network
* @param config A configuration map
* @return Created Executable Network object
*/
ExecutableNetwork ImportNetwork(const std::string& modelFileName,
const std::map<std::string, std::string>& config) {
IExecutableNetwork::Ptr ret;
IE_SUPPRESS_DEPRECATED_START
CALL_STATUS_FNC(ImportNetwork, ret, modelFileName, config);
return ExecutableNetwork(ret, actual);
IE_SUPPRESS_DEPRECATED_END
}
/**
* @copybrief IInferencePlugin::QueryNetwork
*
* Wraps IInferencePlugin::QueryNetwork
*
* @param network A network object to query
* @param config A configuration map
* @param res Query results
*/
void QueryNetwork(const ICNNNetwork& network, const std::map<std::string, std::string>& config,
QueryNetworkResult& res) const {
IE_SUPPRESS_DEPRECATED_START
if (actual == nullptr) THROW_IE_EXCEPTION << "InferencePlugin wrapper was not initialized";
actual->QueryNetwork(network, config, res);
IE_SUPPRESS_DEPRECATED_END
if (res.rc != OK) THROW_IE_EXCEPTION << res.resp.msg;
}
IE_SUPPRESS_DEPRECATED_START
/**
* @brief Converts InferenceEngine to InferenceEnginePluginPtr pointer
*
* @return Wrapped object
*/
operator InferenceEngine::InferenceEnginePluginPtr() {
return actual;
}
/**
* @brief Shared pointer on InferencePlugin object
*
*/
using Ptr = std::shared_ptr<InferencePlugin>;
IE_SUPPRESS_DEPRECATED_END
};
} // namespace InferenceEngine

View File

@@ -1,120 +0,0 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
/**
* @brief A header file for Main Inference Engine API
*
* @file ie_plugin.hpp
*/
#pragma once
#include <ie_iextension.h>
#include <ie_icnn_network.hpp>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <vector>
#include "details/ie_no_copy.hpp"
#include "ie_api.h"
#include "ie_core.hpp"
#include "ie_iexecutable_network.hpp"
#include "ie_version.hpp"
namespace InferenceEngine {
/**
* @deprecated Use InferenceEngine::Core instead. Will be removed in 2021.1
* @brief This class is a main plugin interface
*/
class INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::Core instead. Will be removed in 2021.1")
INFERENCE_ENGINE_API_CLASS(IInferencePlugin)
: public details::IRelease {
public:
/**
* @brief Returns plugin version information
*
* @param versionInfo Pointer to version info. Is set by plugin
*/
virtual void GetVersion(const Version*& versionInfo) noexcept = 0;
/**
* @brief Creates an executable network from a network object. User can create as many networks as they need and use
* them simultaneously (up to the limitation of the hardware resources)
*
* @param ret Reference to a shared ptr of the returned network interface
* @param network Network object acquired from Core::ReadNetwork
* @param config Map of pairs: (config parameter name, config parameter value) relevant only for this load operation
* @param resp Pointer to the response message that holds a description of an error if any occurred
* @return Status code of the operation. InferenceEngine::OK if succeeded
*/
virtual StatusCode LoadNetwork(IExecutableNetwork::Ptr& ret, const ICNNNetwork& network,
const std::map<std::string, std::string>& config, ResponseDesc* resp) noexcept = 0;
/**
* @brief Creates an executable network from a previously exported network
*
* @param ret Reference to a shared ptr of the returned network interface
* @param modelFileName Path to the location of the exported file
* @param config Map of pairs: (config parameter name, config parameter value) relevant only for this load
* operation*
* @param resp Pointer to the response message that holds a description of an error if any occurred
* @return Status code of the operation. InferenceEngine::OK if succeeded
*/
virtual StatusCode ImportNetwork(IExecutableNetwork::Ptr& ret, const std::string& modelFileName,
const std::map<std::string, std::string>& config, ResponseDesc* resp) noexcept = 0;
/**
* @brief Registers extension within the plugin
*
* @param extension Pointer to already loaded extension
* @param resp Pointer to the response message that holds a description of an error if any occurred
* @return Status code of the operation. InferenceEngine::OK if succeeded
*/
virtual StatusCode AddExtension(InferenceEngine::IExtensionPtr extension,
InferenceEngine::ResponseDesc* resp) noexcept = 0;
/**
* @brief Sets configuration for plugin, acceptable keys can be found in ie_plugin_config.hpp
*
* @param config Map of pairs: (config parameter name, config parameter value)
* @param resp Pointer to the response message that holds a description of an error if any occurred
* @return Status code of the operation. InferenceEngine::OK if succeeded
*/
virtual StatusCode SetConfig(const std::map<std::string, std::string>& config, ResponseDesc* resp) noexcept = 0;
/**
* @brief Query plugin if it supports specified network with specified configuration
*
* @param network Network object to query
* @param config Map of pairs: (config parameter name, config parameter value)
* @param res Reference to query network result
*/
virtual void QueryNetwork(const ICNNNetwork& network, const std::map<std::string, std::string>& config,
QueryNetworkResult& res) const noexcept {
(void)network;
(void)config;
res.rc = InferenceEngine::NOT_IMPLEMENTED;
}
/**
* @brief A default virtual destructor
*/
~IInferencePlugin() override;
};
/**
* @brief Creates the default instance of the interface (per plugin)
*
* @param plugin Pointer to the plugin
* @param resp Pointer to the response message that holds a description of an error if any occurred
* @return Status code of the operation. InferenceEngine::OK if succeeded
*/
IE_SUPPRESS_DEPRECATED_START
INFERENCE_PLUGIN_API(StatusCode) CreatePluginEngine(IInferencePlugin*& plugin, ResponseDesc* resp) noexcept;
IE_SUPPRESS_DEPRECATED_END
} // namespace InferenceEngine

View File

@@ -1,47 +0,0 @@
// Copyright (C) 2018-2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
/**
* @brief A header file contains a wrapper class for handling plugin instantiation and releasing resources
*
* @file ie_plugin_ptr.hpp
*/
#pragma once
#include <string>
#include "details/ie_so_pointer.hpp"
#include "ie_extension.h"
#include "ie_plugin.hpp"
namespace InferenceEngine {
namespace details {
IE_SUPPRESS_DEPRECATED_START
/**
* @deprecated Use InferenceEngine::Core instead. This API will be removed in 2021.1 release.
* @brief This class defines the name of the fabric for creating an IInferencePlugin object in DLL
*/
template <>
class INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::Core instead") SOCreatorTrait<IInferencePlugin> {
public:
/**
* @brief A name of the fabric for creating IInferencePlugin object in DLL
*/
static constexpr auto name = "CreatePluginEngine";
};
} // namespace details
/**
* @brief A C++ helper to work with objects created by the plugin.
*
* Implements different interfaces.
*/
using InferenceEnginePluginPtr = InferenceEngine::details::SOPointer<IInferencePlugin>;
IE_SUPPRESS_DEPRECATED_END
} // namespace InferenceEngine

View File

@@ -13,7 +13,6 @@
#include <ie_layers.h>
#include <cpp/ie_cnn_net_reader.h>
#include <cpp/ie_executable_network.hpp>
#include <cpp/ie_plugin_cpp.hpp>
#include <ie_core.hpp>
#include <ie_icnn_network.hpp>
#include <ie_plugin_config.hpp>