ONE - On-device Neural Engine
Loading...
Searching...
No Matches
OpPrinter.h
Go to the documentation of this file.
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 __CIRCLEDUMP_OPPRINTER_H__
18
#define __CIRCLEDUMP_OPPRINTER_H__
19
20
#include <mio/circle/schema_generated.h>
21
22
#include <ostream>
23
#include <map>
24
25
namespace
circledump
26
{
27
28
class
OpPrinter
29
{
30
public
:
31
virtual
void
options
(
const
circle::Operator *, std::ostream &)
const
{};
32
};
33
34
class
OpPrinterRegistry
35
{
36
public
:
37
OpPrinterRegistry
();
38
39
public
:
40
const
OpPrinter
*
lookup
(circle::BuiltinOperator op)
const
41
{
42
if
(_op_map.find(op) == _op_map.end())
43
return
nullptr
;
44
45
return
_op_map.at(op).get();
46
}
47
48
public
:
49
static
OpPrinterRegistry
&
get
()
50
{
51
static
OpPrinterRegistry
me;
52
return
me;
53
}
54
55
private
:
56
std::map<circle::BuiltinOperator, std::unique_ptr<OpPrinter>> _op_map;
57
};
58
59
}
// namespace circledump
60
61
#endif
// __CIRCLEDUMP_OPPRINTER_H__
circledump::OpPrinter
Definition
OpPrinter.h:29
circledump::OpPrinter::options
virtual void options(const circle::Operator *, std::ostream &) const
Definition
OpPrinter.h:31
circledump::OpPrinterRegistry
Definition
OpPrinter.h:35
circledump::OpPrinterRegistry::OpPrinterRegistry
OpPrinterRegistry()
Definition
OpPrinter.cpp:856
circledump::OpPrinterRegistry::get
static OpPrinterRegistry & get()
Definition
OpPrinter.h:49
circledump::OpPrinterRegistry::lookup
const OpPrinter * lookup(circle::BuiltinOperator op) const
Definition
OpPrinter.h:40
circledump
Definition
Dump.h:25
compiler
circledump
src
OpPrinter.h
Generated by
1.9.8