diff options
Diffstat (limited to 'compiler/luci/lang/include/luci/IR')
5 files changed, 92 insertions, 0 deletions
diff --git a/compiler/luci/lang/include/luci/IR/CircleNodes.h b/compiler/luci/lang/include/luci/IR/CircleNodes.h index 901f1cbca..d643b0893 100644 --- a/compiler/luci/lang/include/luci/IR/CircleNodes.h +++ b/compiler/luci/lang/include/luci/IR/CircleNodes.h @@ -49,8 +49,10 @@ #include "Nodes/CircleFullyConnected.h" #include "Nodes/CircleGather.h" #include "Nodes/CircleGatherNd.h" +#include "Nodes/CircleGelu.h" #include "Nodes/CircleGreater.h" #include "Nodes/CircleGreaterEqual.h" +#include "Nodes/CircleHardSwish.h" #include "Nodes/CircleIf.h" #include "Nodes/CircleL2Normalize.h" #include "Nodes/CircleL2Pool2D.h" diff --git a/compiler/luci/lang/include/luci/IR/CircleNodes.lst b/compiler/luci/lang/include/luci/IR/CircleNodes.lst index f227a03f5..1646909e8 100644 --- a/compiler/luci/lang/include/luci/IR/CircleNodes.lst +++ b/compiler/luci/lang/include/luci/IR/CircleNodes.lst @@ -47,8 +47,10 @@ CIRCLE_NODE(FLOOR_MOD, CircleFloorMod) CIRCLE_NODE(FULLY_CONNECTED, CircleFullyConnected) CIRCLE_NODE(GATHER, CircleGather) CIRCLE_NODE(GATHER_ND, CircleGatherNd) +CIRCLE_NODE(GELU, CircleGelu) CIRCLE_NODE(GREATER, CircleGreater) CIRCLE_NODE(GREATER_EQUAL, CircleGreaterEqual) +CIRCLE_NODE(HARD_SWISH, CircleHardSwish) CIRCLE_NODE(IF, CircleIf) CIRCLE_NODE(L2_NORMALIZATION, CircleL2Normalize) CIRCLE_NODE(L2_POOL_2D, CircleL2Pool2D) diff --git a/compiler/luci/lang/include/luci/IR/Nodes/CircleGelu.h b/compiler/luci/lang/include/luci/IR/Nodes/CircleGelu.h new file mode 100644 index 000000000..badfec7cf --- /dev/null +++ b/compiler/luci/lang/include/luci/IR/Nodes/CircleGelu.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __LUCI_IR_CIRCLEGELU_H__ +#define __LUCI_IR_CIRCLEGELU_H__ + +#include "luci/IR/CircleNodeDecl.h" +#include "luci/IR/CircleOpcode.h" + +#include "luci/IR/CircleNodeMixins.h" + +namespace luci +{ + +/** + * @brief GELU in Circle + */ +class CircleGelu final : public FixedArityNode<1, CircleNodeImpl<CircleOpcode::GELU>> +{ +public: + loco::Node *features(void) const { return at(0)->node(); } + void features(loco::Node *node) { at(0)->node(node); } + +public: + bool approximate(void) const { return _approximate; } + void approximate(bool arg) { _approximate = arg; } + +private: + bool _approximate{false}; +}; + +} // namespace luci + +#endif // __LUCI_IR_CIRCLEGELU_H__ diff --git a/compiler/luci/lang/include/luci/IR/Nodes/CircleHardSwish.h b/compiler/luci/lang/include/luci/IR/Nodes/CircleHardSwish.h new file mode 100644 index 000000000..18652a07d --- /dev/null +++ b/compiler/luci/lang/include/luci/IR/Nodes/CircleHardSwish.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __LUCI_IR_CIRCLEHARDSWISH_H__ +#define __LUCI_IR_CIRCLEHARDSWISH_H__ + +#include "luci/IR/CircleNodeDecl.h" +#include "luci/IR/CircleOpcode.h" + +#include "luci/IR/CircleNodeMixins.h" + +namespace luci +{ + +/** + * @brief HardSwish in Circle + */ +class CircleHardSwish final : public FixedArityNode<1, CircleNodeImpl<CircleOpcode::HARD_SWISH>> +{ +public: + loco::Node *features(void) const { return at(0)->node(); } + void features(loco::Node *node) { at(0)->node(node); } +}; + +} // namespace luci + +#endif // __LUCI_IR_CIRCLEHARDSWISH_H__ diff --git a/compiler/luci/lang/include/luci/IR/Nodes/CircleTransposeConv.h b/compiler/luci/lang/include/luci/IR/Nodes/CircleTransposeConv.h index 5ae41c0c4..8c6f04a58 100644 --- a/compiler/luci/lang/include/luci/IR/Nodes/CircleTransposeConv.h +++ b/compiler/luci/lang/include/luci/IR/Nodes/CircleTransposeConv.h @@ -35,6 +35,7 @@ namespace luci */ class CircleTransposeConv final : public FixedArityNode<4, CircleNodeImpl<CircleOpcode::TRANSPOSE_CONV>>, + public CircleNodeMixin<CircleNodeTrait::FusedActFunc>, public CircleNodeMixin<CircleNodeTrait::Bias> { public: |