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_GRAPH_PASS_PERMUTATION_OPERATION_PASS_H__
18 #define __ONERT_GRAPH_PASS_PERMUTATION_OPERATION_PASS_H__
20 #include "ir/OperationVisitor.h"
21 #include "LoweredOperationPass.h"
30 class PermutationOperationPass : public LoweredOperationPass, public OperationVisitor
33 using LoweredOperationPass::LoweredOperationPass;
36 std::string id() final { return "PermutationOperationPass"; }
39 void callback(const OperationIndex &i, Operation &n) final;
42 void visit(const operation::Add &) final;
43 void visit(const operation::Comparison &) final;
44 void visit(const operation::Concat &) final;
45 void visit(const operation::Div &) final;
46 void visit(const operation::LogicalAnd &) final;
47 void visit(const operation::LogicalNot &) final;
48 void visit(const operation::LogicalOr &) final;
49 void visit(const operation::Max &) final;
50 void visit(const operation::Min &) final;
51 void visit(const operation::Mul &) final;
52 void visit(const operation::Pack &) final;
53 void visit(const operation::PReLU &) final;
54 void visit(const operation::SquaredDifference &) final;
55 void visit(const operation::Sub &) final;
56 void visit(const operation::Unpack &) final;
57 void visit(const operation::FullyConnected &) final;
58 void visit(const operation::Gather &) final;
59 void visit(const operation::Reshape &) final;
62 void applyExpandRanks(const Operation &);
63 void changeToKeepLayout(const Operation &);
70 #endif // __ONERT_GRAPH_PASS_PERMUTATION_OPERATION_PASS_H__