1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
8 #include <mkldnn_node.h>
14 namespace MKLDNNPlugin {
16 class MKLDNNPermuteNode : public MKLDNNNode {
18 MKLDNNPermuteNode(const InferenceEngine::CNNLayerPtr& layer, const mkldnn::engine& eng);
19 ~MKLDNNPermuteNode() override = default;
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 canBeInPlace() const override {
31 static Register<MKLDNNPermuteNode> reg;
32 InferenceEngine::SizeVector order;
34 typedef std::function<void(int MB, MKLDNNMemoryPtr& srcMemPtr, MKLDNNMemoryPtr& dstMemPtr)> permuteImpl;
35 typedef std::function<bool(MKLDNNMemoryPtr& srcMemPtr, MKLDNNMemoryPtr& dstMemPtr)> isApplicable;
37 PermuteImpl(permuteImpl f0, isApplicable f1): execute(std::move(f0)), isValidParams(std::move(f1)) {}
40 isApplicable isValidParams;
43 static std::multimap<InferenceEngine::SizeVector, PermuteImpl> OptimizedCases;
46 } // namespace MKLDNNPlugin