From fe7f08ca569bdab0451e815371dea717052d31d4 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 24 Jun 2020 15:12:14 +0300 Subject: [PATCH] Exec extensions (#963) * Fixes * Removed some tests for extensions * Added const * Removed unknown pragma --- inference-engine/include/ie_extension.h | 36 ----------- inference-engine/include/ie_iextension.h | 70 ---------------------- .../src/convert_function_to_cnn_network.cpp | 2 +- .../src/mkldnn_plugin/mkldnn_extension_mngr.cpp | 9 +-- .../src/mkldnn_plugin/mkldnn_extension_mngr.h | 3 +- inference-engine/src/mkldnn_plugin/nodes/base.hpp | 6 -- inference-engine/src/mkldnn_plugin/nodes/list.hpp | 35 +++++++++-- .../mkldnn_plugin/nodes/mkldnn_generic_node.cpp | 2 - .../src/mkldnn_plugin/nodes/mkldnn_generic_node.h | 3 - .../extension_lib/include/extension.hpp | 24 -------- .../inference_engine/ngraph_reshape_tests.cpp | 11 ---- .../unit/inference_engine/ie_extension_test.cpp | 25 -------- .../functional/mkldnn/CMakeLists.txt | 3 +- .../mkldnn/extensions_tests/extensions_test.cpp | 48 +-------------- .../engines/mkldnn/constant_propagation_test.cpp | 2 +- .../mkldnn/graph/layers/extensions/fake_layer.cpp | 2 +- .../graph/layers/extensions/graph_generic_test.cpp | 2 +- .../graph/structure/graph_optimization_test.cpp | 3 +- 18 files changed, 42 insertions(+), 244 deletions(-) diff --git a/inference-engine/include/ie_extension.h b/inference-engine/include/ie_extension.h index 83f81ac..e9c860c 100644 --- a/inference-engine/include/ie_extension.h +++ b/inference-engine/include/ie_extension.h @@ -38,7 +38,6 @@ public: /** * @brief This class is a C++ helper to work with objects created using extensions. */ -IE_SUPPRESS_DEPRECATED_START_WIN class INFERENCE_ENGINE_API_CLASS(Extension) : public IExtension { public: /** @@ -70,41 +69,6 @@ public: void Release() noexcept override {} /** - * @deprecated Use IExtension::getImplTypes to get implementation types for a particular node. - * The method will removed in 2021.1 release. - * @brief Gets the array with types of layers which are included in the extension - * - * @param types Types array - * @param size Size of the types array - * @param resp Response descriptor - * @return Status code - */ - INFERENCE_ENGINE_DEPRECATED("Use IExtension::getImplTypes to get implementation types for a particular node") - StatusCode getPrimitiveTypes(char**& types, unsigned int& size, ResponseDesc* resp) noexcept override { - IE_SUPPRESS_DEPRECATED_START - return actual->getPrimitiveTypes(types, size, resp); - IE_SUPPRESS_DEPRECATED_END - } - - /** - * @deprecated Use IExtension::getImplementation to get a concrete implementation. - * The method will be removed in 2021.1 release. - * @brief Gets the factory with implementations for a given layer - * - * @param factory Factory with implementations - * @param cnnLayer A layer to get the factory for - * @param resp Response descriptor - * @return Status code - */ - IE_SUPPRESS_DEPRECATED_START - INFERENCE_ENGINE_DEPRECATED("Use IExtension::getImplementation to get a concrete implementation") - StatusCode getFactoryFor(ILayerImplFactory*& factory, const CNNLayer* cnnLayer, - ResponseDesc* resp) noexcept override { - return actual->getFactoryFor(factory, cnnLayer, resp); - } - IE_SUPPRESS_DEPRECATED_END - - /** * @brief Returns operation sets * This method throws an exception if it was not implemented * @return map of opset name to opset diff --git a/inference-engine/include/ie_iextension.h b/inference-engine/include/ie_iextension.h index 5a4e8ee..c9ffa9b 100644 --- a/inference-engine/include/ie_iextension.h +++ b/inference-engine/include/ie_iextension.h @@ -145,81 +145,11 @@ public: }; /** - * @deprecated Implement IExtension::getImplTypes and IExtension::getImplementation - * The interface will be removed in 2021.1 release. - * @interface ILayerImplFactory - * @brief This class provides interface for extension factories - */ -class INFERENCE_ENGINE_DEPRECATED("Implement IExtension::getImplTypes and IExtension::getImplementation") ILayerImplFactory { -public: - /** - * @brief A shared pointer to the ILayerImplFactory interface - */ - IE_SUPPRESS_DEPRECATED_START - using Ptr = std::shared_ptr; - IE_SUPPRESS_DEPRECATED_END - - using ImplCreator = std::function; - - /** - * @brief Destructor - */ - virtual ~ILayerImplFactory() = default; - - /** - * @brief Gets all possible implementations for the given cnn Layer - * - * @param impls the vector with implementations which is ordered by priority - * @param resp response descriptor - * @return status code - */ - virtual StatusCode getImplementations(std::vector& impls, ResponseDesc* resp) noexcept = 0; -}; - -/** * @brief This class is the main extension interface */ class INFERENCE_ENGINE_API_CLASS(IExtension) : public InferenceEngine::details::IRelease { public: /** - * @deprecated Use IExtension::getImplementation to get a concrete implementation - * The method will be removed in 2021.1 release. - * @brief Provides a factory for a specified CNNLayer - * @param factory A factory returned from an extension plugin - * @param cnnLayer A CNNLayer object to provide factory for - * @param resp Response descriptor - * @return Status code - */ - IE_SUPPRESS_DEPRECATED_START - INFERENCE_ENGINE_DEPRECATED("Use IExtension::getImplementation to get a concrete implementation") - virtual StatusCode getFactoryFor(ILayerImplFactory*& factory, const CNNLayer* cnnLayer, - ResponseDesc* resp) noexcept { - (void)factory; - (void)cnnLayer; - (void)resp; - return NOT_IMPLEMENTED; - } - IE_SUPPRESS_DEPRECATED_END - - /** - * @deprecated Use IExtension::getImplTypes to get implementation types for a particular node - * The method will be removed in 2021.1 release. - * @brief Fills passed array with types of layers which kernel implementations are included in the extension - * - * @param types Array to store the layer types - * @param size Size of the layer types array - * @param resp Response descriptor - * @return Status code - */ - INFERENCE_ENGINE_DEPRECATED("Use IExtension::getImplTypes to get implementation types for a particular node") - virtual StatusCode getPrimitiveTypes(char**& types, unsigned int& size, ResponseDesc* resp) noexcept { - (void)types; - (void)size; - (void)resp; - return NOT_IMPLEMENTED; - } - - /** * @brief Returns operation sets * This method throws an exception if it was not implemented * @return map of opset name to opset diff --git a/inference-engine/src/legacy_api/src/convert_function_to_cnn_network.cpp b/inference-engine/src/legacy_api/src/convert_function_to_cnn_network.cpp index 951dc19..a9838f9 100644 --- a/inference-engine/src/legacy_api/src/convert_function_to_cnn_network.cpp +++ b/inference-engine/src/legacy_api/src/convert_function_to_cnn_network.cpp @@ -511,7 +511,7 @@ std::shared_ptr convertFunctionToICNNNetwork(const std::shared_p this->node = node; } }; - static std::vector> convertors = { + const static std::vector> convertors = { std::make_shared>(), std::make_shared>(), std::make_shared>(), diff --git a/inference-engine/src/mkldnn_plugin/mkldnn_extension_mngr.cpp b/inference-engine/src/mkldnn_plugin/mkldnn_extension_mngr.cpp index a4933ac..39d1b7f 100644 --- a/inference-engine/src/mkldnn_plugin/mkldnn_extension_mngr.cpp +++ b/inference-engine/src/mkldnn_plugin/mkldnn_extension_mngr.cpp @@ -31,8 +31,6 @@ InferenceEngine::ILayerImpl::Ptr MKLDNNExtensionManager::CreateImplementation(co return nullptr; } -IE_SUPPRESS_DEPRECATED_START - std::shared_ptr MKLDNNExtensionManager::CreateExtensionFactory( const InferenceEngine::CNNLayerPtr &layer) { if (!layer) @@ -40,9 +38,10 @@ std::shared_ptr MKLDNNExtensionManager::Crea std::shared_ptr factory; for (auto& ext : _extensions) { ResponseDesc responseDesc; - StatusCode rc; + StatusCode rc = GENERAL_ERROR; ILayerImplFactory* factory_ptr = nullptr; - rc = ext->getFactoryFor(factory_ptr, layer.get(), &responseDesc); + if (auto mkldnnExt = std::dynamic_pointer_cast(ext)) + rc = mkldnnExt->getFactoryFor(factory_ptr, layer.get(), &responseDesc); if (rc != OK) { factory = nullptr; continue; @@ -55,5 +54,3 @@ std::shared_ptr MKLDNNExtensionManager::Crea } return factory; } - -IE_SUPPRESS_DEPRECATED_END diff --git a/inference-engine/src/mkldnn_plugin/mkldnn_extension_mngr.h b/inference-engine/src/mkldnn_plugin/mkldnn_extension_mngr.h index 461ec8e..fdc34bc 100644 --- a/inference-engine/src/mkldnn_plugin/mkldnn_extension_mngr.h +++ b/inference-engine/src/mkldnn_plugin/mkldnn_extension_mngr.h @@ -10,6 +10,7 @@ #include #include #include "ie_ishape_infer_extension.hpp" +#include "nodes/list.hpp" namespace MKLDNNPlugin { @@ -18,9 +19,7 @@ public: using Ptr = std::shared_ptr; MKLDNNExtensionManager() = default; InferenceEngine::ILayerImpl::Ptr CreateImplementation(const std::shared_ptr& op); - IE_SUPPRESS_DEPRECATED_START std::shared_ptr CreateExtensionFactory(const InferenceEngine::CNNLayerPtr& Layer); - IE_SUPPRESS_DEPRECATED_END void AddExtension(InferenceEngine::IExtensionPtr extension); private: diff --git a/inference-engine/src/mkldnn_plugin/nodes/base.hpp b/inference-engine/src/mkldnn_plugin/nodes/base.hpp index db02688..3f17db3 100644 --- a/inference-engine/src/mkldnn_plugin/nodes/base.hpp +++ b/inference-engine/src/mkldnn_plugin/nodes/base.hpp @@ -153,8 +153,6 @@ protected: std::vector confs; }; -IE_SUPPRESS_DEPRECATED_START - template class ImplFactory : public ILayerImplFactory { public: @@ -174,16 +172,12 @@ protected: InferenceEngine::CNNLayerPtr cnnLayer; }; -IE_SUPPRESS_DEPRECATED_END - template inline void extRegister(MKLDNNExtensions * extInstance, const char * __type) { - IE_SUPPRESS_DEPRECATED_START extInstance->AddExt(__type, [](const CNNLayer* layer) -> InferenceEngine::ILayerImplFactory* { return new __prim(layer); }); - IE_SUPPRESS_DEPRECATED_END } #define REG_FACTORY_FOR(__prim, __type) \ diff --git a/inference-engine/src/mkldnn_plugin/nodes/list.hpp b/inference-engine/src/mkldnn_plugin/nodes/list.hpp index 92b7d89..a58ca3e 100644 --- a/inference-engine/src/mkldnn_plugin/nodes/list.hpp +++ b/inference-engine/src/mkldnn_plugin/nodes/list.hpp @@ -13,10 +13,34 @@ #include namespace InferenceEngine { + +class ILayerImplFactory { +public: + /** + * @brief A shared pointer to the ILayerImplFactory interface + */ + using Ptr = std::shared_ptr; + + using ImplCreator = std::function; + + /** + * @brief Destructor + */ + virtual ~ILayerImplFactory() = default; + + /** + * @brief Gets all possible implementations for the given cnn Layer + * + * @param impls the vector with implementations which is ordered by priority + * @param resp response descriptor + * @return status code + */ + virtual StatusCode getImplementations(std::vector& impls, ResponseDesc* resp) noexcept = 0; +}; + namespace Extensions { namespace Cpu { -IE_SUPPRESS_DEPRECATED_START using ext_factory = std::function; struct ExtensionsHolder { @@ -27,13 +51,14 @@ class MKLDNNExtensions : public IExtension { public: MKLDNNExtensions(); - StatusCode getPrimitiveTypes(char**& types, unsigned int& size, ResponseDesc* resp) noexcept override { + virtual StatusCode + getPrimitiveTypes(char**& types, unsigned int& size, ResponseDesc* resp) noexcept { collectTypes(types, size, extensionsHolder->list); return OK; } - StatusCode - getFactoryFor(ILayerImplFactory*& factory, const CNNLayer* cnnLayer, ResponseDesc* resp) noexcept override { + virtual StatusCode + getFactoryFor(ILayerImplFactory*& factory, const CNNLayer* cnnLayer, ResponseDesc* resp) noexcept { auto& factories = extensionsHolder->list; if (factories.find(cnnLayer->type) == factories.end()) { std::string errorMsg = std::string("Factory for ") + cnnLayer->type + " wasn't found!"; @@ -80,8 +105,6 @@ private: } }; -IE_SUPPRESS_DEPRECATED_END - } // namespace Cpu } // namespace Extensions } // namespace InferenceEngine diff --git a/inference-engine/src/mkldnn_plugin/nodes/mkldnn_generic_node.cpp b/inference-engine/src/mkldnn_plugin/nodes/mkldnn_generic_node.cpp index 84b1106..f90c785 100644 --- a/inference-engine/src/mkldnn_plugin/nodes/mkldnn_generic_node.cpp +++ b/inference-engine/src/mkldnn_plugin/nodes/mkldnn_generic_node.cpp @@ -36,9 +36,7 @@ void MKLDNNGenericNode::initSupportedPrimitiveDescriptors() { std::vector impls_no_exec; - IE_SUPPRESS_DEPRECATED_START InferenceEngine::StatusCode rc = extFactory->getImplementations(impls_no_exec, &resp); - IE_SUPPRESS_DEPRECATED_END for (const auto& impl : impls_no_exec) { if (auto exec_impl = std::dynamic_pointer_cast(impl)) { impls.emplace_back(exec_impl); diff --git a/inference-engine/src/mkldnn_plugin/nodes/mkldnn_generic_node.h b/inference-engine/src/mkldnn_plugin/nodes/mkldnn_generic_node.h index 0d634d7..67559d6 100644 --- a/inference-engine/src/mkldnn_plugin/nodes/mkldnn_generic_node.h +++ b/inference-engine/src/mkldnn_plugin/nodes/mkldnn_generic_node.h @@ -37,10 +37,7 @@ public: protected: - IE_SUPPRESS_DEPRECATED_START InferenceEngine::ILayerImplFactory::Ptr extFactory; - InferenceEngine::IShapeInferImpl::Ptr extShapeInference; - IE_SUPPRESS_DEPRECATED_END std::vector impls; std::map params; std::map blobs; diff --git a/inference-engine/tests/functional/inference_engine/extension_lib/include/extension.hpp b/inference-engine/tests/functional/inference_engine/extension_lib/include/extension.hpp index 02edaa1..5e60d4b 100644 --- a/inference-engine/tests/functional/inference_engine/extension_lib/include/extension.hpp +++ b/inference-engine/tests/functional/inference_engine/extension_lib/include/extension.hpp @@ -12,8 +12,6 @@ #include #include -IE_SUPPRESS_DEPRECATED_START - class ExtensionTestOp : public ngraph::op::Op { public: static constexpr ngraph::NodeTypeInfo type_info{"Test", 0}; @@ -56,26 +54,6 @@ public: void Release() noexcept override { delete this; } - InferenceEngine::StatusCode getFactoryFor(InferenceEngine::ILayerImplFactory*& factory, - const InferenceEngine::CNNLayer* cnnLayer, - InferenceEngine::ResponseDesc* resp) noexcept override { - if (cnnLayer == nullptr || cnnLayer->type != "test") - return InferenceEngine::GENERAL_ERROR; - return InferenceEngine::OK; - } - - /** - * @brief Fills passed array with types of layers which kernel implementations are included in the extension - * - * @param types Array to store the layer types - * @param size Size of the layer types array - * @param resp Response descriptor - * @return Status code - */ - InferenceEngine::StatusCode getPrimitiveTypes(char**& types, unsigned int& size, InferenceEngine::ResponseDesc* resp) noexcept override { - size = 1; - return InferenceEngine::OK; - } /** * @brief Returns operation sets @@ -99,5 +77,3 @@ public: */ InferenceEngine::ILayerImpl::Ptr getImplementation(const std::shared_ptr& node, const std::string& implType) override; }; - -IE_SUPPRESS_DEPRECATED_END diff --git a/inference-engine/tests/functional/inference_engine/ngraph_reshape_tests.cpp b/inference-engine/tests/functional/inference_engine/ngraph_reshape_tests.cpp index 0fba1e7..fd1b212 100644 --- a/inference-engine/tests/functional/inference_engine/ngraph_reshape_tests.cpp +++ b/inference-engine/tests/functional/inference_engine/ngraph_reshape_tests.cpp @@ -362,23 +362,12 @@ class BadExtension : public InferenceEngine::IExtension { public: BadExtension() {} - InferenceEngine::StatusCode - getPrimitiveTypes(char**& types, unsigned int& size, InferenceEngine::ResponseDesc* resp) noexcept override { - return GENERAL_ERROR; - }; - void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept override {}; void Unload() noexcept override {}; void Release() noexcept override {} - InferenceEngine::StatusCode - getFactoryFor(InferenceEngine::ILayerImplFactory*& factory, const InferenceEngine::CNNLayer* cnnLayer, - InferenceEngine::ResponseDesc* resp) noexcept override { - return InferenceEngine::StatusCode::NOT_IMPLEMENTED; - }; - std::map getOpSets() override { static std::map opsets; if (opsets.empty()) { diff --git a/inference-engine/tests/unit/inference_engine/ie_extension_test.cpp b/inference-engine/tests/unit/inference_engine/ie_extension_test.cpp index a9530b2..da74e01 100644 --- a/inference-engine/tests/unit/inference_engine/ie_extension_test.cpp +++ b/inference-engine/tests/unit/inference_engine/ie_extension_test.cpp @@ -24,31 +24,6 @@ std::string getExtensionPath() { std::string("extension_tests") + IE_BUILD_POSTFIX); } -TEST(ExtensionTests, testGetFactoryFor) { - IExtensionPtr extension = make_so_pointer(getExtensionPath()); - CNNLayer testLayer({"test1", "test", Precision::FP32}); - ILayerImplFactory* factory = nullptr; - ResponseDesc resp; - ASSERT_EQ(OK, extension->getFactoryFor(factory, &testLayer, &resp)); -} - -TEST(ExtensionTests, testGetIncorrectFactoryFor) { - IExtensionPtr extension = make_so_pointer(getExtensionPath()); - CNNLayer testLayer({"test1", "test_incorrect", Precision::FP32}); - ILayerImplFactory* factory = nullptr; - ResponseDesc resp; - ASSERT_NE(OK, extension->getFactoryFor(factory, &testLayer, &resp)); -} - -TEST(ExtensionTests, testGetPrimitiveTypes) { - IExtensionPtr extension = make_so_pointer(getExtensionPath()); - ResponseDesc resp; - char **types; - unsigned int size(0); - ASSERT_EQ(OK, extension->getPrimitiveTypes(types, size, &resp)); - ASSERT_EQ(1, size); -} - TEST(ExtensionTests, testGetOpSets) { IExtensionPtr extension = make_so_pointer(getExtensionPath()); auto opsets = extension->getOpSets(); diff --git a/inference-engine/tests_deprecated/functional/mkldnn/CMakeLists.txt b/inference-engine/tests_deprecated/functional/mkldnn/CMakeLists.txt index 8947a83..aff270b 100644 --- a/inference-engine/tests_deprecated/functional/mkldnn/CMakeLists.txt +++ b/inference-engine/tests_deprecated/functional/mkldnn/CMakeLists.txt @@ -55,8 +55,7 @@ target_compile_definitions(${TARGET_NAME} MODELS_PATH=\"${MODELS_PATH}\" PARENT_SCOPE) target_include_directories(${TARGET_NAME} PRIVATE - ${IE_MAIN_SOURCE_DIR}/src/extension - ${IE_MAIN_SOURCE_DIR}/src/extension/common) + ${IE_MAIN_SOURCE_DIR}/src/mkldnn_plugin) target_link_libraries(${TARGET_NAME} PRIVATE ${LIBRARIES}) diff --git a/inference-engine/tests_deprecated/functional/mkldnn/extensions_tests/extensions_test.cpp b/inference-engine/tests_deprecated/functional/mkldnn/extensions_tests/extensions_test.cpp index 0d4ee5a..0893d42 100644 --- a/inference-engine/tests_deprecated/functional/mkldnn/extensions_tests/extensions_test.cpp +++ b/inference-engine/tests_deprecated/functional/mkldnn/extensions_tests/extensions_test.cpp @@ -23,8 +23,6 @@ struct extension_params { std::map config; }; -using ext_factory = std::function; - class FakePrimitiveImpl : public InferenceEngine::ILayerExecImpl { public: FakePrimitiveImpl(const InferenceEngine::CNNLayer *layer) { @@ -61,26 +59,8 @@ private: InferenceEngine::CNNLayer* cnnLayer; }; -class FakePrimitiveFactory : public InferenceEngine::ILayerImplFactory { -public: - FakePrimitiveFactory(const InferenceEngine::CNNLayer *layer) { - cnnLayer = const_cast(layer); - } - // First implementation has more priority than next - InferenceEngine::StatusCode getImplementations(std::vector& impls, InferenceEngine::ResponseDesc *resp) noexcept override { - impls.push_back(InferenceEngine::ILayerImpl::Ptr(new FakePrimitiveImpl(cnnLayer))); - return InferenceEngine::OK; - } - -private: - InferenceEngine::CNNLayer * cnnLayer; -}; - class TestExtension : public InferenceEngine::IExtension { public: - TestExtension() { - factories["Fake"] = [](const InferenceEngine::CNNLayer * cnnLayer) -> InferenceEngine::ILayerImplFactory* { return new FakePrimitiveFactory(cnnLayer); }; - } void Release() noexcept override { delete this; } void GetVersion(const InferenceEngine::Version *&versionInfo) const noexcept override @@ -90,28 +70,6 @@ public: } void Unload() noexcept override {} - StatusCode getPrimitiveTypes(char**& types, unsigned int& size, ResponseDesc* resp) noexcept override { - types = new char *[factories.size()]; - size_t count = 0; - for (auto it = factories.begin(); it != factories.end(); it++, count ++) { - types[count] = new char[it->first.size() + 1]; - std::copy(it->first.begin(), it->first.end(), types[count]); - types[count][it->first.size() ] = '\0'; - } - return InferenceEngine::OK; - } - - StatusCode getFactoryFor(ILayerImplFactory *&factory, const CNNLayer *cnnLayer, ResponseDesc *resp) noexcept override { - if (factories.find(cnnLayer->type) == factories.end()) { - std::string errorMsg = std::string("Factory for ") + cnnLayer->type + " wasn't found!"; - errorMsg.copy(resp->msg, sizeof(resp->msg) - 1); - return InferenceEngine::NOT_FOUND; - } - factory = factories[cnnLayer->type](cnnLayer); - return InferenceEngine::OK; - } -private: - std::map factories; }; class NewFakePrimitiveImpl : public InferenceEngine::ILayerExecImpl { @@ -361,17 +319,17 @@ protected: #endif TEST_F(smoke_ExtensionTest, MKLDNN_delete_extension) { - std::shared_ptr ext(new TestExtension()); + std::shared_ptr ext(new NewTestExtension()); checkExtensionRemoved({"MKLDNN", ext}); } TEST_F(smoke_ExtensionTest, MKLDNN_no_delete_extension_from_another_engine) { - std::shared_ptr ext(new TestExtension()); + std::shared_ptr ext(new NewTestExtension()); checkExtensionNotRemovedFromAnotherEngineObject({"MKLDNN", ext}); } TEST_F(smoke_ExtensionTest, MKLDNN_no_share_extension_between_engines) { - std::shared_ptr ext(new TestExtension()); + std::shared_ptr ext(new NewTestExtension()); checkNotSharedExtensions(ext, "CPU"); } diff --git a/inference-engine/tests_deprecated/unit/engines/mkldnn/constant_propagation_test.cpp b/inference-engine/tests_deprecated/unit/engines/mkldnn/constant_propagation_test.cpp index fd24fa0..acd26a9 100644 --- a/inference-engine/tests_deprecated/unit/engines/mkldnn/constant_propagation_test.cpp +++ b/inference-engine/tests_deprecated/unit/engines/mkldnn/constant_propagation_test.cpp @@ -79,7 +79,7 @@ private: using fake_ext_factory = std::function; -class FakeConstExtensionFabric : public InferenceEngine::IExtension { +class FakeConstExtensionFabric : public InferenceEngine::Extensions::Cpu::MKLDNNExtensions { public: FakeConstExtensionFabric() { factories["ConstLayer"] = [](const InferenceEngine::CNNLayer * cnnLayer) -> InferenceEngine::ILayerImplFactory* { return new ConstLayerFactory(cnnLayer); }; diff --git a/inference-engine/tests_deprecated/unit/engines/mkldnn/graph/layers/extensions/fake_layer.cpp b/inference-engine/tests_deprecated/unit/engines/mkldnn/graph/layers/extensions/fake_layer.cpp index 1db6306..e5aa195 100644 --- a/inference-engine/tests_deprecated/unit/engines/mkldnn/graph/layers/extensions/fake_layer.cpp +++ b/inference-engine/tests_deprecated/unit/engines/mkldnn/graph/layers/extensions/fake_layer.cpp @@ -18,7 +18,7 @@ struct TestExtensionsHolder { }; -class FakeExtensions : public IExtension { +class FakeExtensions : public Cpu::MKLDNNExtensions { public: void Unload() noexcept override {}; diff --git a/inference-engine/tests_deprecated/unit/engines/mkldnn/graph/layers/extensions/graph_generic_test.cpp b/inference-engine/tests_deprecated/unit/engines/mkldnn/graph/layers/extensions/graph_generic_test.cpp index c732332..eb47ac0 100644 --- a/inference-engine/tests_deprecated/unit/engines/mkldnn/graph/layers/extensions/graph_generic_test.cpp +++ b/inference-engine/tests_deprecated/unit/engines/mkldnn/graph/layers/extensions/graph_generic_test.cpp @@ -415,7 +415,7 @@ private: }; using fake_ext_factory = std::function; -class FakeExtensionFabric : public InferenceEngine::IExtension { +class FakeExtensionFabric : public InferenceEngine::Extensions::Cpu::MKLDNNExtensions { public: FakeExtensionFabric() { factories["CustomNewConvolution"] = [](const InferenceEngine::CNNLayer * cnnLayer) -> InferenceEngine::ILayerImplFactory* { return new FakeGenericPrimitiveFactory(); }; diff --git a/inference-engine/tests_deprecated/unit/engines/mkldnn/graph/structure/graph_optimization_test.cpp b/inference-engine/tests_deprecated/unit/engines/mkldnn/graph/structure/graph_optimization_test.cpp index b0099d1..e9a2c65 100644 --- a/inference-engine/tests_deprecated/unit/engines/mkldnn/graph/structure/graph_optimization_test.cpp +++ b/inference-engine/tests_deprecated/unit/engines/mkldnn/graph/structure/graph_optimization_test.cpp @@ -9,7 +9,6 @@ #include "tests_common.hpp" #include - using namespace ::testing; using namespace std; using namespace mkldnn; @@ -292,7 +291,7 @@ private: InferenceEngine::CNNLayer * cnnLayer; }; -class FakeFabric : public InferenceEngine::IExtension { +class FakeFabric : public InferenceEngine::Extensions::Cpu::MKLDNNExtensions { public: FakeFabric() { factories["ReLU"] = [](const InferenceEngine::CNNLayer * cnnLayer) -> InferenceEngine::ILayerImplFactory* { return new FakeReLUFactory(cnnLayer); }; -- 2.7.4