Ryan OShea | de36e4a | 2020-03-13 16:26:19 +0000 | [diff] [blame] | 1 | <!-- 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: OpenClTimer Class 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 |  <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"> |
| 56 | var 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('classarmnn_1_1_open_cl_timer.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="#nested-classes">Classes</a> | |
| 99 | <a href="#pub-methods">Public Member Functions</a> | |
| 100 | <a href="classarmnn_1_1_open_cl_timer-members.xhtml">List of all members</a> </div> |
| 101 | <div class="headertitle"> |
| 102 | <div class="title">OpenClTimer Class Reference</div> </div> |
| 103 | </div><!--header--> |
| 104 | <div class="contents"> |
| 105 | |
| 106 | <p><a class="el" href="classarmnn_1_1_open_cl_timer.xhtml" title="OpenClTimer instrument that times all OpenCl kernels executed between calls to Start() and Stop()...">OpenClTimer</a> instrument that times all OpenCl kernels executed between calls to <a class="el" href="classarmnn_1_1_open_cl_timer.xhtml#a156f3866ca69d98b4d9e6e1c1b3ec7da" title="Start the OpenCl timer. ">Start()</a> and <a class="el" href="classarmnn_1_1_open_cl_timer.xhtml#a634c58de2126b4a4e6a2a093e60e1290" title="Stop the OpenCl timer. ">Stop()</a>. |
| 107 | <a href="classarmnn_1_1_open_cl_timer.xhtml#details">More...</a></p> |
| 108 | |
| 109 | <p><code>#include <<a class="el" href="_open_cl_timer_8hpp_source.xhtml">OpenClTimer.hpp</a>></code></p> |
| 110 | <div class="dynheader"> |
| 111 | Inheritance diagram for OpenClTimer:</div> |
| 112 | <div class="dyncontent"> |
| 113 | <div class="center"> |
| 114 | <img src="classarmnn_1_1_open_cl_timer.png" usemap="#OpenClTimer_map" alt=""/> |
| 115 | <map id="OpenClTimer_map" name="OpenClTimer_map"> |
| 116 | <area href="classarmnn_1_1_instrument.xhtml" alt="Instrument" shape="rect" coords="0,0,86,24"/> |
| 117 | </map> |
| 118 | </div></div> |
| 119 | <table class="memberdecls"> |
| 120 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> |
| 121 | Public Member Functions</h2></td></tr> |
| 122 | <tr class="memitem:adcd19a0c31e8ffa4411fa05e905c0cf4"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_open_cl_timer.xhtml#adcd19a0c31e8ffa4411fa05e905c0cf4">OpenClTimer</a> ()</td></tr> |
| 123 | <tr class="separator:adcd19a0c31e8ffa4411fa05e905c0cf4"><td class="memSeparator" colspan="2"> </td></tr> |
| 124 | <tr class="memitem:a596f6581a916e95f60c2f203b8bda367"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_open_cl_timer.xhtml#a596f6581a916e95f60c2f203b8bda367">~OpenClTimer</a> ()=default</td></tr> |
| 125 | <tr class="separator:a596f6581a916e95f60c2f203b8bda367"><td class="memSeparator" colspan="2"> </td></tr> |
| 126 | <tr class="memitem:a156f3866ca69d98b4d9e6e1c1b3ec7da"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_open_cl_timer.xhtml#a156f3866ca69d98b4d9e6e1c1b3ec7da">Start</a> () override</td></tr> |
| 127 | <tr class="memdesc:a156f3866ca69d98b4d9e6e1c1b3ec7da"><td class="mdescLeft"> </td><td class="mdescRight">Start the OpenCl timer. <a href="#a156f3866ca69d98b4d9e6e1c1b3ec7da">More...</a><br /></td></tr> |
| 128 | <tr class="separator:a156f3866ca69d98b4d9e6e1c1b3ec7da"><td class="memSeparator" colspan="2"> </td></tr> |
| 129 | <tr class="memitem:a634c58de2126b4a4e6a2a093e60e1290"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_open_cl_timer.xhtml#a634c58de2126b4a4e6a2a093e60e1290">Stop</a> () override</td></tr> |
| 130 | <tr class="memdesc:a634c58de2126b4a4e6a2a093e60e1290"><td class="mdescLeft"> </td><td class="mdescRight">Stop the OpenCl timer. <a href="#a634c58de2126b4a4e6a2a093e60e1290">More...</a><br /></td></tr> |
| 131 | <tr class="separator:a634c58de2126b4a4e6a2a093e60e1290"><td class="memSeparator" colspan="2"> </td></tr> |
| 132 | <tr class="memitem:a7ddf0cf6f620d59c10e63495ace795d0"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_open_cl_timer.xhtml#a7ddf0cf6f620d59c10e63495ace795d0">GetName</a> () const override</td></tr> |
| 133 | <tr class="memdesc:a7ddf0cf6f620d59c10e63495ace795d0"><td class="mdescLeft"> </td><td class="mdescRight">Get the name of the timer. <a href="#a7ddf0cf6f620d59c10e63495ace795d0">More...</a><br /></td></tr> |
| 134 | <tr class="separator:a7ddf0cf6f620d59c10e63495ace795d0"><td class="memSeparator" colspan="2"> </td></tr> |
| 135 | <tr class="memitem:a86ea36032637c02c045f2d433036a203"><td class="memItemLeft" align="right" valign="top">std::vector< <a class="el" href="structarmnn_1_1_measurement.xhtml">Measurement</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_open_cl_timer.xhtml#a86ea36032637c02c045f2d433036a203">GetMeasurements</a> () const override</td></tr> |
| 136 | <tr class="memdesc:a86ea36032637c02c045f2d433036a203"><td class="mdescLeft"> </td><td class="mdescRight">Get the recorded measurements. <a href="#a86ea36032637c02c045f2d433036a203">More...</a><br /></td></tr> |
| 137 | <tr class="separator:a86ea36032637c02c045f2d433036a203"><td class="memSeparator" colspan="2"> </td></tr> |
| 138 | <tr class="inherit_header pub_methods_classarmnn_1_1_instrument"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classarmnn_1_1_instrument')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classarmnn_1_1_instrument.xhtml">Instrument</a></td></tr> |
| 139 | <tr class="memitem:a37a2de9b867820a7ab15b8dc8d62b153 inherit pub_methods_classarmnn_1_1_instrument"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_instrument.xhtml#a37a2de9b867820a7ab15b8dc8d62b153">~Instrument</a> ()</td></tr> |
| 140 | <tr class="separator:a37a2de9b867820a7ab15b8dc8d62b153 inherit pub_methods_classarmnn_1_1_instrument"><td class="memSeparator" colspan="2"> </td></tr> |
| 141 | </table> |
| 142 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 143 | <div class="textblock"><p><a class="el" href="classarmnn_1_1_open_cl_timer.xhtml" title="OpenClTimer instrument that times all OpenCl kernels executed between calls to Start() and Stop()...">OpenClTimer</a> instrument that times all OpenCl kernels executed between calls to <a class="el" href="classarmnn_1_1_open_cl_timer.xhtml#a156f3866ca69d98b4d9e6e1c1b3ec7da" title="Start the OpenCl timer. ">Start()</a> and <a class="el" href="classarmnn_1_1_open_cl_timer.xhtml#a634c58de2126b4a4e6a2a093e60e1290" title="Stop the OpenCl timer. ">Stop()</a>. </p> |
| 144 | |
| 145 | <p class="definition">Definition at line <a class="el" href="_open_cl_timer_8hpp_source.xhtml#l00020">20</a> of file <a class="el" href="_open_cl_timer_8hpp_source.xhtml">OpenClTimer.hpp</a>.</p> |
| 146 | </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> |
| 147 | <a id="adcd19a0c31e8ffa4411fa05e905c0cf4"></a> |
| 148 | <h2 class="memtitle"><span class="permalink"><a href="#adcd19a0c31e8ffa4411fa05e905c0cf4">◆ </a></span>OpenClTimer()</h2> |
| 149 | |
| 150 | <div class="memitem"> |
| 151 | <div class="memproto"> |
| 152 | <table class="memname"> |
| 153 | <tr> |
| 154 | <td class="memname"><a class="el" href="classarmnn_1_1_open_cl_timer.xhtml">OpenClTimer</a> </td> |
| 155 | <td>(</td> |
| 156 | <td class="paramname"></td><td>)</td> |
| 157 | <td></td> |
| 158 | </tr> |
| 159 | </table> |
| 160 | </div><div class="memdoc"> |
| 161 | |
| 162 | <p class="definition">Definition at line <a class="el" href="_open_cl_timer_8cpp_source.xhtml#l00017">17</a> of file <a class="el" href="_open_cl_timer_8cpp_source.xhtml">OpenClTimer.cpp</a>.</p> |
| 163 | <div class="fragment"><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> {</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> }</div></div><!-- fragment --> |
| 164 | </div> |
| 165 | </div> |
| 166 | <a id="a596f6581a916e95f60c2f203b8bda367"></a> |
| 167 | <h2 class="memtitle"><span class="permalink"><a href="#a596f6581a916e95f60c2f203b8bda367">◆ </a></span>~OpenClTimer()</h2> |
| 168 | |
| 169 | <div class="memitem"> |
| 170 | <div class="memproto"> |
| 171 | <table class="mlabels"> |
| 172 | <tr> |
| 173 | <td class="mlabels-left"> |
| 174 | <table class="memname"> |
| 175 | <tr> |
| 176 | <td class="memname">~<a class="el" href="classarmnn_1_1_open_cl_timer.xhtml">OpenClTimer</a> </td> |
| 177 | <td>(</td> |
| 178 | <td class="paramname"></td><td>)</td> |
| 179 | <td></td> |
| 180 | </tr> |
| 181 | </table> |
| 182 | </td> |
| 183 | <td class="mlabels-right"> |
| 184 | <span class="mlabels"><span class="mlabel">default</span></span> </td> |
| 185 | </tr> |
| 186 | </table> |
| 187 | </div><div class="memdoc"> |
| 188 | |
| 189 | </div> |
| 190 | </div> |
| 191 | <h2 class="groupheader">Member Function Documentation</h2> |
| 192 | <a id="a86ea36032637c02c045f2d433036a203"></a> |
| 193 | <h2 class="memtitle"><span class="permalink"><a href="#a86ea36032637c02c045f2d433036a203">◆ </a></span>GetMeasurements()</h2> |
| 194 | |
| 195 | <div class="memitem"> |
| 196 | <div class="memproto"> |
| 197 | <table class="mlabels"> |
| 198 | <tr> |
| 199 | <td class="mlabels-left"> |
| 200 | <table class="memname"> |
| 201 | <tr> |
| 202 | <td class="memname">std::vector< <a class="el" href="structarmnn_1_1_measurement.xhtml">Measurement</a> > GetMeasurements </td> |
| 203 | <td>(</td> |
| 204 | <td class="paramname"></td><td>)</td> |
| 205 | <td> const</td> |
| 206 | </tr> |
| 207 | </table> |
| 208 | </td> |
| 209 | <td class="mlabels-right"> |
| 210 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 211 | </tr> |
| 212 | </table> |
| 213 | </div><div class="memdoc"> |
| 214 | |
| 215 | <p>Get the recorded measurements. </p> |
| 216 | <p>This will be a list of the execution durations for all the OpenCl kernels. </p><dl class="section return"><dt>Returns</dt><dd>Recorded measurements </dd></dl> |
| 217 | |
| 218 | <p>Implements <a class="el" href="classarmnn_1_1_instrument.xhtml#a4055fcf05306a7478db7e192cf1e679d">Instrument</a>.</p> |
| 219 | |
| 220 | <p class="definition">Definition at line <a class="el" href="_open_cl_timer_8cpp_source.xhtml#l00081">81</a> of file <a class="el" href="_open_cl_timer_8cpp_source.xhtml">OpenClTimer.cpp</a>.</p> |
| 221 | |
| 222 | <p class="reference">References <a class="el" href="_open_cl_timer_8hpp_source.xhtml#l00034">OpenClTimer::GetName()</a>.</p> |
| 223 | |
| 224 | <p class="reference">Referenced by <a class="el" href="_open_cl_timer_8hpp_source.xhtml#l00034">OpenClTimer::GetName()</a>.</p> |
| 225 | <div class="fragment"><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> {</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  std::vector<Measurement> measurements;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  cl_command_queue_properties clQueueProperties = CLScheduler::get().queue().getInfo<CL_QUEUE_PROPERTIES>();</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="keywordtype">int</span> idx = 0;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>& kernel : m_Kernels)</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>  std::string name = std::string(this-><a class="code" href="classarmnn_1_1_open_cl_timer.xhtml#a7ddf0cf6f620d59c10e63495ace795d0">GetName</a>()) + <span class="stringliteral">"/"</span> + std::to_string(idx++) + <span class="stringliteral">": "</span> + kernel.m_Name;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keywordtype">double</span> timeUs = 0.0;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keywordflow">if</span>((clQueueProperties & CL_QUEUE_PROFILING_ENABLE) != 0)</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>  <span class="comment">// Wait for the event to finish before accessing profile results.</span></div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  kernel.m_Event.wait();</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  cl_ulong start = kernel.m_Event.getProfilingInfo<CL_PROFILING_COMMAND_START>();</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  cl_ulong end = kernel.m_Event.getProfilingInfo<CL_PROFILING_COMMAND_END>();</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  timeUs = <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(end - start) / 1000.0;</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>  measurements.emplace_back(name, timeUs, Measurement::Unit::TIME_US);</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  }</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="keywordflow">return</span> measurements;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> }</div><div class="ttc" id="classarmnn_1_1_open_cl_timer_xhtml_a7ddf0cf6f620d59c10e63495ace795d0"><div class="ttname"><a href="classarmnn_1_1_open_cl_timer.xhtml#a7ddf0cf6f620d59c10e63495ace795d0">armnn::OpenClTimer::GetName</a></div><div class="ttdeci">const char * GetName() const override</div><div class="ttdoc">Get the name of the timer. </div><div class="ttdef"><b>Definition:</b> <a href="_open_cl_timer_8hpp_source.xhtml#l00034">OpenClTimer.hpp:34</a></div></div> |
| 226 | </div><!-- fragment --> |
| 227 | </div> |
| 228 | </div> |
| 229 | <a id="a7ddf0cf6f620d59c10e63495ace795d0"></a> |
| 230 | <h2 class="memtitle"><span class="permalink"><a href="#a7ddf0cf6f620d59c10e63495ace795d0">◆ </a></span>GetName()</h2> |
| 231 | |
| 232 | <div class="memitem"> |
| 233 | <div class="memproto"> |
| 234 | <table class="mlabels"> |
| 235 | <tr> |
| 236 | <td class="mlabels-left"> |
| 237 | <table class="memname"> |
| 238 | <tr> |
| 239 | <td class="memname">const char* GetName </td> |
| 240 | <td>(</td> |
| 241 | <td class="paramname"></td><td>)</td> |
| 242 | <td> const</td> |
| 243 | </tr> |
| 244 | </table> |
| 245 | </td> |
| 246 | <td class="mlabels-right"> |
| 247 | <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 248 | </tr> |
| 249 | </table> |
| 250 | </div><div class="memdoc"> |
| 251 | |
| 252 | <p>Get the name of the timer. </p> |
| 253 | <dl class="section return"><dt>Returns</dt><dd>Name of the timer </dd></dl> |
| 254 | |
| 255 | <p>Implements <a class="el" href="classarmnn_1_1_instrument.xhtml#afcc1c3a20bd2860e0ddd21674389246f">Instrument</a>.</p> |
| 256 | |
| 257 | <p class="definition">Definition at line <a class="el" href="_open_cl_timer_8hpp_source.xhtml#l00034">34</a> of file <a class="el" href="_open_cl_timer_8hpp_source.xhtml">OpenClTimer.hpp</a>.</p> |
| 258 | |
| 259 | <p class="reference">References <a class="el" href="namespacearmnn.xhtml#a4e2dd387ba6f0dc5164b4cdf8de3262aaa4ecfc70574394990cf17bd83df499f7">armnn::Event</a>, and <a class="el" href="_open_cl_timer_8cpp_source.xhtml#l00081">OpenClTimer::GetMeasurements()</a>.</p> |
| 260 | |
| 261 | <p class="reference">Referenced by <a class="el" href="_open_cl_timer_8cpp_source.xhtml#l00081">OpenClTimer::GetMeasurements()</a>.</p> |
| 262 | <div class="fragment"><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> { <span class="keywordflow">return</span> <span class="stringliteral">"OpenClKernelTimer"</span>; }</div></div><!-- fragment --> |
| 263 | </div> |
| 264 | </div> |
| 265 | <a id="a156f3866ca69d98b4d9e6e1c1b3ec7da"></a> |
| 266 | <h2 class="memtitle"><span class="permalink"><a href="#a156f3866ca69d98b4d9e6e1c1b3ec7da">◆ </a></span>Start()</h2> |
| 267 | |
| 268 | <div class="memitem"> |
| 269 | <div class="memproto"> |
| 270 | <table class="mlabels"> |
| 271 | <tr> |
| 272 | <td class="mlabels-left"> |
| 273 | <table class="memname"> |
| 274 | <tr> |
| 275 | <td class="memname">void Start </td> |
| 276 | <td>(</td> |
| 277 | <td class="paramname"></td><td>)</td> |
| 278 | <td></td> |
| 279 | </tr> |
| 280 | </table> |
| 281 | </td> |
| 282 | <td class="mlabels-right"> |
| 283 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 284 | </tr> |
| 285 | </table> |
| 286 | </div><div class="memdoc"> |
| 287 | |
| 288 | <p>Start the OpenCl timer. </p> |
| 289 | |
| 290 | <p>Implements <a class="el" href="classarmnn_1_1_instrument.xhtml#a63ce9b9c6710c0dae98f88d6c602313a">Instrument</a>.</p> |
| 291 | |
| 292 | <p class="definition">Definition at line <a class="el" href="_open_cl_timer_8cpp_source.xhtml#l00021">21</a> of file <a class="el" href="_open_cl_timer_8cpp_source.xhtml">OpenClTimer.cpp</a>.</p> |
| 293 | |
| 294 | <p class="reference">References <a class="el" href="_ignore_unused_8hpp_source.xhtml#l00014">armnn::IgnoreUnused()</a>.</p> |
| 295 | <div class="fragment"><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> {</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  m_Kernels.clear();</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="keyword">auto</span> interceptor = [<span class="keyword">this</span>]( cl_command_queue command_queue,</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  cl_kernel kernel,</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  cl_uint work_dim,</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> *gwo,</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> *gws,</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> *lws,</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  cl_uint num_events_in_wait_list,</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  <span class="keyword">const</span> cl_event * event_wait_list,</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  cl_event * event)</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <a class="code" href="namespacearmnn.xhtml#a44affeeb090c3c6a3062830562672e84">IgnoreUnused</a>(event);</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  cl_int retVal = 0;</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>  <span class="comment">// Get the name of the kernel</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  cl::Kernel retainedKernel(kernel, <span class="keyword">true</span>);</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  std::stringstream ss;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  ss << retainedKernel.getInfo<CL_KERNEL_FUNCTION_NAME>();</div><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">// Embed workgroup sizes into the name</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keywordflow">if</span>(gws != <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  {</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  ss << <span class="stringliteral">" GWS["</span> << gws[0] << <span class="stringliteral">","</span> << gws[1] << <span class="stringliteral">","</span> << gws[2] << <span class="stringliteral">"]"</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="keywordflow">if</span>(lws != <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  {</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  ss << <span class="stringliteral">" LWS["</span> << lws[0] << <span class="stringliteral">","</span> << lws[1] << <span class="stringliteral">","</span> << lws[2] << <span class="stringliteral">"]"</span>;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  }</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  cl_event customEvent;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="comment">// Forward to original OpenCl function</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  retVal = m_OriginalEnqueueFunction( command_queue,</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  kernel,</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  work_dim,</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  gwo,</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  gws,</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  lws,</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  num_events_in_wait_list,</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  event_wait_list,</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  &customEvent);</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">// Store the Kernel info for later GetMeasurements() call</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  m_Kernels.emplace_back(ss.str(), customEvent);</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="keywordflow">return</span> retVal;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</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>  m_OriginalEnqueueFunction = CLSymbols::get().clEnqueueNDRangeKernel_ptr;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  CLSymbols::get().clEnqueueNDRangeKernel_ptr = interceptor;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> }</div><div class="ttc" id="namespacearmnn_xhtml_a44affeeb090c3c6a3062830562672e84"><div class="ttname"><a href="namespacearmnn.xhtml#a44affeeb090c3c6a3062830562672e84">armnn::IgnoreUnused</a></div><div class="ttdeci">void IgnoreUnused(Ts &&...)</div><div class="ttdef"><b>Definition:</b> <a href="_ignore_unused_8hpp_source.xhtml#l00014">IgnoreUnused.hpp:14</a></div></div> |
| 296 | </div><!-- fragment --> |
| 297 | </div> |
| 298 | </div> |
| 299 | <a id="a634c58de2126b4a4e6a2a093e60e1290"></a> |
| 300 | <h2 class="memtitle"><span class="permalink"><a href="#a634c58de2126b4a4e6a2a093e60e1290">◆ </a></span>Stop()</h2> |
| 301 | |
| 302 | <div class="memitem"> |
| 303 | <div class="memproto"> |
| 304 | <table class="mlabels"> |
| 305 | <tr> |
| 306 | <td class="mlabels-left"> |
| 307 | <table class="memname"> |
| 308 | <tr> |
| 309 | <td class="memname">void Stop </td> |
| 310 | <td>(</td> |
| 311 | <td class="paramname"></td><td>)</td> |
| 312 | <td></td> |
| 313 | </tr> |
| 314 | </table> |
| 315 | </td> |
| 316 | <td class="mlabels-right"> |
| 317 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 318 | </tr> |
| 319 | </table> |
| 320 | </div><div class="memdoc"> |
| 321 | |
| 322 | <p>Stop the OpenCl timer. </p> |
| 323 | |
| 324 | <p>Implements <a class="el" href="classarmnn_1_1_instrument.xhtml#a4d7bebcc22c1b09cf961b83bf84033b6">Instrument</a>.</p> |
| 325 | |
| 326 | <p class="definition">Definition at line <a class="el" href="_open_cl_timer_8cpp_source.xhtml#l00076">76</a> of file <a class="el" href="_open_cl_timer_8cpp_source.xhtml">OpenClTimer.cpp</a>.</p> |
| 327 | <div class="fragment"><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>  CLSymbols::get().clEnqueueNDRangeKernel_ptr = m_OriginalEnqueueFunction;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> }</div></div><!-- fragment --> |
| 328 | </div> |
| 329 | </div> |
| 330 | <hr/>The documentation for this class was generated from the following files:<ul> |
| 331 | <li>src/backends/cl/<a class="el" href="_open_cl_timer_8hpp_source.xhtml">OpenClTimer.hpp</a></li> |
| 332 | <li>src/backends/cl/<a class="el" href="_open_cl_timer_8cpp_source.xhtml">OpenClTimer.cpp</a></li> |
| 333 | </ul> |
| 334 | </div><!-- contents --> |
| 335 | </div><!-- doc-content --> |
| 336 | <!-- start footer part --> |
| 337 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 338 | <ul> |
| 339 | <li class="navelem"><a class="el" href="namespacearmnn.xhtml">armnn</a></li><li class="navelem"><a class="el" href="classarmnn_1_1_open_cl_timer.xhtml">OpenClTimer</a></li> |
| 340 | <li class="footer">Generated on Fri Mar 13 2020 16:09:19 for ArmNN by |
| 341 | <a href="http://www.doxygen.org/index.html"> |
| 342 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 343 | </ul> |
| 344 | </div> |
| 345 | </body> |
| 346 | </html> |