ONE - On-device Neural Engine
Loading...
Searching...
No Matches
ProgressReporter.cpp
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#include "ProgressReporter.h"
18
19#include "Log.h"
20#include "LogHelper.h"
21
22#include <logo/Phase.h>
23#include <logo/Pass.h>
24
25#include <cassert>
26
27namespace
28{
29
30char to_char(bool b) { return b ? 'Y' : 'N'; }
31
32const char *to_str(logo::PhaseStrategy s)
33{
34 switch (s)
35 {
37 return "Saturate";
39 return "Restart";
40 }
41 assert(false);
42 return "";
43}
44
45} // namespace
46
47namespace exo
48{
49
51{
52 LOGGER(prime);
53
54 INFO(prime) << "==============================================================";
55 INFO(prime) << "exo::PhaseRunner<" << to_str(strategy()) << ">";
56 INFO(prime) << "Initial graph";
57 INFO(prime) << fmt(graph());
58}
59
61{
62 LOGGER(prime);
63
64 INFO(prime) << "exo::PhaseRunner<" << to_str(strategy()) << "> - done";
65}
66
68{
69 LOGGER(prime);
70
71 INFO(prime) << "--------------------------------------------------------------";
72 INFO(prime) << "Before " << logo::pass_name(info->pass());
73}
74
76{
77 LOGGER(prime);
78
79 INFO(prime) << "After " << logo::pass_name(info->pass())
80 << " (changed: " << to_char(info->changed()) << ")";
81 INFO(prime) << fmt(graph());
82}
83
84} // namespace exo
#define LOGGER(name)
Definition Log.h:65
#define INFO(name)
Definition Log.h:68
loco::Graph * graph(void) const
logo::PhaseStrategy strategy(void) const
void notify(const logo::PhaseEventInfo< logo::PhaseEvent::PhaseBegin > *) override
volatile const char info[]
FormattedGraph fmt(loco::Graph *g)
Definition LogHelper.cpp:73
std::string pass_name(const Pass *)
Definition Pass.cpp:22
PhaseStrategy
Definition Phase.h:151