c40778a560c7ee87a5e9c63cf14a4741f7568290
[platform/core/ml/nnfw.git] / runtime / onert / core / include / ir / operation / ElementwiseUnary.h
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __ONERT_IR_OPERATION_ELEMENTWISEUNARY_H__
18 #define __ONERT_IR_OPERATION_ELEMENTWISEUNARY_H__
19
20 #include "ir/Operation.h"
21
22 namespace onert
23 {
24 namespace ir
25 {
26 namespace operation
27 {
28
29 class ElementwiseUnary : public Operation
30 {
31 public:
32   enum Input
33   {
34     INPUT = 0
35   };
36
37   enum class Type
38   {
39     ABS,
40     CAST,
41     COS,
42     DEQUANTIZE,
43     ERF,
44     EXP,
45     FLOOR,
46     LOG,
47     LOGICAL_NOT,
48     NEG,
49     QUANTIZE,
50     ROUND,
51     RSQRT,
52     SIN,
53     SQRT,
54     SQURE,
55     ZEROS_LIKE
56   };
57
58   struct Param
59   {
60     Type op_type;
61   };
62
63 public:
64   ElementwiseUnary(const OperandIndexSequence &inputs, const OperandIndexSequence &outputs,
65                    const Param &param);
66
67 public:
68   void accept(OperationVisitor &v) const override;
69   std::string name() const override;
70   OpCode opcode() const final { return OpCode::ElementwiseUnary; }
71
72 public:
73   const Param &param() const { return _param; }
74
75 private:
76   Param _param;
77 };
78
79 } // namespace operation
80 } // namespace ir
81 } // namespace onert
82
83 #endif // __ONERT_IR_OPERATION_ELEMENTWISEUNARY_H__