Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / src / mkldnn_plugin / nodes / mkldnn_generic_node.h
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #pragma once
6
7 #include <ie_iextension.h>
8 #include <ie_common.h>
9 #include <mkldnn_node.h>
10 #include <string>
11 #include <vector>
12 #include <memory>
13
14 namespace MKLDNNPlugin {
15
16 class MKLDNNGenericNode : public MKLDNNNode {
17 public:
18     MKLDNNGenericNode(const InferenceEngine::CNNLayerPtr& layer, const mkldnn::engine& eng);
19     ~MKLDNNGenericNode() = default;
20
21     void getSupportedDescriptors() override;
22     void initSupportedPrimitiveDescriptors() override;
23     void createPrimitive() override;
24     void execute(mkldnn::stream strm) override;
25     bool created() const override;
26     bool created(const MKLDNNExtensionManager::Ptr& extMgr) override;
27     bool canBeInPlace() const override {
28         return false;
29     }
30
31     void initDescriptor(const InferenceEngine::LayerConfig& config) override;
32
33     void execLayer();
34     void cleanup() override;
35
36
37 protected:
38     InferenceEngine::ILayerImplFactory::Ptr extFactory;
39     std::vector<InferenceEngine::ILayerImpl::Ptr> impls;
40
41 private:
42     static Register<MKLDNNGenericNode> reg;
43 };
44
45 }  // namespace MKLDNNPlugin
46