24.08
JsonUtils.hpp
Go to the documentation of this file.
1
//
2
// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
3
// SPDX-License-Identifier: MIT
4
//
5
6
#pragma once
7
8
#include <iomanip>
9
10
#include "
armnn/Types.hpp
"
11
#include "
armnn/backends/WorkloadInfo.hpp
"
12
13
namespace
armnn
14
{
15
16
class
JsonUtils
17
{
18
public
:
19
JsonUtils
(std::ostream& outputStream)
20
: m_NumTabs(0), m_OutputStream(outputStream)
21
{}
22
23
void
PrintTabs
()
24
{
25
unsigned
int
numTabs = m_NumTabs;
26
while
( numTabs-- > 0 )
27
{
28
m_OutputStream <<
"\t"
;
29
}
30
}
31
32
void
DecrementNumberOfTabs
()
33
{
34
if
( m_NumTabs == 0 )
35
{
36
return
;
37
}
38
--m_NumTabs;
39
}
40
41
void
IncrementNumberOfTabs
()
42
{
43
++m_NumTabs;
44
}
45
46
void
PrintNewLine
()
47
{
48
m_OutputStream << std::endl;
49
}
50
51
void
PrintFooter
()
52
{
53
DecrementNumberOfTabs
();
54
PrintTabs
();
55
m_OutputStream <<
"}"
;
56
}
57
58
void
PrintHeader
()
59
{
60
m_OutputStream <<
"{"
<< std::endl;
61
IncrementNumberOfTabs
();
62
}
63
64
void
PrintArmNNHeader
()
65
{
66
PrintTabs
();
67
m_OutputStream << R
"("ArmNN": {)" << std::endl;
68
IncrementNumberOfTabs
();
69
}
70
void
PrintSeparator
()
71
{
72
m_OutputStream <<
","
;
73
}
74
75
private
:
76
unsigned
int
m_NumTabs;
77
std::ostream& m_OutputStream;
78
};
79
80
}
// namespace armnn
armnn::JsonUtils::PrintNewLine
void PrintNewLine()
Definition:
JsonUtils.hpp:46
armnn::JsonUtils::IncrementNumberOfTabs
void IncrementNumberOfTabs()
Definition:
JsonUtils.hpp:41
armnn::JsonUtils::PrintArmNNHeader
void PrintArmNNHeader()
Definition:
JsonUtils.hpp:64
armnn::JsonUtils::DecrementNumberOfTabs
void DecrementNumberOfTabs()
Definition:
JsonUtils.hpp:32
armnn::JsonUtils
Definition:
JsonUtils.hpp:16
armnn::JsonUtils::PrintHeader
void PrintHeader()
Definition:
JsonUtils.hpp:58
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition:
01_00_quick_start.dox:6
Types.hpp
armnn::JsonUtils::PrintFooter
void PrintFooter()
Definition:
JsonUtils.hpp:51
armnn::JsonUtils::PrintSeparator
void PrintSeparator()
Definition:
JsonUtils.hpp:70
armnn::JsonUtils::JsonUtils
JsonUtils(std::ostream &outputStream)
Definition:
JsonUtils.hpp:19
WorkloadInfo.hpp
armnn::JsonUtils::PrintTabs
void PrintTabs()
Definition:
JsonUtils.hpp:23
src
armnn
JsonUtils.hpp
Generated on Wed Aug 28 2024 14:31:48 for Arm NN by
1.8.17