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: src/backends/cl/test/OpenClTimerTest.cpp Source File</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('_open_cl_timer_test_8cpp_source.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="headertitle"> |
| 98 | <div class="title">OpenClTimerTest.cpp</div> </div> |
| 99 | </div><!--header--> |
| 100 | <div class="contents"> |
| 101 | <a href="_open_cl_timer_test_8cpp.xhtml">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">//</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// Copyright © 2017 Arm Ltd. All rights reserved.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// SPDX-License-Identifier: MIT</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">//</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> </div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#if (defined(__aarch64__)) || (defined(__x86_64__)) // disable test failing on FireFly/Armv7</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> </div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#include "<a class="code" href="_cl_workload_factory_helper_8hpp.xhtml">ClWorkloadFactoryHelper.hpp</a>"</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> </div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include <<a class="code" href="_tensor_helpers_8hpp.xhtml">test/TensorHelpers.hpp</a>></span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> </div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include <<a class="code" href="_cpu_tensor_handle_8hpp.xhtml">backendsCommon/CpuTensorHandle.hpp</a>></span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#include <<a class="code" href="_workload_factory_8hpp.xhtml">backendsCommon/WorkloadFactory.hpp</a>></span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include <<a class="code" href="_cl_context_control_8hpp.xhtml">cl/ClContextControl.hpp</a>></span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include <<a class="code" href="_cl_workload_factory_8hpp.xhtml">cl/ClWorkloadFactory.hpp</a>></span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include <<a class="code" href="_open_cl_timer_8hpp.xhtml">cl/OpenClTimer.hpp</a>></span></div><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> <span class="preprocessor">#include <<a class="code" href="_tensor_copy_utils_8hpp.xhtml">backendsCommon/test/TensorCopyUtils.hpp</a>></span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include <<a class="code" href="_workload_test_utils_8hpp.xhtml">backendsCommon/test/WorkloadTestUtils.hpp</a>></span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include <arm_compute/runtime/CL/CLScheduler.h></span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include <boost/format.hpp></span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <boost/test/unit_test.hpp></span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <iostream></span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">using namespace </span><a class="code" href="namespacearmnn.xhtml">armnn</a>;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="keyword">struct </span>OpenClFixture</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="comment">// Initialising ClContextControl to ensure OpenCL is loaded correctly for each test case.</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="comment">// NOTE: Profiling needs to be enabled in ClContextControl to be able to obtain execution</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="comment">// times from OpenClTimer.</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  OpenClFixture() : m_ClContextControl(nullptr, <a class="code" href="_cl_layer_tests_8cpp.xhtml#a37f1c3ccc9fc906be85185350dd83d48">true</a>) {}</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  ~OpenClFixture() {}</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <a class="code" href="classarmnn_1_1_cl_context_control.xhtml">ClContextControl</a> m_ClContextControl;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> };</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> BOOST_FIXTURE_TEST_SUITE(OpenClTimerBatchNorm, OpenClFixture)</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">using</span> <a class="code" href="classarmnn_1_1_cl_workload_factory.xhtml">FactoryType</a> = <a class="code" href="classarmnn_1_1_cl_workload_factory.xhtml">ClWorkloadFactory</a>;</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> <a class="code" href="namespacearmnn.xhtml#a10d15f3df1ab52b3b915a4be1dbf386b">BOOST_AUTO_TEST_CASE</a>(OpenClTimerBatchNorm)</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> {</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keyword">auto</span> memoryManager = ClWorkloadFactoryHelper::GetMemoryManager();</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <a class="code" href="classarmnn_1_1_cl_workload_factory.xhtml">ClWorkloadFactory</a> workloadFactory = ClWorkloadFactoryHelper::GetFactory(memoryManager);</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>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width = 2;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height = 3;</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels = 2;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> num = 1;</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>  <a class="code" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a> inputTensorInfo( {num, channels, height, width}, <a class="code" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">DataType::Float32</a>);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <a class="code" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a> outputTensorInfo({num, channels, height, width}, <a class="code" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">DataType::Float32</a>);</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <a class="code" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a> tensorInfo({channels}, <a class="code" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">DataType::Float32</a>);</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keyword">auto</span> input = MakeTensor<float, 4>(inputTensorInfo,</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>  1.f, 4.f,</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  4.f, 2.f,</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  1.f, 6.f,</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>  1.f, 1.f,</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  4.f, 1.f,</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  -2.f, 4.f</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> </div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="comment">// these values are per-channel of the input</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="keyword">auto</span> mean = MakeTensor<float, 1>(tensorInfo, { 3.f, -2.f });</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keyword">auto</span> variance = MakeTensor<float, 1>(tensorInfo, { 4.f, 9.f });</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keyword">auto</span> beta = MakeTensor<float, 1>(tensorInfo, { 3.f, 2.f });</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keyword">auto</span> gamma = MakeTensor<float, 1>(tensorInfo, { 2.f, 1.f });</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>  std::unique_ptr<ITensorHandle> inputHandle = workloadFactory.<a class="code" href="classarmnn_1_1_cl_workload_factory.xhtml#a7239477811c44d4398f0c2d291d9ea76">CreateTensorHandle</a>(inputTensorInfo);</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  std::unique_ptr<ITensorHandle> outputHandle = workloadFactory.<a class="code" href="classarmnn_1_1_cl_workload_factory.xhtml#a7239477811c44d4398f0c2d291d9ea76">CreateTensorHandle</a>(outputTensorInfo);</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> </div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <a class="code" href="structarmnn_1_1_batch_normalization_queue_descriptor.xhtml">BatchNormalizationQueueDescriptor</a> data;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <a class="code" href="structarmnn_1_1_workload_info.xhtml">WorkloadInfo</a> <a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">info</a>;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml">ScopedCpuTensorHandle</a> meanTensor(tensorInfo);</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml">ScopedCpuTensorHandle</a> varianceTensor(tensorInfo);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml">ScopedCpuTensorHandle</a> betaTensor(tensorInfo);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml">ScopedCpuTensorHandle</a> gammaTensor(tensorInfo);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <a class="code" href="_tensor_copy_utils_8cpp.xhtml#afaaca8c3f3a467d124bba44067d2afa8">AllocateAndCopyDataToITensorHandle</a>(&meanTensor, &mean[0]);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <a class="code" href="_tensor_copy_utils_8cpp.xhtml#afaaca8c3f3a467d124bba44067d2afa8">AllocateAndCopyDataToITensorHandle</a>(&varianceTensor, &variance[0]);</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <a class="code" href="_tensor_copy_utils_8cpp.xhtml#afaaca8c3f3a467d124bba44067d2afa8">AllocateAndCopyDataToITensorHandle</a>(&betaTensor, &beta[0]);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <a class="code" href="_tensor_copy_utils_8cpp.xhtml#afaaca8c3f3a467d124bba44067d2afa8">AllocateAndCopyDataToITensorHandle</a>(&gammaTensor, &gamma[0]);</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get());</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get());</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  data.<a class="code" href="structarmnn_1_1_batch_normalization_queue_descriptor.xhtml#a40051a7aa82f25df43cc4244de04a7ec">m_Mean</a> = &meanTensor;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  data.<a class="code" href="structarmnn_1_1_batch_normalization_queue_descriptor.xhtml#a8cd8696bb773a02714d3fc095794ec54">m_Variance</a> = &varianceTensor;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  data.<a class="code" href="structarmnn_1_1_batch_normalization_queue_descriptor.xhtml#ad5f8f205ba69eb186688ca1c2aec207c">m_Beta</a> = &betaTensor;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  data.<a class="code" href="structarmnn_1_1_batch_normalization_queue_descriptor.xhtml#afbe59e02a5464703b865ea1ccfff49fd">m_Gamma</a> = &gammaTensor;</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  data.<a class="code" href="structarmnn_1_1_queue_descriptor_with_parameters.xhtml#aad91b9bbf7aa365d304febe79a3d1333">m_Parameters</a>.<a class="code" href="structarmnn_1_1_batch_normalization_descriptor.xhtml#a11c821c7524251004a72ed13c510853c">m_Eps</a> = 0.0f;</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">// for each channel:</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="comment">// substract mean, divide by standard deviation (with an epsilon to avoid div by 0)</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="comment">// multiply by gamma and add beta</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  std::unique_ptr<IWorkload> workload = workloadFactory.<a class="code" href="classarmnn_1_1_cl_workload_factory.xhtml#a9cce78b879d26312fd515270afc1e66a">CreateBatchNormalization</a>(data, info);</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  inputHandle->Allocate();</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  outputHandle->Allocate();</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span> </div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <a class="code" href="_tensor_copy_utils_8cpp.xhtml#ae15f1a3c55d2db87683577de9fa4437c">CopyDataToITensorHandle</a>(inputHandle.get(), &input[0][0][0][0]);</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>  <a class="code" href="classarmnn_1_1_open_cl_timer.xhtml">OpenClTimer</a> openClTimer;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> </div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  BOOST_CHECK_EQUAL(openClTimer.GetName(), <span class="stringliteral">"OpenClKernelTimer"</span>);</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> </div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="comment">//Start the timer</span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  openClTimer.<a class="code" href="classarmnn_1_1_open_cl_timer.xhtml#a156f3866ca69d98b4d9e6e1c1b3ec7da">Start</a>();</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="comment">//Execute the workload</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  workload->Execute();</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> </div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="comment">//Stop the timer</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  openClTimer.Stop();</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  BOOST_CHECK_EQUAL(openClTimer.GetMeasurements().size(), 1);</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span> </div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  BOOST_CHECK_EQUAL(openClTimer.GetMeasurements().front().m_Name,</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="stringliteral">"OpenClKernelTimer/0: batchnormalization_layer_nchw GWS[1,3,2]"</span>);</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a0c262ba6f6c189a2d092d127c1b7627b">BOOST_CHECK</a>(openClTimer.GetMeasurements().front().m_Value > 0);</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span> </div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span> }</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span> </div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <a class="code" href="_profiler_tests_8cpp.xhtml#af7f71af5c6c124222dd1c42c5df892f4">BOOST_AUTO_TEST_SUITE_END</a>()</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> </div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span> <span class="preprocessor">#endif //aarch64 or x86_64</span></div><div class="ttc" id="classarmnn_1_1_cl_workload_factory_xhtml"><div class="ttname"><a href="classarmnn_1_1_cl_workload_factory.xhtml">armnn::ClWorkloadFactory</a></div><div class="ttdef"><b>Definition:</b> <a href="_cl_workload_factory_8hpp_source.xhtml#l00017">ClWorkloadFactory.hpp:17</a></div></div> |
| 102 | <div class="ttc" id="_tensor_copy_utils_8hpp_xhtml"><div class="ttname"><a href="_tensor_copy_utils_8hpp.xhtml">TensorCopyUtils.hpp</a></div></div> |
| 103 | <div class="ttc" id="structarmnn_1_1_batch_normalization_queue_descriptor_xhtml_afbe59e02a5464703b865ea1ccfff49fd"><div class="ttname"><a href="structarmnn_1_1_batch_normalization_queue_descriptor.xhtml#afbe59e02a5464703b865ea1ccfff49fd">armnn::BatchNormalizationQueueDescriptor::m_Gamma</a></div><div class="ttdeci">const ConstCpuTensorHandle * m_Gamma</div><div class="ttdef"><b>Definition:</b> <a href="_workload_data_8hpp_source.xhtml#l00282">WorkloadData.hpp:282</a></div></div> |
| 104 | <div class="ttc" id="structarmnn_1_1_batch_normalization_queue_descriptor_xhtml_ad5f8f205ba69eb186688ca1c2aec207c"><div class="ttname"><a href="structarmnn_1_1_batch_normalization_queue_descriptor.xhtml#ad5f8f205ba69eb186688ca1c2aec207c">armnn::BatchNormalizationQueueDescriptor::m_Beta</a></div><div class="ttdeci">const ConstCpuTensorHandle * m_Beta</div><div class="ttdef"><b>Definition:</b> <a href="_workload_data_8hpp_source.xhtml#l00281">WorkloadData.hpp:281</a></div></div> |
| 105 | <div class="ttc" id="classarmnn_1_1_open_cl_timer_xhtml_a156f3866ca69d98b4d9e6e1c1b3ec7da"><div class="ttname"><a href="classarmnn_1_1_open_cl_timer.xhtml#a156f3866ca69d98b4d9e6e1c1b3ec7da">armnn::OpenClTimer::Start</a></div><div class="ttdeci">void Start() override</div><div class="ttdoc">Start the OpenCl timer. </div><div class="ttdef"><b>Definition:</b> <a href="_open_cl_timer_8cpp_source.xhtml#l00021">OpenClTimer.cpp:21</a></div></div> |
| 106 | <div class="ttc" id="classarmnn_1_1_cl_context_control_xhtml"><div class="ttname"><a href="classarmnn_1_1_cl_context_control.xhtml">armnn::ClContextControl</a></div><div class="ttdef"><b>Definition:</b> <a href="_cl_context_control_8hpp_source.xhtml#l00015">ClContextControl.hpp:15</a></div></div> |
| 107 | <div class="ttc" id="_cl_workload_factory_helper_8hpp_xhtml"><div class="ttname"><a href="_cl_workload_factory_helper_8hpp.xhtml">ClWorkloadFactoryHelper.hpp</a></div></div> |
| 108 | <div class="ttc" id="_cl_context_control_8hpp_xhtml"><div class="ttname"><a href="_cl_context_control_8hpp.xhtml">ClContextControl.hpp</a></div></div> |
| 109 | <div class="ttc" id="_workload_factory_8hpp_xhtml"><div class="ttname"><a href="_workload_factory_8hpp.xhtml">WorkloadFactory.hpp</a></div></div> |
| 110 | <div class="ttc" id="classarmnn_1_1_tensor_info_xhtml"><div class="ttname"><a href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00053">Tensor.hpp:53</a></div></div> |
| 111 | <div class="ttc" id="_workload_test_utils_8hpp_xhtml"><div class="ttname"><a href="_workload_test_utils_8hpp.xhtml">WorkloadTestUtils.hpp</a></div></div> |
| 112 | <div class="ttc" id="structarmnn_1_1_batch_normalization_queue_descriptor_xhtml_a40051a7aa82f25df43cc4244de04a7ec"><div class="ttname"><a href="structarmnn_1_1_batch_normalization_queue_descriptor.xhtml#a40051a7aa82f25df43cc4244de04a7ec">armnn::BatchNormalizationQueueDescriptor::m_Mean</a></div><div class="ttdeci">const ConstCpuTensorHandle * m_Mean</div><div class="ttdef"><b>Definition:</b> <a href="_workload_data_8hpp_source.xhtml#l00279">WorkloadData.hpp:279</a></div></div> |
| 113 | <div class="ttc" id="structarmnn_1_1_batch_normalization_descriptor_xhtml_a11c821c7524251004a72ed13c510853c"><div class="ttname"><a href="structarmnn_1_1_batch_normalization_descriptor.xhtml#a11c821c7524251004a72ed13c510853c">armnn::BatchNormalizationDescriptor::m_Eps</a></div><div class="ttdeci">float m_Eps</div><div class="ttdoc">Value to add to the variance. Used to avoid dividing by zero. </div><div class="ttdef"><b>Definition:</b> <a href="_descriptors_8hpp_source.xhtml#l00623">Descriptors.hpp:623</a></div></div> |
| 114 | <div class="ttc" id="classarmnn_1_1_cl_workload_factory_xhtml_a7239477811c44d4398f0c2d291d9ea76"><div class="ttname"><a href="classarmnn_1_1_cl_workload_factory.xhtml#a7239477811c44d4398f0c2d291d9ea76">armnn::ClWorkloadFactory::CreateTensorHandle</a></div><div class="ttdeci">std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo, const bool IsMemoryManaged=true) const override</div><div class="ttdef"><b>Definition:</b> <a href="_cl_workload_factory_8cpp_source.xhtml#l00085">ClWorkloadFactory.cpp:85</a></div></div> |
| 115 | <div class="ttc" id="structarmnn_1_1_batch_normalization_queue_descriptor_xhtml_a8cd8696bb773a02714d3fc095794ec54"><div class="ttname"><a href="structarmnn_1_1_batch_normalization_queue_descriptor.xhtml#a8cd8696bb773a02714d3fc095794ec54">armnn::BatchNormalizationQueueDescriptor::m_Variance</a></div><div class="ttdeci">const ConstCpuTensorHandle * m_Variance</div><div class="ttdef"><b>Definition:</b> <a href="_workload_data_8hpp_source.xhtml#l00280">WorkloadData.hpp:280</a></div></div> |
| 116 | <div class="ttc" id="_cl_workload_factory_8hpp_xhtml"><div class="ttname"><a href="_cl_workload_factory_8hpp.xhtml">ClWorkloadFactory.hpp</a></div></div> |
| 117 | <div class="ttc" id="namespacearmnn_xhtml"><div class="ttname"><a href="namespacearmnn.xhtml">armnn</a></div><div class="ttdoc">Copyright (c) 2020 ARM Limited. </div><div class="ttdef"><b>Definition:</b> <a href="00__introduction_8dox_source.xhtml#l00025">00_introduction.dox:25</a></div></div> |
| 118 | <div class="ttc" id="_cl_layer_tests_8cpp_xhtml_a37f1c3ccc9fc906be85185350dd83d48"><div class="ttname"><a href="_cl_layer_tests_8cpp.xhtml#a37f1c3ccc9fc906be85185350dd83d48">true</a></div><div class="ttdeci">DataLayout::NCHW DataLayout::NCHW DataLayout::NHWC DataLayout::NHWC true</div><div class="ttdef"><b>Definition:</b> <a href="_cl_layer_tests_8cpp_source.xhtml#l00202">ClLayerTests.cpp:202</a></div></div> |
| 119 | <div class="ttc" id="structarmnn_1_1_queue_descriptor_with_parameters_xhtml_aad91b9bbf7aa365d304febe79a3d1333"><div class="ttname"><a href="structarmnn_1_1_queue_descriptor_with_parameters.xhtml#aad91b9bbf7aa365d304febe79a3d1333">armnn::QueueDescriptorWithParameters::m_Parameters</a></div><div class="ttdeci">LayerDescriptor m_Parameters</div><div class="ttdef"><b>Definition:</b> <a href="_workload_data_8hpp_source.xhtml#l00049">WorkloadData.hpp:49</a></div></div> |
| 120 | <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> |
| 121 | <div class="ttc" id="_open_cl_timer_8hpp_xhtml"><div class="ttname"><a href="_open_cl_timer_8hpp.xhtml">OpenClTimer.hpp</a></div></div> |
| 122 | <div class="ttc" id="_tensor_helpers_8hpp_xhtml"><div class="ttname"><a href="_tensor_helpers_8hpp.xhtml">TensorHelpers.hpp</a></div></div> |
| 123 | <div class="ttc" id="_tensor_copy_utils_8cpp_xhtml_afaaca8c3f3a467d124bba44067d2afa8"><div class="ttname"><a href="_tensor_copy_utils_8cpp.xhtml#afaaca8c3f3a467d124bba44067d2afa8">AllocateAndCopyDataToITensorHandle</a></div><div class="ttdeci">void AllocateAndCopyDataToITensorHandle(armnn::ITensorHandle *tensorHandle, const void *memory)</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_copy_utils_8cpp_source.xhtml#l00019">TensorCopyUtils.cpp:19</a></div></div> |
| 124 | <div class="ttc" id="namespacearmnn_xhtml_a10d15f3df1ab52b3b915a4be1dbf386b"><div class="ttname"><a href="namespacearmnn.xhtml#a10d15f3df1ab52b3b915a4be1dbf386b">armnn::BOOST_AUTO_TEST_CASE</a></div><div class="ttdeci">BOOST_AUTO_TEST_CASE(CheckConvolution2dLayer)</div><div class="ttdef"><b>Definition:</b> <a href="_const_tensor_layer_visitor_8cpp_source.xhtml#l00170">ConstTensorLayerVisitor.cpp:170</a></div></div> |
| 125 | <div class="ttc" id="classarmnn_1_1_open_cl_timer_xhtml"><div class="ttname"><a href="classarmnn_1_1_open_cl_timer.xhtml">armnn::OpenClTimer</a></div><div class="ttdoc">OpenClTimer instrument that times all OpenCl kernels executed between calls to Start() and Stop()...</div><div class="ttdef"><b>Definition:</b> <a href="_open_cl_timer_8hpp_source.xhtml#l00020">OpenClTimer.hpp:20</a></div></div> |
| 126 | <div class="ttc" id="_cpu_tensor_handle_8hpp_xhtml"><div class="ttname"><a href="_cpu_tensor_handle_8hpp.xhtml">CpuTensorHandle.hpp</a></div></div> |
| 127 | <div class="ttc" id="_profiler_tests_8cpp_xhtml_af7f71af5c6c124222dd1c42c5df892f4"><div class="ttname"><a href="_profiler_tests_8cpp.xhtml#af7f71af5c6c124222dd1c42c5df892f4">BOOST_AUTO_TEST_SUITE_END</a></div><div class="ttdeci">BOOST_AUTO_TEST_SUITE_END()</div></div> |
| 128 | <div class="ttc" id="classarmnn_1_1_scoped_cpu_tensor_handle_xhtml"><div class="ttname"><a href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml">armnn::ScopedCpuTensorHandle</a></div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8hpp_source.xhtml#l00106">CpuTensorHandle.hpp:106</a></div></div> |
| 129 | <div class="ttc" id="namespacearmnn_xhtml_a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c"><div class="ttname"><a href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">armnn::BoostLogSeverityMapping::info</a></div></div> |
| 130 | <div class="ttc" id="structarmnn_1_1_batch_normalization_queue_descriptor_xhtml"><div class="ttname"><a href="structarmnn_1_1_batch_normalization_queue_descriptor.xhtml">armnn::BatchNormalizationQueueDescriptor</a></div><div class="ttdef"><b>Definition:</b> <a href="_workload_data_8hpp_source.xhtml#l00269">WorkloadData.hpp:269</a></div></div> |
| 131 | <div class="ttc" id="namespacearmnn_xhtml_ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204"><div class="ttname"><a href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">armnn::DataType::Float32</a></div></div> |
| 132 | <div class="ttc" id="structarmnn_1_1_workload_info_xhtml"><div class="ttname"><a href="structarmnn_1_1_workload_info.xhtml">armnn::WorkloadInfo</a></div><div class="ttdoc">Contains information about inputs and outputs to a layer. </div><div class="ttdef"><b>Definition:</b> <a href="include_2armnn_2backends_2_workload_info_8hpp_source.xhtml#l00016">WorkloadInfo.hpp:16</a></div></div> |
| 133 | <div class="ttc" id="classarmnn_1_1_cl_workload_factory_xhtml_a9cce78b879d26312fd515270afc1e66a"><div class="ttname"><a href="classarmnn_1_1_cl_workload_factory.xhtml#a9cce78b879d26312fd515270afc1e66a">armnn::ClWorkloadFactory::CreateBatchNormalization</a></div><div class="ttdeci">std::unique_ptr< IWorkload > CreateBatchNormalization(const BatchNormalizationQueueDescriptor &descriptor, const WorkloadInfo &info) const override</div><div class="ttdef"><b>Definition:</b> <a href="_cl_workload_factory_8cpp_source.xhtml#l00160">ClWorkloadFactory.cpp:160</a></div></div> |
| 134 | <div class="ttc" id="_tensor_copy_utils_8cpp_xhtml_ae15f1a3c55d2db87683577de9fa4437c"><div class="ttname"><a href="_tensor_copy_utils_8cpp.xhtml#ae15f1a3c55d2db87683577de9fa4437c">CopyDataToITensorHandle</a></div><div class="ttdeci">void CopyDataToITensorHandle(armnn::ITensorHandle *tensorHandle, const void *memory)</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_copy_utils_8cpp_source.xhtml#l00009">TensorCopyUtils.cpp:9</a></div></div> |
| 135 | </div><!-- fragment --></div><!-- contents --> |
| 136 | </div><!-- doc-content --> |
| 137 | <!-- start footer part --> |
| 138 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 139 | <ul> |
| 140 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_0f3cdec46afbc61a1ded8e1687c9c9a0.xhtml">backends</a></li><li class="navelem"><a class="el" href="dir_1ad86c6d39ab715a831555571b9e98a5.xhtml">cl</a></li><li class="navelem"><a class="el" href="dir_02bab2737bbb2fb3882a0be567244fbf.xhtml">test</a></li><li class="navelem"><a class="el" href="_open_cl_timer_test_8cpp.xhtml">OpenClTimerTest.cpp</a></li> |
| 141 | <li class="footer">Generated on Fri Mar 13 2020 16:09:11 for ArmNN by |
| 142 | <a href="http://www.doxygen.org/index.html"> |
| 143 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 144 | </ul> |
| 145 | </div> |
| 146 | </body> |
| 147 | </html> |