blob: 9a3c44927577967c85be740de26ca33e07a9eec4 [file] [log] [blame]
Ryan OSheade36e4a2020-03-13 16:26:19 +00001<!-- Copyright (c) 2020 ARM Limited. -->
2<!-- -->
3<!-- SPDX-License-Identifier: MIT -->
4<!-- -->
5<!-- HTML header for doxygen 1.8.13-->
6<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7<html xmlns="http://www.w3.org/1999/xhtml">
8<head>
9<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
10<meta http-equiv="X-UA-Compatible" content="IE=9"/>
11<meta name="generator" content="Doxygen 1.8.13"/>
12<meta name="robots" content="NOINDEX, NOFOLLOW" />
13<meta name="viewport" content="width=device-width, initial-scale=1"/>
14<title>ArmNN: src/profiling/test/ProfilingConnectionDumpToFileDecoratorTests.cpp File Reference</title>
15<link href="tabs.css" rel="stylesheet" type="text/css"/>
16<script type="text/javascript" src="jquery.js"></script>
17<script type="text/javascript" src="dynsections.js"></script>
18<link href="navtree.css" rel="stylesheet" type="text/css"/>
19<script type="text/javascript" src="resize.js"></script>
20<script type="text/javascript" src="navtreedata.js"></script>
21<script type="text/javascript" src="navtree.js"></script>
22<script type="text/javascript">
23 $(document).ready(initResizable);
24</script>
25<link href="search/search.css" rel="stylesheet" type="text/css"/>
26<script type="text/javascript" src="search/searchdata.js"></script>
27<script type="text/javascript" src="search/search.js"></script>
28<script type="text/x-mathjax-config">
29 MathJax.Hub.Config({
30 extensions: ["tex2jax.js"],
31 jax: ["input/TeX","output/HTML-CSS"],
32});
33</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
34<link href="doxygen.css" rel="stylesheet" type="text/css" />
35<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
36</head>
37<body>
38<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
39<div id="titlearea">
40<table cellspacing="0" cellpadding="0">
41 <tbody>
42 <tr style="height: 56px;">
43 <img alt="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 10rem; margin-top: .5rem; margin-left 10px"/>
44 <td style="padding-left: 0.5em;">
45 <div id="projectname">
46 &#160;<span id="projectnumber">20.02</span>
47 </div>
48 </td>
49 </tr>
50 </tbody>
51</table>
52</div>
53<!-- end header part -->
54<!-- Generated by Doxygen 1.8.13 -->
55<script type="text/javascript">
56var searchBox = new SearchBox("searchBox", "search",false,'Search');
57</script>
58<script type="text/javascript" src="menudata.js"></script>
59<script type="text/javascript" src="menu.js"></script>
60<script type="text/javascript">
61$(function() {
62 initMenu('',true,false,'search.php','Search');
63 $(document).ready(function() { init_search(); });
64});
65</script>
66<div id="main-nav"></div>
67</div><!-- top -->
68<div id="side-nav" class="ui-resizable side-nav-resizable">
69 <div id="nav-tree">
70 <div id="nav-tree-contents">
71 <div id="nav-sync" class="sync"></div>
72 </div>
73 </div>
74 <div id="splitbar" style="-moz-user-select:none;"
75 class="ui-resizable-handle">
76 </div>
77</div>
78<script type="text/javascript">
79$(document).ready(function(){initNavTree('_profiling_connection_dump_to_file_decorator_tests_8cpp.xhtml','');});
80</script>
81<div id="doc-content">
82<!-- window showing the filter options -->
83<div id="MSearchSelectWindow"
84 onmouseover="return searchBox.OnSearchSelectShow()"
85 onmouseout="return searchBox.OnSearchSelectHide()"
86 onkeydown="return searchBox.OnSearchSelectKey(event)">
87</div>
88
89<!-- iframe showing the search results (closed by default) -->
90<div id="MSearchResultsWindow">
91<iframe src="javascript:void(0)" frameborder="0"
92 name="MSearchResults" id="MSearchResults">
93</iframe>
94</div>
95
96<div class="header">
97 <div class="summary">
98<a href="#func-members">Functions</a> </div>
99 <div class="headertitle">
100<div class="title">ProfilingConnectionDumpToFileDecoratorTests.cpp File Reference</div> </div>
101</div><!--header-->
102<div class="contents">
103<div class="textblock"><code>#include &quot;<a class="el" href="_profiling_connection_dump_to_file_decorator_8hpp_source.xhtml">../ProfilingConnectionDumpToFileDecorator.hpp</a>&quot;</code><br />
104<code>#include &lt;<a class="el" href="_runtime_8hpp_source.xhtml">Runtime.hpp</a>&gt;</code><br />
105<code>#include &lt;<a class="el" href="_ignore_unused_8hpp_source.xhtml">armnn/utility/IgnoreUnused.hpp</a>&gt;</code><br />
106<code>#include &lt;fstream&gt;</code><br />
107<code>#include &lt;sstream&gt;</code><br />
108<code>#include &lt;boost/filesystem.hpp&gt;</code><br />
109<code>#include &lt;boost/numeric/conversion/cast.hpp&gt;</code><br />
110<code>#include &lt;boost/test/unit_test.hpp&gt;</code><br />
111</div>
112<p><a href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml">Go to the source code of this file.</a></p>
113<table class="memberdecls">
114<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
115Functions</h2></td></tr>
116<tr class="memitem:a10edc4fab8af7994633dfc7b401244b2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp.xhtml#a10edc4fab8af7994633dfc7b401244b2">BOOST_AUTO_TEST_CASE</a> (DumpIncomingInvalidFile)</td></tr>
117<tr class="separator:a10edc4fab8af7994633dfc7b401244b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
118<tr class="memitem:a8bf609e71434b827d7e70e162e3eb479"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp.xhtml#a8bf609e71434b827d7e70e162e3eb479">BOOST_AUTO_TEST_CASE</a> (DumpIncomingInvalidFileIgnoreErrors)</td></tr>
119<tr class="separator:a8bf609e71434b827d7e70e162e3eb479"><td class="memSeparator" colspan="2">&#160;</td></tr>
120<tr class="memitem:a9aea32b5076eb204516d8e08e4dbabe5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp.xhtml#a9aea32b5076eb204516d8e08e4dbabe5">BOOST_AUTO_TEST_CASE</a> (DumpIncomingValidFile)</td></tr>
121<tr class="separator:a9aea32b5076eb204516d8e08e4dbabe5"><td class="memSeparator" colspan="2">&#160;</td></tr>
122<tr class="memitem:a0f63813c62d808da0da829f013d20c20"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp.xhtml#a0f63813c62d808da0da829f013d20c20">BOOST_AUTO_TEST_CASE</a> (DumpOutgoingInvalidFile)</td></tr>
123<tr class="separator:a0f63813c62d808da0da829f013d20c20"><td class="memSeparator" colspan="2">&#160;</td></tr>
124<tr class="memitem:a0d64f99889b7ca80ab0f924c31a658c1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp.xhtml#a0d64f99889b7ca80ab0f924c31a658c1">BOOST_AUTO_TEST_CASE</a> (DumpOutgoingInvalidFileIgnoreErrors)</td></tr>
125<tr class="separator:a0d64f99889b7ca80ab0f924c31a658c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
126<tr class="memitem:a6f0568d8e45cdbebfb96482e4141e591"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp.xhtml#a6f0568d8e45cdbebfb96482e4141e591">BOOST_AUTO_TEST_CASE</a> (DumpOutgoingValidFile)</td></tr>
127<tr class="separator:a6f0568d8e45cdbebfb96482e4141e591"><td class="memSeparator" colspan="2">&#160;</td></tr>
128</table>
129<h2 class="groupheader">Function Documentation</h2>
130<a id="a10edc4fab8af7994633dfc7b401244b2"></a>
131<h2 class="memtitle"><span class="permalink"><a href="#a10edc4fab8af7994633dfc7b401244b2">&#9670;&nbsp;</a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[1/6]</span></h2>
132
133<div class="memitem">
134<div class="memproto">
135 <table class="memname">
136 <tr>
137 <td class="memname">BOOST_AUTO_TEST_CASE </td>
138 <td>(</td>
139 <td class="paramtype">DumpIncomingInvalidFile&#160;</td>
140 <td class="paramname"></td><td>)</td>
141 <td></td>
142 </tr>
143 </table>
144</div><div class="memdoc">
145
146<p class="definition">Definition at line <a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml#l00079">79</a> of file <a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml">ProfilingConnectionDumpToFileDecoratorTests.cpp</a>.</p>
147
148<p class="reference">References <a class="el" href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">options</a>, and <a class="el" href="_profiling_connection_dump_to_file_decorator_8cpp_source.xhtml#l00064">ProfilingConnectionDumpToFileDecorator::ReadPacket()</a>.</p>
149<div class="fragment"><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;{</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; armnn::Runtime::CreationOptions::ExternalProfilingOptions <a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; options.m_IncomingCaptureFile = <span class="stringliteral">&quot;/&quot;</span>;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; options.m_OutgoingCaptureFile = <span class="stringliteral">&quot;&quot;</span>;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <a class="code" href="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator.xhtml">ProfilingConnectionDumpToFileDecorator</a> decorator(std::make_unique&lt;DummyProfilingConnection&gt;(), options, <span class="keyword">false</span>);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; BOOST_CHECK_THROW(decorator.ReadPacket(0), <a class="code" href="classarmnn_1_1_runtime_exception.xhtml">armnn::RuntimeException</a>);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;}</div><div class="ttc" id="classarmnn_1_1_runtime_exception_xhtml"><div class="ttname"><a href="classarmnn_1_1_runtime_exception.xhtml">armnn::RuntimeException</a></div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.xhtml#l00120">Exceptions.hpp:120</a></div></div>
150<div class="ttc" id="_file_only_profiling_decorator_tests_8cpp_xhtml_a6560146509197f3e197d8d36f76c1347"><div class="ttname"><a href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a></div><div class="ttdeci">armnn::Runtime::CreationOptions::ExternalProfilingOptions options</div><div class="ttdef"><b>Definition:</b> <a href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">FileOnlyProfilingDecoratorTests.cpp:45</a></div></div>
151<div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator_xhtml"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator.xhtml">armnn::profiling::ProfilingConnectionDumpToFileDecorator</a></div><div class="ttdef"><b>Definition:</b> <a href="_profiling_connection_dump_to_file_decorator_8hpp_source.xhtml#l00025">ProfilingConnectionDumpToFileDecorator.hpp:25</a></div></div>
152</div><!-- fragment -->
153</div>
154</div>
155<a id="a8bf609e71434b827d7e70e162e3eb479"></a>
156<h2 class="memtitle"><span class="permalink"><a href="#a8bf609e71434b827d7e70e162e3eb479">&#9670;&nbsp;</a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[2/6]</span></h2>
157
158<div class="memitem">
159<div class="memproto">
160 <table class="memname">
161 <tr>
162 <td class="memname">BOOST_AUTO_TEST_CASE </td>
163 <td>(</td>
164 <td class="paramtype">DumpIncomingInvalidFileIgnoreErrors&#160;</td>
165 <td class="paramname"></td><td>)</td>
166 <td></td>
167 </tr>
168 </table>
169</div><div class="memdoc">
170
171<p class="definition">Definition at line <a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml#l00088">88</a> of file <a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml">ProfilingConnectionDumpToFileDecoratorTests.cpp</a>.</p>
172
173<p class="reference">References <a class="el" href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">options</a>, and <a class="el" href="_profiling_connection_dump_to_file_decorator_8cpp_source.xhtml#l00064">ProfilingConnectionDumpToFileDecorator::ReadPacket()</a>.</p>
174<div class="fragment"><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;{</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; armnn::Runtime::CreationOptions::ExternalProfilingOptions <a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; options.m_IncomingCaptureFile = <span class="stringliteral">&quot;/&quot;</span>;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; options.m_OutgoingCaptureFile = <span class="stringliteral">&quot;&quot;</span>;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <a class="code" href="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator.xhtml">ProfilingConnectionDumpToFileDecorator</a> decorator(std::make_unique&lt;DummyProfilingConnection&gt;(), options, <span class="keyword">true</span>);</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; BOOST_CHECK_NO_THROW(decorator.ReadPacket(0));</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;}</div><div class="ttc" id="_file_only_profiling_decorator_tests_8cpp_xhtml_a6560146509197f3e197d8d36f76c1347"><div class="ttname"><a href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a></div><div class="ttdeci">armnn::Runtime::CreationOptions::ExternalProfilingOptions options</div><div class="ttdef"><b>Definition:</b> <a href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">FileOnlyProfilingDecoratorTests.cpp:45</a></div></div>
175<div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator_xhtml"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator.xhtml">armnn::profiling::ProfilingConnectionDumpToFileDecorator</a></div><div class="ttdef"><b>Definition:</b> <a href="_profiling_connection_dump_to_file_decorator_8hpp_source.xhtml#l00025">ProfilingConnectionDumpToFileDecorator.hpp:25</a></div></div>
176</div><!-- fragment -->
177</div>
178</div>
179<a id="a9aea32b5076eb204516d8e08e4dbabe5"></a>
180<h2 class="memtitle"><span class="permalink"><a href="#a9aea32b5076eb204516d8e08e4dbabe5">&#9670;&nbsp;</a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[3/6]</span></h2>
181
182<div class="memitem">
183<div class="memproto">
184 <table class="memname">
185 <tr>
186 <td class="memname">BOOST_AUTO_TEST_CASE </td>
187 <td>(</td>
188 <td class="paramtype">DumpIncomingValidFile&#160;</td>
189 <td class="paramname"></td><td>)</td>
190 <td></td>
191 </tr>
192 </table>
193</div><div class="memdoc">
194
195<p class="definition">Definition at line <a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml#l00097">97</a> of file <a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml">ProfilingConnectionDumpToFileDecoratorTests.cpp</a>.</p>
196
197<p class="reference">References <a class="el" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK()</a>, <a class="el" href="_profiling_connection_dump_to_file_decorator_8cpp_source.xhtml#l00044">ProfilingConnectionDumpToFileDecorator::Close()</a>, <a class="el" href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">options</a>, and <a class="el" href="_profiling_connection_dump_to_file_decorator_8cpp_source.xhtml#l00064">ProfilingConnectionDumpToFileDecorator::ReadPacket()</a>.</p>
198<div class="fragment"><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;{</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; boost::filesystem::path fileName =</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; boost::filesystem::temp_directory_path() / boost::filesystem::unique_path();</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; armnn::Runtime::CreationOptions::ExternalProfilingOptions <a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>;</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; options.m_IncomingCaptureFile = fileName.string();</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; options.m_OutgoingCaptureFile = <span class="stringliteral">&quot;&quot;</span>;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <a class="code" href="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator.xhtml">ProfilingConnectionDumpToFileDecorator</a> decorator(std::make_unique&lt;DummyProfilingConnection&gt;(), options, <span class="keyword">false</span>);</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="comment">// NOTE: unique_ptr is needed here because operator=() is deleted for Packet</span></div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; std::unique_ptr&lt;Packet&gt; packet;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; BOOST_CHECK_NO_THROW(packet = std::make_unique&lt;Packet&gt;(decorator.ReadPacket(0)));</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; decorator.Close();</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; std::vector&lt;char&gt; data = ReadDumpFile(options.m_IncomingCaptureFile);</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* packetData = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span><span class="keywordtype">char</span>*<span class="keyword">&gt;</span>(packet-&gt;GetData());</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="comment">// check if the data read back from the dump file matches the original</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; constexpr <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> bytesToSkip = 2u * <span class="keyword">sizeof</span>(uint32_t); <span class="comment">// skip header and packet length</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordtype">int</span> diff = std::strncmp(data.data() + bytesToSkip, packetData, g_DataLength);</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a>(diff == 0);</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;}</div><div class="ttc" id="_file_only_profiling_decorator_tests_8cpp_xhtml_a0c262ba6f6c189a2d092d127c1b7627b"><div class="ttname"><a href="_file_only_profiling_decorator_tests_8cpp.xhtml#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a></div><div class="ttdeci">BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)</div></div>
199<div class="ttc" id="_file_only_profiling_decorator_tests_8cpp_xhtml_a6560146509197f3e197d8d36f76c1347"><div class="ttname"><a href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a></div><div class="ttdeci">armnn::Runtime::CreationOptions::ExternalProfilingOptions options</div><div class="ttdef"><b>Definition:</b> <a href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">FileOnlyProfilingDecoratorTests.cpp:45</a></div></div>
200<div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator_xhtml"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator.xhtml">armnn::profiling::ProfilingConnectionDumpToFileDecorator</a></div><div class="ttdef"><b>Definition:</b> <a href="_profiling_connection_dump_to_file_decorator_8hpp_source.xhtml#l00025">ProfilingConnectionDumpToFileDecorator.hpp:25</a></div></div>
201</div><!-- fragment -->
202</div>
203</div>
204<a id="a0f63813c62d808da0da829f013d20c20"></a>
205<h2 class="memtitle"><span class="permalink"><a href="#a0f63813c62d808da0da829f013d20c20">&#9670;&nbsp;</a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[4/6]</span></h2>
206
207<div class="memitem">
208<div class="memproto">
209 <table class="memname">
210 <tr>
211 <td class="memname">BOOST_AUTO_TEST_CASE </td>
212 <td>(</td>
213 <td class="paramtype">DumpOutgoingInvalidFile&#160;</td>
214 <td class="paramname"></td><td>)</td>
215 <td></td>
216 </tr>
217 </table>
218</div><div class="memdoc">
219
220<p class="definition">Definition at line <a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml#l00123">123</a> of file <a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml">ProfilingConnectionDumpToFileDecoratorTests.cpp</a>.</p>
221
222<p class="reference">References <a class="el" href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">options</a>, and <a class="el" href="_profiling_connection_dump_to_file_decorator_8cpp_source.xhtml#l00053">ProfilingConnectionDumpToFileDecorator::WritePacket()</a>.</p>
223<div class="fragment"><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;{</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; armnn::Runtime::CreationOptions::ExternalProfilingOptions <a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; options.m_IncomingCaptureFile = <span class="stringliteral">&quot;&quot;</span>;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; options.m_OutgoingCaptureFile = <span class="stringliteral">&quot;/&quot;</span>;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <a class="code" href="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator.xhtml">ProfilingConnectionDumpToFileDecorator</a> decorator(std::make_unique&lt;DummyProfilingConnection&gt;(), options, <span class="keyword">false</span>);</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; BOOST_CHECK_THROW(decorator.WritePacket(g_DataPtr, g_DataLength), <a class="code" href="classarmnn_1_1_runtime_exception.xhtml">armnn::RuntimeException</a>);</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;}</div><div class="ttc" id="classarmnn_1_1_runtime_exception_xhtml"><div class="ttname"><a href="classarmnn_1_1_runtime_exception.xhtml">armnn::RuntimeException</a></div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.xhtml#l00120">Exceptions.hpp:120</a></div></div>
224<div class="ttc" id="_file_only_profiling_decorator_tests_8cpp_xhtml_a6560146509197f3e197d8d36f76c1347"><div class="ttname"><a href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a></div><div class="ttdeci">armnn::Runtime::CreationOptions::ExternalProfilingOptions options</div><div class="ttdef"><b>Definition:</b> <a href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">FileOnlyProfilingDecoratorTests.cpp:45</a></div></div>
225<div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator_xhtml"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator.xhtml">armnn::profiling::ProfilingConnectionDumpToFileDecorator</a></div><div class="ttdef"><b>Definition:</b> <a href="_profiling_connection_dump_to_file_decorator_8hpp_source.xhtml#l00025">ProfilingConnectionDumpToFileDecorator.hpp:25</a></div></div>
226</div><!-- fragment -->
227</div>
228</div>
229<a id="a0d64f99889b7ca80ab0f924c31a658c1"></a>
230<h2 class="memtitle"><span class="permalink"><a href="#a0d64f99889b7ca80ab0f924c31a658c1">&#9670;&nbsp;</a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[5/6]</span></h2>
231
232<div class="memitem">
233<div class="memproto">
234 <table class="memname">
235 <tr>
236 <td class="memname">BOOST_AUTO_TEST_CASE </td>
237 <td>(</td>
238 <td class="paramtype">DumpOutgoingInvalidFileIgnoreErrors&#160;</td>
239 <td class="paramname"></td><td>)</td>
240 <td></td>
241 </tr>
242 </table>
243</div><div class="memdoc">
244
245<p class="definition">Definition at line <a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml#l00132">132</a> of file <a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml">ProfilingConnectionDumpToFileDecoratorTests.cpp</a>.</p>
246
247<p class="reference">References <a class="el" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK()</a>, <a class="el" href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">options</a>, and <a class="el" href="_profiling_connection_dump_to_file_decorator_8cpp_source.xhtml#l00053">ProfilingConnectionDumpToFileDecorator::WritePacket()</a>.</p>
248<div class="fragment"><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;{</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; armnn::Runtime::CreationOptions::ExternalProfilingOptions <a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; options.m_IncomingCaptureFile = <span class="stringliteral">&quot;&quot;</span>;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; options.m_OutgoingCaptureFile = <span class="stringliteral">&quot;/&quot;</span>;</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <a class="code" href="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator.xhtml">ProfilingConnectionDumpToFileDecorator</a> decorator(std::make_unique&lt;DummyProfilingConnection&gt;(), options, <span class="keyword">true</span>);</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; BOOST_CHECK_NO_THROW(decorator.WritePacket(g_DataPtr, g_DataLength));</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordtype">bool</span> success = decorator.WritePacket(g_DataPtr, g_DataLength);</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a>(!success);</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;}</div><div class="ttc" id="_file_only_profiling_decorator_tests_8cpp_xhtml_a0c262ba6f6c189a2d092d127c1b7627b"><div class="ttname"><a href="_file_only_profiling_decorator_tests_8cpp.xhtml#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a></div><div class="ttdeci">BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)</div></div>
249<div class="ttc" id="_file_only_profiling_decorator_tests_8cpp_xhtml_a6560146509197f3e197d8d36f76c1347"><div class="ttname"><a href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a></div><div class="ttdeci">armnn::Runtime::CreationOptions::ExternalProfilingOptions options</div><div class="ttdef"><b>Definition:</b> <a href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">FileOnlyProfilingDecoratorTests.cpp:45</a></div></div>
250<div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator_xhtml"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator.xhtml">armnn::profiling::ProfilingConnectionDumpToFileDecorator</a></div><div class="ttdef"><b>Definition:</b> <a href="_profiling_connection_dump_to_file_decorator_8hpp_source.xhtml#l00025">ProfilingConnectionDumpToFileDecorator.hpp:25</a></div></div>
251</div><!-- fragment -->
252</div>
253</div>
254<a id="a6f0568d8e45cdbebfb96482e4141e591"></a>
255<h2 class="memtitle"><span class="permalink"><a href="#a6f0568d8e45cdbebfb96482e4141e591">&#9670;&nbsp;</a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[6/6]</span></h2>
256
257<div class="memitem">
258<div class="memproto">
259 <table class="memname">
260 <tr>
261 <td class="memname">BOOST_AUTO_TEST_CASE </td>
262 <td>(</td>
263 <td class="paramtype">DumpOutgoingValidFile&#160;</td>
264 <td class="paramname"></td><td>)</td>
265 <td></td>
266 </tr>
267 </table>
268</div><div class="memdoc">
269
270<p class="definition">Definition at line <a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml#l00145">145</a> of file <a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp_source.xhtml">ProfilingConnectionDumpToFileDecoratorTests.cpp</a>.</p>
271
272<p class="reference">References <a class="el" href="_profiler_tests_8cpp.xhtml#af7f71af5c6c124222dd1c42c5df892f4">BOOST_AUTO_TEST_SUITE_END()</a>, <a class="el" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK()</a>, <a class="el" href="_profiling_connection_dump_to_file_decorator_8cpp_source.xhtml#l00044">ProfilingConnectionDumpToFileDecorator::Close()</a>, <a class="el" href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">options</a>, and <a class="el" href="_profiling_connection_dump_to_file_decorator_8cpp_source.xhtml#l00053">ProfilingConnectionDumpToFileDecorator::WritePacket()</a>.</p>
273<div class="fragment"><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;{</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; boost::filesystem::path fileName =</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; boost::filesystem::temp_directory_path() / boost::filesystem::unique_path();</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; armnn::Runtime::CreationOptions::ExternalProfilingOptions <a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>;</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; options.m_IncomingCaptureFile = <span class="stringliteral">&quot;&quot;</span>;</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; options.m_OutgoingCaptureFile = fileName.string();</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <a class="code" href="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator.xhtml">ProfilingConnectionDumpToFileDecorator</a> decorator(std::make_unique&lt;DummyProfilingConnection&gt;(), options, <span class="keyword">false</span>);</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordtype">bool</span> success = <span class="keyword">false</span>;</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; BOOST_CHECK_NO_THROW(success = decorator.WritePacket(g_DataPtr, g_DataLength));</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a>(success);</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; decorator.Close();</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; std::vector&lt;char&gt; data = ReadDumpFile(options.m_OutgoingCaptureFile);</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="comment">// check if the data read back from the dump file matches the original</span></div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keywordtype">int</span> diff = std::strncmp(data.data(), g_Data.data(), g_DataLength);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a>(diff == 0);</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;}</div><div class="ttc" id="_file_only_profiling_decorator_tests_8cpp_xhtml_a0c262ba6f6c189a2d092d127c1b7627b"><div class="ttname"><a href="_file_only_profiling_decorator_tests_8cpp.xhtml#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a></div><div class="ttdeci">BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)</div></div>
274<div class="ttc" id="_file_only_profiling_decorator_tests_8cpp_xhtml_a6560146509197f3e197d8d36f76c1347"><div class="ttname"><a href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a></div><div class="ttdeci">armnn::Runtime::CreationOptions::ExternalProfilingOptions options</div><div class="ttdef"><b>Definition:</b> <a href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">FileOnlyProfilingDecoratorTests.cpp:45</a></div></div>
275<div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator_xhtml"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_connection_dump_to_file_decorator.xhtml">armnn::profiling::ProfilingConnectionDumpToFileDecorator</a></div><div class="ttdef"><b>Definition:</b> <a href="_profiling_connection_dump_to_file_decorator_8hpp_source.xhtml#l00025">ProfilingConnectionDumpToFileDecorator.hpp:25</a></div></div>
276</div><!-- fragment -->
277</div>
278</div>
279</div><!-- contents -->
280</div><!-- doc-content -->
281<!-- start footer part -->
282<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
283 <ul>
284 <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_637c692f14729569dd2eac0c18e2a54a.xhtml">profiling</a></li><li class="navelem"><a class="el" href="dir_6b1198f6e738611120ec65b09506d2f8.xhtml">test</a></li><li class="navelem"><a class="el" href="_profiling_connection_dump_to_file_decorator_tests_8cpp.xhtml">ProfilingConnectionDumpToFileDecoratorTests.cpp</a></li>
285 <li class="footer">Generated on Fri Mar 13 2020 16:09:15 for ArmNN by
286 <a href="http://www.doxygen.org/index.html">
287 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
288 </ul>
289</div>
290</body>
291</html>