mkldnn_reshape_node.h 996 Bytes
Newer Older
openvino-pushbot's avatar
openvino-pushbot committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
// Copyright (C) 2018 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//

#pragma once

#include <ie_common.h>
#include <mkldnn_node.h>
#include <string>
#include <vector>
#include <memory>

namespace MKLDNNPlugin {

class MKLDNNReshapeNode : public MKLDNNNode {
public:
    MKLDNNReshapeNode(const InferenceEngine::CNNLayerPtr& layer, const mkldnn::engine& eng);
    ~MKLDNNReshapeNode() override = default;

    void getSupportedDescriptors() override;
    void initSupportedPrimitiveDescriptors() override;
    void createPrimitive() override;
    void execute(mkldnn::stream strm) override;
    bool created() const override;
    void setDynamicBatchLim(int lim) override;

private:
    static Register<MKLDNNReshapeNode> reg;
    std::shared_ptr<mkldnn::primitive> srcPrim;
    std::shared_ptr<mkldnn::primitive> dstPrim;
    MKLDNNMemoryPtr srcMem;
    MKLDNNMemoryPtr dstMem;

    MKLDNNMemoryPtr dst_blocked;
    MKLDNNMemoryPtr src_blocked;
};

}  // namespace MKLDNNPlugin