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