ONE - On-device Neural Engine
Loading...
Searching...
No Matches
CircleNodeDecl.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 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 __LOCOEX_IR_CIRCLENODEDECL_H__
18#define __LOCOEX_IR_CIRCLENODEDECL_H__
19
20#include <loco/IR/Node.h>
21#include <loco/IR/Dialect.h>
22
23#include "CircleOpcode.h"
25
26namespace locoex
27{
28
29struct CircleNode : public loco::Node
30{
31 virtual ~CircleNode() = default;
32
33 const loco::Dialect *dialect(void) const final;
34 virtual CircleOpcode opcode(void) const = 0;
35
36 template <typename T> T accept(CircleNodeVisitorBase<T> *) const;
37 template <typename T> T accept(CircleNodeMutableVisitorBase<T> *);
38};
39
40template <CircleOpcode Code> struct CircleNodeImpl : public CircleNode
41{
42 virtual ~CircleNodeImpl() = default;
43
44 uint32_t opnum(void) const final { return static_cast<uint32_t>(Code); }
45 CircleOpcode opcode(void) const final { return Code; }
46};
47
48} // namespace locoex
49
50#endif // __LOCOEX_IR_CIRCLENODEDECL_H__
Dialect interface.
Definition Dialect.h:37
Logical unit of computation.
Definition Node.h:54
virtual ~CircleNode()=default
virtual CircleOpcode opcode(void) const =0
const loco::Dialect * dialect(void) const final
Return "Dialect" identifier that this node belongs to.
T accept(CircleNodeVisitorBase< T > *) const
uint32_t opnum(void) const final
virtual ~CircleNodeImpl()=default
CircleOpcode opcode(void) const final