2 * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __ONERT_COMPILER_PASS_PERMUTATION_OPERATION_PASS_H__
18 #define __ONERT_COMPILER_PASS_PERMUTATION_OPERATION_PASS_H__
20 #include "ir/OperationVisitor.h"
21 #include "LoweredOperationPass.h"
30 class PermutationOperationPass : public LoweredOperationPass, public ir::OperationVisitor
33 using LoweredOperationPass::LoweredOperationPass;
36 std::string id() final { return "PermutationOperationPass"; }
39 void callback(const ir::OperationIndex &i, ir::IOperation &n) final;
42 void visit(const ir::operation::BinaryArithmetic &) final;
43 void visit(const ir::operation::Comparison &) final;
44 void visit(const ir::operation::Concat &) final;
45 void visit(const ir::operation::ElementwiseBinary &) final;
46 void visit(const ir::operation::ElementwiseUnary &) final;
47 void visit(const ir::operation::OneHot &) final;
48 void visit(const ir::operation::Pack &) final;
49 void visit(const ir::operation::PReLU &) final;
50 void visit(const ir::operation::SquaredDifference &) final;
51 void visit(const ir::operation::Unpack &) final;
52 void visit(const ir::operation::FullyConnected &) final;
53 void visit(const ir::operation::Gather &) final;
54 void visit(const ir::operation::Reshape &) final;
57 void applyExpandRanks(const ir::Operation &);
58 void changeToKeepLayout(const ir::Operation &);
62 } // namespace compiler
65 #endif // __ONERT_COMPILER_PASS_PERMUTATION_OPERATION_PASS_H__