Ryan OShea | de36e4a | 2020-03-13 16:26:19 +0000 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 5 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 6 | <meta name="generator" content="Doxygen 1.8.13"/> |
| 7 | <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 8 | <title>ArmNN: SendThread Class Reference</title> |
| 9 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 10 | <script type="text/javascript" src="jquery.js"></script> |
| 11 | <script type="text/javascript" src="dynsections.js"></script> |
| 12 | <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 13 | <script type="text/javascript" src="resize.js"></script> |
| 14 | <script type="text/javascript" src="navtreedata.js"></script> |
| 15 | <script type="text/javascript" src="navtree.js"></script> |
| 16 | <script type="text/javascript"> |
| 17 | $(document).ready(initResizable); |
| 18 | </script> |
| 19 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 20 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 21 | <script type="text/javascript" src="search/search.js"></script> |
| 22 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 23 | </head> |
| 24 | <body> |
| 25 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 26 | <div id="titlearea"> |
| 27 | <table cellspacing="0" cellpadding="0"> |
| 28 | <tbody> |
| 29 | <tr style="height: 56px;"> |
| 30 | <td id="projectalign" style="padding-left: 0.5em;"> |
| 31 | <div id="projectname">ArmNN |
| 32 |  <span id="projectnumber">NotReleased</span> |
| 33 | </div> |
| 34 | </td> |
| 35 | </tr> |
| 36 | </tbody> |
| 37 | </table> |
| 38 | </div> |
| 39 | <!-- end header part --> |
| 40 | <!-- Generated by Doxygen 1.8.13 --> |
| 41 | <script type="text/javascript"> |
| 42 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 43 | </script> |
| 44 | <script type="text/javascript" src="menudata.js"></script> |
| 45 | <script type="text/javascript" src="menu.js"></script> |
| 46 | <script type="text/javascript"> |
| 47 | $(function() { |
| 48 | initMenu('',true,false,'search.php','Search'); |
| 49 | $(document).ready(function() { init_search(); }); |
| 50 | }); |
| 51 | </script> |
| 52 | <div id="main-nav"></div> |
| 53 | </div><!-- top --> |
| 54 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 55 | <div id="nav-tree"> |
| 56 | <div id="nav-tree-contents"> |
| 57 | <div id="nav-sync" class="sync"></div> |
| 58 | </div> |
| 59 | </div> |
| 60 | <div id="splitbar" style="-moz-user-select:none;" |
| 61 | class="ui-resizable-handle"> |
| 62 | </div> |
| 63 | </div> |
| 64 | <script type="text/javascript"> |
| 65 | $(document).ready(function(){initNavTree('classarmnn_1_1profiling_1_1_send_thread.html','');}); |
| 66 | </script> |
| 67 | <div id="doc-content"> |
| 68 | <!-- window showing the filter options --> |
| 69 | <div id="MSearchSelectWindow" |
| 70 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 71 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 72 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 73 | </div> |
| 74 | |
| 75 | <!-- iframe showing the search results (closed by default) --> |
| 76 | <div id="MSearchResultsWindow"> |
| 77 | <iframe src="javascript:void(0)" frameborder="0" |
| 78 | name="MSearchResults" id="MSearchResults"> |
| 79 | </iframe> |
| 80 | </div> |
| 81 | |
| 82 | <div class="header"> |
| 83 | <div class="summary"> |
| 84 | <a href="#pub-methods">Public Member Functions</a> | |
| 85 | <a href="classarmnn_1_1profiling_1_1_send_thread-members.html">List of all members</a> </div> |
| 86 | <div class="headertitle"> |
| 87 | <div class="title">SendThread Class Reference</div> </div> |
| 88 | </div><!--header--> |
| 89 | <div class="contents"> |
| 90 | |
| 91 | <p><code>#include <<a class="el" href="_send_thread_8hpp_source.html">SendThread.hpp</a>></code></p> |
| 92 | <div class="dynheader"> |
| 93 | Inheritance diagram for SendThread:</div> |
| 94 | <div class="dyncontent"> |
| 95 | <div class="center"> |
| 96 | <img src="classarmnn_1_1profiling_1_1_send_thread.png" usemap="#SendThread_map" alt=""/> |
| 97 | <map id="SendThread_map" name="SendThread_map"> |
| 98 | <area href="classarmnn_1_1profiling_1_1_i_send_thread.html" alt="ISendThread" shape="rect" coords="0,0,84,24"/> |
| 99 | <area href="classarmnn_1_1profiling_1_1_i_consumer.html" alt="IConsumer" shape="rect" coords="94,0,178,24"/> |
| 100 | </map> |
| 101 | </div></div> |
| 102 | <table class="memberdecls"> |
| 103 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> |
| 104 | Public Member Functions</h2></td></tr> |
| 105 | <tr class="memitem:ad02c2666a109b2b56624295ffae06d6e"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1profiling_1_1_send_thread.html#ad02c2666a109b2b56624295ffae06d6e">SendThread</a> (<a class="el" href="classarmnn_1_1profiling_1_1_profiling_state_machine.html">ProfilingStateMachine</a> &profilingStateMachine, <a class="el" href="classarmnn_1_1profiling_1_1_i_buffer_manager.html">IBufferManager</a> &buffer, <a class="el" href="classarmnn_1_1profiling_1_1_i_send_counter_packet.html">ISendCounterPacket</a> &sendCounterPacket, int timeout=1000)</td></tr> |
| 106 | <tr class="separator:ad02c2666a109b2b56624295ffae06d6e"><td class="memSeparator" colspan="2"> </td></tr> |
| 107 | <tr class="memitem:af1bb0c517d767271394b0fed3c88c764"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1profiling_1_1_send_thread.html#af1bb0c517d767271394b0fed3c88c764">~SendThread</a> ()</td></tr> |
| 108 | <tr class="separator:af1bb0c517d767271394b0fed3c88c764"><td class="memSeparator" colspan="2"> </td></tr> |
| 109 | <tr class="memitem:a160847691cc1341520cf16c11c1ec724"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1profiling_1_1_send_thread.html#a160847691cc1341520cf16c11c1ec724">Start</a> (<a class="el" href="classarmnn_1_1profiling_1_1_i_profiling_connection.html">IProfilingConnection</a> &profilingConnection) override</td></tr> |
| 110 | <tr class="memdesc:a160847691cc1341520cf16c11c1ec724"><td class="mdescLeft"> </td><td class="mdescRight">Start the thread. <a href="#a160847691cc1341520cf16c11c1ec724">More...</a><br /></td></tr> |
| 111 | <tr class="separator:a160847691cc1341520cf16c11c1ec724"><td class="memSeparator" colspan="2"> </td></tr> |
| 112 | <tr class="memitem:a32e1e5f33658343e4a480d37329cff38"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1profiling_1_1_send_thread.html#a32e1e5f33658343e4a480d37329cff38">Stop</a> (bool rethrowSendThreadExceptions=<a class="el" href="_ref_layer_tests_8cpp.html#a37f1c3ccc9fc906be85185350dd83d48">true</a>) override</td></tr> |
| 113 | <tr class="memdesc:a32e1e5f33658343e4a480d37329cff38"><td class="mdescLeft"> </td><td class="mdescRight">Stop the thread. <a href="#a32e1e5f33658343e4a480d37329cff38">More...</a><br /></td></tr> |
| 114 | <tr class="separator:a32e1e5f33658343e4a480d37329cff38"><td class="memSeparator" colspan="2"> </td></tr> |
| 115 | <tr class="memitem:ad2d0b47c9cfacb7abdb524878b07c9a7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1profiling_1_1_send_thread.html#ad2d0b47c9cfacb7abdb524878b07c9a7">SetReadyToRead</a> () override</td></tr> |
| 116 | <tr class="memdesc:ad2d0b47c9cfacb7abdb524878b07c9a7"><td class="mdescLeft"> </td><td class="mdescRight">Set a "ready to read" flag in the buffer to notify the reading thread to start reading it. <a href="#ad2d0b47c9cfacb7abdb524878b07c9a7">More...</a><br /></td></tr> |
| 117 | <tr class="separator:ad2d0b47c9cfacb7abdb524878b07c9a7"><td class="memSeparator" colspan="2"> </td></tr> |
| 118 | <tr class="memitem:a503e3d34e944eb2100a9b6e26cde2aae"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1profiling_1_1_send_thread.html#a503e3d34e944eb2100a9b6e26cde2aae">IsRunning</a> ()</td></tr> |
| 119 | <tr class="separator:a503e3d34e944eb2100a9b6e26cde2aae"><td class="memSeparator" colspan="2"> </td></tr> |
| 120 | <tr class="memitem:aca1be8cb336582dbbdc9dae32475cfea"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1profiling_1_1_send_thread.html#aca1be8cb336582dbbdc9dae32475cfea">WaitForPacketSent</a> (uint32_t timeout)</td></tr> |
| 121 | <tr class="separator:aca1be8cb336582dbbdc9dae32475cfea"><td class="memSeparator" colspan="2"> </td></tr> |
| 122 | <tr class="inherit_header pub_methods_classarmnn_1_1profiling_1_1_i_send_thread"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classarmnn_1_1profiling_1_1_i_send_thread')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classarmnn_1_1profiling_1_1_i_send_thread.html">ISendThread</a></td></tr> |
| 123 | <tr class="memitem:a4e0fb8f587a0f5ef84d28e57cd2b6afe inherit pub_methods_classarmnn_1_1profiling_1_1_i_send_thread"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1profiling_1_1_i_send_thread.html#a4e0fb8f587a0f5ef84d28e57cd2b6afe">~ISendThread</a> ()</td></tr> |
| 124 | <tr class="separator:a4e0fb8f587a0f5ef84d28e57cd2b6afe inherit pub_methods_classarmnn_1_1profiling_1_1_i_send_thread"><td class="memSeparator" colspan="2"> </td></tr> |
| 125 | <tr class="inherit_header pub_methods_classarmnn_1_1profiling_1_1_i_consumer"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classarmnn_1_1profiling_1_1_i_consumer')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classarmnn_1_1profiling_1_1_i_consumer.html">IConsumer</a></td></tr> |
| 126 | <tr class="memitem:a70e3766f4088883274c4daa1941f03b9 inherit pub_methods_classarmnn_1_1profiling_1_1_i_consumer"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1profiling_1_1_i_consumer.html#a70e3766f4088883274c4daa1941f03b9">~IConsumer</a> ()</td></tr> |
| 127 | <tr class="separator:a70e3766f4088883274c4daa1941f03b9 inherit pub_methods_classarmnn_1_1profiling_1_1_i_consumer"><td class="memSeparator" colspan="2"> </td></tr> |
| 128 | </table> |
| 129 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 130 | <div class="textblock"> |
| 131 | <p class="definition">Definition at line <a class="el" href="_send_thread_8hpp_source.html#l00029">29</a> of file <a class="el" href="_send_thread_8hpp_source.html">SendThread.hpp</a>.</p> |
| 132 | </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> |
| 133 | <a id="ad02c2666a109b2b56624295ffae06d6e"></a> |
| 134 | <h2 class="memtitle"><span class="permalink"><a href="#ad02c2666a109b2b56624295ffae06d6e">◆ </a></span>SendThread()</h2> |
| 135 | |
| 136 | <div class="memitem"> |
| 137 | <div class="memproto"> |
| 138 | <table class="memname"> |
| 139 | <tr> |
| 140 | <td class="memname"><a class="el" href="classarmnn_1_1profiling_1_1_send_thread.html">SendThread</a> </td> |
| 141 | <td>(</td> |
| 142 | <td class="paramtype"><a class="el" href="classarmnn_1_1profiling_1_1_profiling_state_machine.html">ProfilingStateMachine</a> & </td> |
| 143 | <td class="paramname"><em>profilingStateMachine</em>, </td> |
| 144 | </tr> |
| 145 | <tr> |
| 146 | <td class="paramkey"></td> |
| 147 | <td></td> |
| 148 | <td class="paramtype"><a class="el" href="classarmnn_1_1profiling_1_1_i_buffer_manager.html">IBufferManager</a> & </td> |
| 149 | <td class="paramname"><em>buffer</em>, </td> |
| 150 | </tr> |
| 151 | <tr> |
| 152 | <td class="paramkey"></td> |
| 153 | <td></td> |
| 154 | <td class="paramtype"><a class="el" href="classarmnn_1_1profiling_1_1_i_send_counter_packet.html">ISendCounterPacket</a> & </td> |
| 155 | <td class="paramname"><em>sendCounterPacket</em>, </td> |
| 156 | </tr> |
| 157 | <tr> |
| 158 | <td class="paramkey"></td> |
| 159 | <td></td> |
| 160 | <td class="paramtype">int </td> |
| 161 | <td class="paramname"><em>timeout</em> = <code>1000</code> </td> |
| 162 | </tr> |
| 163 | <tr> |
| 164 | <td></td> |
| 165 | <td>)</td> |
| 166 | <td></td><td></td> |
| 167 | </tr> |
| 168 | </table> |
| 169 | </div><div class="memdoc"> |
| 170 | |
| 171 | <p class="definition">Definition at line <a class="el" href="_send_thread_8cpp_source.html#l00028">28</a> of file <a class="el" href="_send_thread_8cpp_source.html">SendThread.cpp</a>.</p> |
| 172 | |
| 173 | <p class="reference">References <a class="el" href="classarmnn_1_1profiling_1_1_i_buffer_manager.html#a2d5f60e55b59ae8667ff593b5bfc5deb">IBufferManager::SetConsumer()</a>.</p> |
| 174 | <div class="fragment"><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  : m_StateMachine(profilingStateMachine)</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  , m_BufferManager(buffer)</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  , m_SendCounterPacket(sendCounterPacket)</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  , m_Timeout(timeout)</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  , m_IsRunning(<span class="keyword">false</span>)</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  , m_KeepRunning(<span class="keyword">false</span>)</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  , m_SendThreadException(<span class="keyword">nullptr</span>)</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> {</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  m_BufferManager.<a class="code" href="classarmnn_1_1profiling_1_1_i_buffer_manager.html#a2d5f60e55b59ae8667ff593b5bfc5deb">SetConsumer</a>(<span class="keyword">this</span>);</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> }</div><div class="ttc" id="classarmnn_1_1profiling_1_1_i_buffer_manager_html_a2d5f60e55b59ae8667ff593b5bfc5deb"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_i_buffer_manager.html#a2d5f60e55b59ae8667ff593b5bfc5deb">armnn::profiling::IBufferManager::SetConsumer</a></div><div class="ttdeci">virtual void SetConsumer(IConsumer *consumer)=0</div></div> |
| 175 | </div><!-- fragment --> |
| 176 | </div> |
| 177 | </div> |
| 178 | <a id="af1bb0c517d767271394b0fed3c88c764"></a> |
| 179 | <h2 class="memtitle"><span class="permalink"><a href="#af1bb0c517d767271394b0fed3c88c764">◆ </a></span>~SendThread()</h2> |
| 180 | |
| 181 | <div class="memitem"> |
| 182 | <div class="memproto"> |
| 183 | <table class="mlabels"> |
| 184 | <tr> |
| 185 | <td class="mlabels-left"> |
| 186 | <table class="memname"> |
| 187 | <tr> |
| 188 | <td class="memname">~<a class="el" href="classarmnn_1_1profiling_1_1_send_thread.html">SendThread</a> </td> |
| 189 | <td>(</td> |
| 190 | <td class="paramname"></td><td>)</td> |
| 191 | <td></td> |
| 192 | </tr> |
| 193 | </table> |
| 194 | </td> |
| 195 | <td class="mlabels-right"> |
| 196 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 197 | </tr> |
| 198 | </table> |
| 199 | </div><div class="memdoc"> |
| 200 | |
| 201 | <p class="definition">Definition at line <a class="el" href="_send_thread_8hpp_source.html#l00034">34</a> of file <a class="el" href="_send_thread_8hpp_source.html">SendThread.hpp</a>.</p> |
| 202 | |
| 203 | <p class="reference">References <a class="el" href="_send_thread_8cpp_source.html#l00041">SendThread::SetReadyToRead()</a>, <a class="el" href="_send_thread_8cpp_source.html#l00052">SendThread::Start()</a>, and <a class="el" href="_send_thread_8cpp_source.html#l00082">SendThread::Stop()</a>.</p> |
| 204 | <div class="fragment"><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  {</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <span class="comment">// Don't rethrow when destructing the object</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <a class="code" href="classarmnn_1_1profiling_1_1_send_thread.html#a32e1e5f33658343e4a480d37329cff38">Stop</a>(<span class="keyword">false</span>);</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  }</div><div class="ttc" id="classarmnn_1_1profiling_1_1_send_thread_html_a32e1e5f33658343e4a480d37329cff38"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_send_thread.html#a32e1e5f33658343e4a480d37329cff38">armnn::profiling::SendThread::Stop</a></div><div class="ttdeci">void Stop(bool rethrowSendThreadExceptions=true) override</div><div class="ttdoc">Stop the thread. </div><div class="ttdef"><b>Definition:</b> <a href="_send_thread_8cpp_source.html#l00082">SendThread.cpp:82</a></div></div> |
| 205 | </div><!-- fragment --> |
| 206 | </div> |
| 207 | </div> |
| 208 | <h2 class="groupheader">Member Function Documentation</h2> |
| 209 | <a id="a503e3d34e944eb2100a9b6e26cde2aae"></a> |
| 210 | <h2 class="memtitle"><span class="permalink"><a href="#a503e3d34e944eb2100a9b6e26cde2aae">◆ </a></span>IsRunning()</h2> |
| 211 | |
| 212 | <div class="memitem"> |
| 213 | <div class="memproto"> |
| 214 | <table class="mlabels"> |
| 215 | <tr> |
| 216 | <td class="mlabels-left"> |
| 217 | <table class="memname"> |
| 218 | <tr> |
| 219 | <td class="memname">bool IsRunning </td> |
| 220 | <td>(</td> |
| 221 | <td class="paramname"></td><td>)</td> |
| 222 | <td></td> |
| 223 | </tr> |
| 224 | </table> |
| 225 | </td> |
| 226 | <td class="mlabels-right"> |
| 227 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 228 | </tr> |
| 229 | </table> |
| 230 | </div><div class="memdoc"> |
| 231 | |
| 232 | <p class="definition">Definition at line <a class="el" href="_send_thread_8hpp_source.html#l00045">45</a> of file <a class="el" href="_send_thread_8hpp_source.html">SendThread.hpp</a>.</p> |
| 233 | |
| 234 | <p class="reference">References <a class="el" href="_send_thread_8cpp_source.html#l00263">SendThread::WaitForPacketSent()</a>.</p> |
| 235 | |
| 236 | <p class="reference">Referenced by <a class="el" href="_send_counter_packet_tests_8cpp_source.html#l01767">BOOST_AUTO_TEST_CASE()</a>.</p> |
| 237 | <div class="fragment"><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> { <span class="keywordflow">return</span> m_IsRunning.load(); }</div></div><!-- fragment --> |
| 238 | </div> |
| 239 | </div> |
| 240 | <a id="ad2d0b47c9cfacb7abdb524878b07c9a7"></a> |
| 241 | <h2 class="memtitle"><span class="permalink"><a href="#ad2d0b47c9cfacb7abdb524878b07c9a7">◆ </a></span>SetReadyToRead()</h2> |
| 242 | |
| 243 | <div class="memitem"> |
| 244 | <div class="memproto"> |
| 245 | <table class="mlabels"> |
| 246 | <tr> |
| 247 | <td class="mlabels-left"> |
| 248 | <table class="memname"> |
| 249 | <tr> |
| 250 | <td class="memname">void SetReadyToRead </td> |
| 251 | <td>(</td> |
| 252 | <td class="paramname"></td><td>)</td> |
| 253 | <td></td> |
| 254 | </tr> |
| 255 | </table> |
| 256 | </td> |
| 257 | <td class="mlabels-right"> |
| 258 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 259 | </tr> |
| 260 | </table> |
| 261 | </div><div class="memdoc"> |
| 262 | |
| 263 | <p>Set a "ready to read" flag in the buffer to notify the reading thread to start reading it. </p> |
| 264 | |
| 265 | <p>Implements <a class="el" href="classarmnn_1_1profiling_1_1_i_consumer.html#a4b4fe1cfea0198d9defd88178f073365">IConsumer</a>.</p> |
| 266 | |
| 267 | <p class="definition">Definition at line <a class="el" href="_send_thread_8cpp_source.html#l00041">41</a> of file <a class="el" href="_send_thread_8cpp_source.html">SendThread.cpp</a>.</p> |
| 268 | |
| 269 | <p class="reference">Referenced by <a class="el" href="_send_counter_packet_tests_8cpp_source.html#l01791">BOOST_AUTO_TEST_CASE()</a>, <a class="el" href="_send_thread_8cpp_source.html#l00082">SendThread::Stop()</a>, and <a class="el" href="_send_thread_8hpp_source.html#l00034">SendThread::~SendThread()</a>.</p> |
| 270 | <div class="fragment"><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> {</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="comment">// We need to wait for the send thread to release its mutex</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  {</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  std::lock_guard<std::mutex> lck(m_WaitMutex);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  m_ReadyToRead = <span class="keyword">true</span>;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  }</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="comment">// Signal the send thread that there's something to read in the buffer</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  m_WaitCondition.notify_one();</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> }</div></div><!-- fragment --> |
| 271 | </div> |
| 272 | </div> |
| 273 | <a id="a160847691cc1341520cf16c11c1ec724"></a> |
| 274 | <h2 class="memtitle"><span class="permalink"><a href="#a160847691cc1341520cf16c11c1ec724">◆ </a></span>Start()</h2> |
| 275 | |
| 276 | <div class="memitem"> |
| 277 | <div class="memproto"> |
| 278 | <table class="mlabels"> |
| 279 | <tr> |
| 280 | <td class="mlabels-left"> |
| 281 | <table class="memname"> |
| 282 | <tr> |
| 283 | <td class="memname">void Start </td> |
| 284 | <td>(</td> |
| 285 | <td class="paramtype"><a class="el" href="classarmnn_1_1profiling_1_1_i_profiling_connection.html">IProfilingConnection</a> & </td> |
| 286 | <td class="paramname"><em>profilingConnection</em></td><td>)</td> |
| 287 | <td></td> |
| 288 | </tr> |
| 289 | </table> |
| 290 | </td> |
| 291 | <td class="mlabels-right"> |
| 292 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 293 | </tr> |
| 294 | </table> |
| 295 | </div><div class="memdoc"> |
| 296 | |
| 297 | <p>Start the thread. </p> |
| 298 | |
| 299 | <p>Implements <a class="el" href="classarmnn_1_1profiling_1_1_i_send_thread.html#ae9429e2efd9a811c148c6b56b635567c">ISendThread</a>.</p> |
| 300 | |
| 301 | <p class="definition">Definition at line <a class="el" href="_send_thread_8cpp_source.html#l00052">52</a> of file <a class="el" href="_send_thread_8cpp_source.html">SendThread.cpp</a>.</p> |
| 302 | |
| 303 | <p class="reference">Referenced by <a class="el" href="_send_counter_packet_tests_8cpp_source.html#l01767">BOOST_AUTO_TEST_CASE()</a>, <a class="el" href="_profiling_service_8cpp_source.html#l00088">ProfilingService::Update()</a>, and <a class="el" href="_send_thread_8hpp_source.html#l00034">SendThread::~SendThread()</a>.</p> |
| 304 | <div class="fragment"><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> {</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="comment">// Check if the send thread is already running</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordflow">if</span> (m_IsRunning.load())</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  {</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="comment">// The send thread is already running</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  }</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordflow">if</span> (m_SendThread.joinable())</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  {</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  m_SendThread.join();</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  }</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="comment">// Mark the send thread as running</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  m_IsRunning.store(<span class="keyword">true</span>);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="comment">// Keep the send procedure going until the send thread is signalled to stop</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  m_KeepRunning.store(<span class="keyword">true</span>);</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> </div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="comment">// Make sure the send thread will not flush the buffer until signaled to do so</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="comment">// no need for a mutex as the send thread can not be running at this point</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  m_ReadyToRead = <span class="keyword">false</span>;</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> </div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  m_PacketSent = <span class="keyword">false</span>;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> </div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="comment">// Start the send thread</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  m_SendThread = std::thread(&SendThread::Send, <span class="keyword">this</span>, std::ref(profilingConnection));</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> }</div></div><!-- fragment --> |
| 305 | </div> |
| 306 | </div> |
| 307 | <a id="a32e1e5f33658343e4a480d37329cff38"></a> |
| 308 | <h2 class="memtitle"><span class="permalink"><a href="#a32e1e5f33658343e4a480d37329cff38">◆ </a></span>Stop()</h2> |
| 309 | |
| 310 | <div class="memitem"> |
| 311 | <div class="memproto"> |
| 312 | <table class="mlabels"> |
| 313 | <tr> |
| 314 | <td class="mlabels-left"> |
| 315 | <table class="memname"> |
| 316 | <tr> |
| 317 | <td class="memname">void Stop </td> |
| 318 | <td>(</td> |
| 319 | <td class="paramtype">bool </td> |
| 320 | <td class="paramname"><em>rethrowSendThreadExceptions</em> = <code><a class="el" href="_ref_layer_tests_8cpp.html#a37f1c3ccc9fc906be85185350dd83d48">true</a></code></td><td>)</td> |
| 321 | <td></td> |
| 322 | </tr> |
| 323 | </table> |
| 324 | </td> |
| 325 | <td class="mlabels-right"> |
| 326 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 327 | </tr> |
| 328 | </table> |
| 329 | </div><div class="memdoc"> |
| 330 | |
| 331 | <p>Stop the thread. </p> |
| 332 | |
| 333 | <p>Implements <a class="el" href="classarmnn_1_1profiling_1_1_i_send_thread.html#a7c6c2c7d1aeec305dcae4bc901b0bdca">ISendThread</a>.</p> |
| 334 | |
| 335 | <p class="definition">Definition at line <a class="el" href="_send_thread_8cpp_source.html#l00082">82</a> of file <a class="el" href="_send_thread_8cpp_source.html">SendThread.cpp</a>.</p> |
| 336 | |
| 337 | <p class="reference">References <a class="el" href="namespacearmnn_1_1profiling.html#acb0c054138599582d5a5f537e9798806a4d3d769b812b6faa6b76e1a8abaece2d">armnn::profiling::Active</a>, <a class="el" href="_profiling_state_machine_8cpp_source.html#l00031">ProfilingStateMachine::GetCurrentState()</a>, <a class="el" href="classarmnn_1_1profiling_1_1_i_buffer_manager.html#acc2e97eddda6324261ba202634cc8ef8">IBufferManager::GetReadableBuffer()</a>, <a class="el" href="classarmnn_1_1profiling_1_1_i_profiling_connection.html#a8a3511046982c64efa3e3833d749e5ef">IProfilingConnection::IsOpen()</a>, <a class="el" href="classarmnn_1_1profiling_1_1_i_buffer_manager.html#a033cae4e6d00fc1958f79f09216a3437">IBufferManager::MarkRead()</a>, <a class="el" href="namespacearmnn_1_1profiling.html#acb0c054138599582d5a5f537e9798806a4075072d219e061ca0f3124f8fbef463">armnn::profiling::NotConnected</a>, <a class="el" href="classarmnn_1_1profiling_1_1_i_send_counter_packet.html#a14e9efe48e3d4ed05396f8a856bfaeea">ISendCounterPacket::SendStreamMetaDataPacket()</a>, <a class="el" href="_send_thread_8cpp_source.html#l00041">SendThread::SetReadyToRead()</a>, <a class="el" href="namespacearmnn_1_1profiling.html#acb0c054138599582d5a5f537e9798806a962074a9de1cf3d6d7b6f955a0a94820">armnn::profiling::Uninitialised</a>, <a class="el" href="namespacearmnn_1_1profiling.html#acb0c054138599582d5a5f537e9798806a1dc1edc76d5b3c0325f00002f4c841f5">armnn::profiling::WaitingForAck</a>, and <a class="el" href="classarmnn_1_1profiling_1_1_i_profiling_connection.html#ac78c6bd1a545934a805c88194214b09d">IProfilingConnection::WritePacket()</a>.</p> |
| 338 | |
| 339 | <p class="reference">Referenced by <a class="el" href="_send_counter_packet_tests_8cpp_source.html#l01767">BOOST_AUTO_TEST_CASE()</a>, <a class="el" href="_profiling_service_8cpp_source.html#l00290">ProfilingService::GetSendTimelinePacket()</a>, <a class="el" href="_profiling_service_8cpp_source.html#l00088">ProfilingService::Update()</a>, and <a class="el" href="_send_thread_8hpp_source.html#l00034">SendThread::~SendThread()</a>.</p> |
| 340 | <div class="fragment"><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> {</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="comment">// Signal the send thread to stop</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  m_KeepRunning.store(<span class="keyword">false</span>);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="comment">// Check that the send thread is running</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">if</span> (m_SendThread.joinable())</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  {</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="comment">// Kick the send thread out of the wait condition</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="classarmnn_1_1profiling_1_1_send_thread.html#ad2d0b47c9cfacb7abdb524878b07c9a7">SetReadyToRead</a>();</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="comment">// Wait for the send thread to complete operations</span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  m_SendThread.join();</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  }</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="comment">// Check if the send thread exception has to be rethrown</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">if</span> (!rethrowSendThreadExceptions)</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  {</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="comment">// No need to rethrow the send thread exception, return immediately</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  }</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="comment">// Check if there's an exception to rethrow</span></div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordflow">if</span> (m_SendThreadException)</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  {</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="comment">// Rethrow the send thread exception</span></div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  std::rethrow_exception(m_SendThreadException);</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> </div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="comment">// Nullify the exception as it has been rethrown</span></div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  m_SendThreadException = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  }</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> }</div><div class="ttc" id="classarmnn_1_1profiling_1_1_send_thread_html_ad2d0b47c9cfacb7abdb524878b07c9a7"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_send_thread.html#ad2d0b47c9cfacb7abdb524878b07c9a7">armnn::profiling::SendThread::SetReadyToRead</a></div><div class="ttdeci">void SetReadyToRead() override</div><div class="ttdoc">Set a "ready to read" flag in the buffer to notify the reading thread to start reading it...</div><div class="ttdef"><b>Definition:</b> <a href="_send_thread_8cpp_source.html#l00041">SendThread.cpp:41</a></div></div> |
| 341 | </div><!-- fragment --> |
| 342 | </div> |
| 343 | </div> |
| 344 | <a id="aca1be8cb336582dbbdc9dae32475cfea"></a> |
| 345 | <h2 class="memtitle"><span class="permalink"><a href="#aca1be8cb336582dbbdc9dae32475cfea">◆ </a></span>WaitForPacketSent()</h2> |
| 346 | |
| 347 | <div class="memitem"> |
| 348 | <div class="memproto"> |
| 349 | <table class="memname"> |
| 350 | <tr> |
| 351 | <td class="memname">bool WaitForPacketSent </td> |
| 352 | <td>(</td> |
| 353 | <td class="paramtype">uint32_t </td> |
| 354 | <td class="paramname"><em>timeout</em> = <code>1000</code></td><td>)</td> |
| 355 | <td></td> |
| 356 | </tr> |
| 357 | </table> |
| 358 | </div><div class="memdoc"> |
| 359 | |
| 360 | <p class="definition">Definition at line <a class="el" href="_send_thread_8cpp_source.html#l00263">263</a> of file <a class="el" href="_send_thread_8cpp_source.html">SendThread.cpp</a>.</p> |
| 361 | |
| 362 | <p class="reference">Referenced by <a class="el" href="_send_thread_8hpp_source.html#l00045">SendThread::IsRunning()</a>, and <a class="el" href="_profiling_service_8hpp_source.html#l00244">ProfilingService::WaitForPacketSent()</a>.</p> |
| 363 | <div class="fragment"><div class="line"><a name="l00264"></a><span class="lineno"> 264</span> {</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  std::unique_lock<std::mutex> lock(m_PacketSentWaitMutex);</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <span class="comment">// Blocks until notified that at least a packet has been sent or until timeout expires.</span></div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <span class="keywordtype">bool</span> timedOut = m_PacketSentWaitCondition.wait_for(lock,</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  std::chrono::milliseconds(timeout),</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  [&] { <span class="keywordflow">return</span> m_PacketSent; });</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span> </div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  m_PacketSent = <span class="keyword">false</span>;</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span> </div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <span class="keywordflow">return</span> timedOut;</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span> }</div></div><!-- fragment --> |
| 364 | </div> |
| 365 | </div> |
| 366 | <hr/>The documentation for this class was generated from the following files:<ul> |
| 367 | <li>src/profiling/<a class="el" href="_send_thread_8hpp_source.html">SendThread.hpp</a></li> |
| 368 | <li>src/profiling/<a class="el" href="_send_thread_8cpp_source.html">SendThread.cpp</a></li> |
| 369 | </ul> |
| 370 | </div><!-- contents --> |
| 371 | </div><!-- doc-content --> |
| 372 | <!-- start footer part --> |
| 373 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 374 | <ul> |
| 375 | <li class="navelem"><a class="el" href="namespacearmnn.html">armnn</a></li><li class="navelem"><a class="el" href="namespacearmnn_1_1profiling.html">profiling</a></li><li class="navelem"><a class="el" href="classarmnn_1_1profiling_1_1_send_thread.html">SendThread</a></li> |
| 376 | <li class="footer">Generated on Fri Mar 13 2020 16:07:06 for ArmNN by |
| 377 | <a href="http://www.doxygen.org/index.html"> |
| 378 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 379 | </ul> |
| 380 | </div> |
| 381 | </body> |
| 382 | </html> |