blob: 015358df58692f82231082eaf7f54ff858ccdbce [file] [log] [blame]
Nikhil Raj38b600d2024-02-15 15:02:19 +00001<!-- HTML header for doxygen 1.8.17-->
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4<head>
5<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6<meta http-equiv="X-UA-Compatible" content="IE=9"/>
7<meta name="generator" content="Doxygen 1.8.17"/>
8<meta name="viewport" content="width=device-width, initial-scale=1"/>
9<title>Arm NN: src/armnn/WallClockTimer.cpp Source File</title>
10<link href="tabs.css" rel="stylesheet" type="text/css"/>
11<script type="text/javascript" src="jquery.js"></script>
12<script type="text/javascript" src="dynsections.js"></script>
13<link href="navtree.css" rel="stylesheet" type="text/css"/>
14<script type="text/javascript" src="resize.js"></script>
15<script type="text/javascript" src="navtreedata.js"></script>
16<script type="text/javascript" src="navtree.js"></script>
17<link href="search/search.css" rel="stylesheet" type="text/css"/>
18<script type="text/javascript" src="search/searchdata.js"></script>
19<script type="text/javascript" src="search/search.js"></script>
20<script type="text/x-mathjax-config">
21 MathJax.Hub.Config({
22 extensions: ["tex2jax.js"],
23 jax: ["input/TeX","output/HTML-CSS"],
24});
25</script>
26<script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
27<link href="doxygen.css" rel="stylesheet" type="text/css" />
28<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
29</head>
30<body>
31<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
32<div id="titlearea">
33<table cellspacing="0" cellpadding="0">
34 <tbody>
35 <tr style="height: 56px;">
36 <img alt="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 15rem; margin-top: .5rem; margin-left 13px"/>
37 <td id="projectalign" style="padding-left: 0.9em;">
38 <div id="projectname">
39 &#160;<span id="projectnumber">24.02</span>
40 </div>
41 </td>
42 </tr>
43 </tbody>
44</table>
45</div>
46<!-- end header part -->
47<!-- Generated by Doxygen 1.8.17 -->
48<script type="text/javascript">
49/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
50var searchBox = new SearchBox("searchBox", "search",false,'Search');
51/* @license-end */
52</script>
53<script type="text/javascript" src="menudata.js"></script>
54<script type="text/javascript" src="menu.js"></script>
55<script type="text/javascript">
56/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
57$(function() {
58 initMenu('',true,false,'search.php','Search');
59 $(document).ready(function() { init_search(); });
60});
61/* @license-end */</script>
62<div id="main-nav"></div>
63</div><!-- top -->
64<div id="side-nav" class="ui-resizable side-nav-resizable">
65 <div id="nav-tree">
66 <div id="nav-tree-contents">
67 <div id="nav-sync" class="sync"></div>
68 </div>
69 </div>
70 <div id="splitbar" style="-moz-user-select:none;"
71 class="ui-resizable-handle">
72 </div>
73</div>
74<script type="text/javascript">
75/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
76$(document).ready(function(){initNavTree('_wall_clock_timer_8cpp_source.html',''); initResizable(); });
77/* @license-end */
78</script>
79<div id="doc-content">
80<!-- window showing the filter options -->
81<div id="MSearchSelectWindow"
82 onmouseover="return searchBox.OnSearchSelectShow()"
83 onmouseout="return searchBox.OnSearchSelectHide()"
84 onkeydown="return searchBox.OnSearchSelectKey(event)">
85</div>
86
87<!-- iframe showing the search results (closed by default) -->
88<div id="MSearchResultsWindow">
89<iframe src="javascript:void(0)" frameborder="0"
90 name="MSearchResults" id="MSearchResults">
91</iframe>
92</div>
93
94<div class="header">
95 <div class="headertitle">
96<div class="title">WallClockTimer.cpp</div> </div>
97</div><!--header-->
98<div class="contents">
99<a href="_wall_clock_timer_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">//</span></div>
100<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">// Copyright © 2017 Arm Ltd. All rights reserved.</span></div>
101<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// SPDX-License-Identifier: MIT</span></div>
102<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">//</span></div>
103<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160; </div>
104<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_wall_clock_timer_8hpp.html">WallClockTimer.hpp</a>&quot;</span></div>
105<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160; </div>
106<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacearmnn.html">armnn</a></div>
107<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;{</div>
108<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160; </div>
109<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="keyword">const</span> std::string <a class="code" href="classarmnn_1_1_wall_clock_timer.html#aece42eedfcac1aa046e0dff4763b300a">WallClockTimer::WALL_CLOCK_TIME</a> (<span class="stringliteral">&quot;Wall clock time&quot;</span>);</div>
110<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="keyword">const</span> std::string <a class="code" href="classarmnn_1_1_wall_clock_timer.html#aef02e15721d757f07f3812f09fc892d4">WallClockTimer::WALL_CLOCK_TIME_START</a>(<a class="code" href="classarmnn_1_1_wall_clock_timer.html#aece42eedfcac1aa046e0dff4763b300a">WallClockTimer::WALL_CLOCK_TIME</a> + <span class="stringliteral">&quot; (Start)&quot;</span>);</div>
111<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="keyword">const</span> std::string <a class="code" href="classarmnn_1_1_wall_clock_timer.html#abd358345fde773d79e57461c1b062703">WallClockTimer::WALL_CLOCK_TIME_STOP</a> (<a class="code" href="classarmnn_1_1_wall_clock_timer.html#aece42eedfcac1aa046e0dff4763b300a">WallClockTimer::WALL_CLOCK_TIME</a> + <span class="stringliteral">&quot; (Stop)&quot;</span>);</div>
112<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160; </div>
113<div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="classarmnn_1_1_wall_clock_timer.html#ad47edad463024345ce1409153c259215"> 15</a></span>&#160;<span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classarmnn_1_1_wall_clock_timer.html#ad47edad463024345ce1409153c259215">WallClockTimer::GetName</a>()<span class="keyword"> const</span></div>
114<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="keyword"></span>{</div>
115<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160; <span class="keywordflow">return</span> <span class="stringliteral">&quot;WallClockTimer&quot;</span>;</div>
116<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;}</div>
117<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160; </div>
118<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="classarmnn_1_1_wall_clock_timer.html#a156f3866ca69d98b4d9e6e1c1b3ec7da"> 20</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classarmnn_1_1_wall_clock_timer.html#a156f3866ca69d98b4d9e6e1c1b3ec7da">WallClockTimer::Start</a>()</div>
119<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;{</div>
120<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; m_Start = clock::now();</div>
121<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;}</div>
122<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; </div>
123<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="classarmnn_1_1_wall_clock_timer.html#a634c58de2126b4a4e6a2a093e60e1290"> 25</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classarmnn_1_1_wall_clock_timer.html#a634c58de2126b4a4e6a2a093e60e1290">WallClockTimer::Stop</a>()</div>
124<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;{</div>
125<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; m_Stop = clock::now();</div>
126<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;}</div>
127<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
128<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="classarmnn_1_1_wall_clock_timer.html#a86ea36032637c02c045f2d433036a203"> 30</a></span>&#160;std::vector&lt;Measurement&gt; <a class="code" href="classarmnn_1_1_wall_clock_timer.html#a86ea36032637c02c045f2d433036a203">WallClockTimer::GetMeasurements</a>()<span class="keyword"> const</span></div>
129<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="keyword"></span>{</div>
130<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; <span class="keyword">const</span> <span class="keyword">auto</span> delta = std::chrono::duration&lt;double, std::micro&gt;(m_Stop - m_Start);</div>
131<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; <span class="keyword">const</span> <span class="keyword">auto</span> startTimeMs = std::chrono::duration&lt;double, std::micro&gt;(m_Start.time_since_epoch());</div>
132<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="keyword">const</span> <span class="keyword">auto</span> stopTimeMs = std::chrono::duration&lt;double, std::micro&gt;(m_Stop.time_since_epoch());</div>
133<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
134<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keywordflow">return</span> { { <a class="code" href="classarmnn_1_1_wall_clock_timer.html#aece42eedfcac1aa046e0dff4763b300a">WALL_CLOCK_TIME</a>, delta.count(), Measurement::Unit::TIME_US },</div>
135<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; { <a class="code" href="classarmnn_1_1_wall_clock_timer.html#aef02e15721d757f07f3812f09fc892d4">WALL_CLOCK_TIME_START</a>, startTimeMs.count(), Measurement::Unit::TIME_US },</div>
136<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; { <a class="code" href="classarmnn_1_1_wall_clock_timer.html#abd358345fde773d79e57461c1b062703">WALL_CLOCK_TIME_STOP</a>, stopTimeMs.count(), Measurement::Unit::TIME_US } };</div>
137<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;}</div>
138<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; </div>
139<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;} <span class="comment">//namespace armnn</span></div>
140</div><!-- fragment --></div><!-- contents -->
141</div><!-- doc-content -->
142<div class="ttc" id="aclassarmnn_1_1_wall_clock_timer_html_abd358345fde773d79e57461c1b062703"><div class="ttname"><a href="classarmnn_1_1_wall_clock_timer.html#abd358345fde773d79e57461c1b062703">armnn::WallClockTimer::WALL_CLOCK_TIME_STOP</a></div><div class="ttdeci">static const std::string WALL_CLOCK_TIME_STOP</div><div class="ttdef"><b>Definition:</b> <a href="_wall_clock_timer_8hpp_source.html#l00065">WallClockTimer.hpp:65</a></div></div>
143<div class="ttc" id="aclassarmnn_1_1_wall_clock_timer_html_a86ea36032637c02c045f2d433036a203"><div class="ttname"><a href="classarmnn_1_1_wall_clock_timer.html#a86ea36032637c02c045f2d433036a203">armnn::WallClockTimer::GetMeasurements</a></div><div class="ttdeci">std::vector&lt; Measurement &gt; GetMeasurements() const override</div><div class="ttdef"><b>Definition:</b> <a href="_wall_clock_timer_8cpp_source.html#l00030">WallClockTimer.cpp:30</a></div></div>
144<div class="ttc" id="a_wall_clock_timer_8hpp_html"><div class="ttname"><a href="_wall_clock_timer_8hpp.html">WallClockTimer.hpp</a></div></div>
145<div class="ttc" id="aclassarmnn_1_1_wall_clock_timer_html_a634c58de2126b4a4e6a2a093e60e1290"><div class="ttname"><a href="classarmnn_1_1_wall_clock_timer.html#a634c58de2126b4a4e6a2a093e60e1290">armnn::WallClockTimer::Stop</a></div><div class="ttdeci">void Stop() override</div><div class="ttdef"><b>Definition:</b> <a href="_wall_clock_timer_8cpp_source.html#l00025">WallClockTimer.cpp:25</a></div></div>
146<div class="ttc" id="aclassarmnn_1_1_wall_clock_timer_html_aece42eedfcac1aa046e0dff4763b300a"><div class="ttname"><a href="classarmnn_1_1_wall_clock_timer.html#aece42eedfcac1aa046e0dff4763b300a">armnn::WallClockTimer::WALL_CLOCK_TIME</a></div><div class="ttdeci">static const std::string WALL_CLOCK_TIME</div><div class="ttdef"><b>Definition:</b> <a href="_wall_clock_timer_8hpp_source.html#l00063">WallClockTimer.hpp:63</a></div></div>
147<div class="ttc" id="aclassarmnn_1_1_wall_clock_timer_html_a156f3866ca69d98b4d9e6e1c1b3ec7da"><div class="ttname"><a href="classarmnn_1_1_wall_clock_timer.html#a156f3866ca69d98b4d9e6e1c1b3ec7da">armnn::WallClockTimer::Start</a></div><div class="ttdeci">void Start() override</div><div class="ttdef"><b>Definition:</b> <a href="_wall_clock_timer_8cpp_source.html#l00020">WallClockTimer.cpp:20</a></div></div>
148<div class="ttc" id="anamespacearmnn_html"><div class="ttname"><a href="namespacearmnn.html">armnn</a></div><div class="ttdoc">Copyright (c) 2021 ARM Limited and Contributors.</div><div class="ttdef"><b>Definition:</b> <a href="01__00__quick__start_8dox_source.html#l00006">01_00_quick_start.dox:6</a></div></div>
149<div class="ttc" id="aclassarmnn_1_1_wall_clock_timer_html_aef02e15721d757f07f3812f09fc892d4"><div class="ttname"><a href="classarmnn_1_1_wall_clock_timer.html#aef02e15721d757f07f3812f09fc892d4">armnn::WallClockTimer::WALL_CLOCK_TIME_START</a></div><div class="ttdeci">static const std::string WALL_CLOCK_TIME_START</div><div class="ttdef"><b>Definition:</b> <a href="_wall_clock_timer_8hpp_source.html#l00064">WallClockTimer.hpp:64</a></div></div>
150<div class="ttc" id="aclassarmnn_1_1_wall_clock_timer_html_ad47edad463024345ce1409153c259215"><div class="ttname"><a href="classarmnn_1_1_wall_clock_timer.html#ad47edad463024345ce1409153c259215">armnn::WallClockTimer::GetName</a></div><div class="ttdeci">const char * GetName() const override</div><div class="ttdef"><b>Definition:</b> <a href="_wall_clock_timer_8cpp_source.html#l00015">WallClockTimer.cpp:15</a></div></div>
151<!-- start footer part -->
152<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
153 <ul>
154 <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_e0a84d05c80a2ef4231141dcbbeac5c8.html">armnn</a></li><li class="navelem"><a class="el" href="_wall_clock_timer_8cpp.html">WallClockTimer.cpp</a></li>
155 <li class="footer">Generated on Wed Feb 14 2024 16:36:14 for Arm NN by
156 <a href="http://www.doxygen.org/index.html">
157 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
158 </ul>
159</div>
160</body>
161</html>