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: src/backends/backendsCommon/test/layerTests/ConvertFp16ToFp32TestImpl.cpp File 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('_convert_fp16_to_fp32_test_impl_8cpp.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="#func-members">Functions</a> </div> |
| 85 | <div class="headertitle"> |
| 86 | <div class="title">ConvertFp16ToFp32TestImpl.cpp File Reference</div> </div> |
| 87 | </div><!--header--> |
| 88 | <div class="contents"> |
| 89 | <div class="textblock"><code>#include "<a class="el" href="_convert_fp16_to_fp32_test_impl_8hpp_source.html">ConvertFp16ToFp32TestImpl.hpp</a>"</code><br /> |
| 90 | <code>#include <<a class="el" href="_half_8hpp_source.html">Half.hpp</a>></code><br /> |
| 91 | <code>#include <<a class="el" href="_tensor_copy_utils_8hpp_source.html">backendsCommon/test/TensorCopyUtils.hpp</a>></code><br /> |
| 92 | <code>#include <<a class="el" href="_workload_test_utils_8hpp_source.html">backendsCommon/test/WorkloadTestUtils.hpp</a>></code><br /> |
| 93 | <code>#include <<a class="el" href="_tensor_helpers_8hpp_source.html">test/TensorHelpers.hpp</a>></code><br /> |
| 94 | </div> |
| 95 | <p><a href="_convert_fp16_to_fp32_test_impl_8cpp_source.html">Go to the source code of this file.</a></p> |
| 96 | <table class="memberdecls"> |
| 97 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 98 | Functions</h2></td></tr> |
| 99 | <tr class="memitem:a1e862bfea62536c5af0afda533d969db"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_layer_test_result.html">LayerTestResult</a>< float, 4 > </td><td class="memItemRight" valign="bottom"><a class="el" href="_convert_fp16_to_fp32_test_impl_8cpp.html#a1e862bfea62536c5af0afda533d969db">SimpleConvertFp16ToFp32Test</a> (<a class="el" href="classarmnn_1_1_i_workload_factory.html">armnn::IWorkloadFactory</a> &workloadFactory, const <a class="el" href="classarmnn_1_1_i_backend_internal.html#a693b40e6b94e958836aeb0410ca186bd">armnn::IBackendInternal::IMemoryManagerSharedPtr</a> &memoryManager)</td></tr> |
| 100 | <tr class="separator:a1e862bfea62536c5af0afda533d969db"><td class="memSeparator" colspan="2"> </td></tr> |
| 101 | </table> |
| 102 | <h2 class="groupheader">Function Documentation</h2> |
| 103 | <a id="a1e862bfea62536c5af0afda533d969db"></a> |
| 104 | <h2 class="memtitle"><span class="permalink"><a href="#a1e862bfea62536c5af0afda533d969db">◆ </a></span>SimpleConvertFp16ToFp32Test()</h2> |
| 105 | |
| 106 | <div class="memitem"> |
| 107 | <div class="memproto"> |
| 108 | <table class="memname"> |
| 109 | <tr> |
| 110 | <td class="memname"><a class="el" href="struct_layer_test_result.html">LayerTestResult</a><float, 4> SimpleConvertFp16ToFp32Test </td> |
| 111 | <td>(</td> |
| 112 | <td class="paramtype"><a class="el" href="classarmnn_1_1_i_workload_factory.html">armnn::IWorkloadFactory</a> & </td> |
| 113 | <td class="paramname"><em>workloadFactory</em>, </td> |
| 114 | </tr> |
| 115 | <tr> |
| 116 | <td class="paramkey"></td> |
| 117 | <td></td> |
| 118 | <td class="paramtype">const <a class="el" href="classarmnn_1_1_i_backend_internal.html#a693b40e6b94e958836aeb0410ca186bd">armnn::IBackendInternal::IMemoryManagerSharedPtr</a> & </td> |
| 119 | <td class="paramname"><em>memoryManager</em> </td> |
| 120 | </tr> |
| 121 | <tr> |
| 122 | <td></td> |
| 123 | <td>)</td> |
| 124 | <td></td><td></td> |
| 125 | </tr> |
| 126 | </table> |
| 127 | </div><div class="memdoc"> |
| 128 | |
| 129 | <p class="definition">Definition at line <a class="el" href="_convert_fp16_to_fp32_test_impl_8cpp_source.html#l00016">16</a> of file <a class="el" href="_convert_fp16_to_fp32_test_impl_8cpp_source.html">ConvertFp16ToFp32TestImpl.cpp</a>.</p> |
| 130 | |
| 131 | <p class="reference">References <a class="el" href="_tensor_copy_utils_8cpp_source.html#l00014">CopyDataFromITensorHandle()</a>, <a class="el" href="_tensor_copy_utils_8cpp_source.html#l00009">CopyDataToITensorHandle()</a>, <a class="el" href="_workload_factory_8cpp_source.html#l01130">IWorkloadFactory::CreateConvertFp16ToFp32()</a>, <a class="el" href="classarmnn_1_1_i_workload_factory.html#a15c140be4ddceffee16436f009d3ed94">IWorkloadFactory::CreateTensorHandle()</a>, <a class="el" href="namespacearmnn.html#ad8ed01ff3ff33333d8e19db4d2818bb6a26e6ed77470c6f2f830ecf874e6c0d55">armnn::Float16</a>, and <a class="el" href="namespacearmnn.html#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">armnn::Float32</a>.</p> |
| 132 | |
| 133 | <p class="reference">Referenced by <a class="el" href="_ref_layer_tests_8cpp_source.html#l01057">BOOST_AUTO_TEST_CASE()</a>.</p> |
| 134 | <div class="fragment"><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> {</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  boost::ignore_unused(memoryManager);</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  <span class="keyword">using namespace </span>half_float::literal;</div><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>  <span class="keyword">const</span> <a class="code" href="classarmnn_1_1_tensor_info.html">armnn::TensorInfo</a> inputTensorInfo({1, 3, 2, 3}, <a class="code" href="namespacearmnn.html#ad8ed01ff3ff33333d8e19db4d2818bb6a26e6ed77470c6f2f830ecf874e6c0d55">armnn::DataType::Float16</a>);</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  <span class="keyword">const</span> <a class="code" href="classarmnn_1_1_tensor_info.html">armnn::TensorInfo</a> outputTensorInfo({1, 3, 2, 3}, <a class="code" href="namespacearmnn.html#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">armnn::DataType::Float32</a>);</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  <span class="keyword">auto</span> input = MakeTensor<armnn::Half, 4>(inputTensorInfo,</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  { -37.5_h, -15.2_h, -8.76_h, -2.0_h, -1.5_h, -1.3_h, -0.5_h, -0.4_h, 0.0_h,</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  1.0_h, 0.4_h, 0.5_h, 1.3_h, 1.5_h, 2.0_h, 8.76_h, 15.2_h, 37.5_h });</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <a class="code" href="struct_layer_test_result.html">LayerTestResult<float, 4></a> ret(outputTensorInfo);</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  ret.outputExpected = MakeTensor<float, 4>(outputTensorInfo,</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  { -37.5f, -15.2f, -8.76f, -2.0f, -1.5f, -1.3f, -0.5f, -0.4f, 0.0f,</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  1.0f, 0.4f, 0.5f, 1.3f, 1.5f, 2.0f, 8.76f, 15.2f, 37.5f });</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>  std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.<a class="code" href="classarmnn_1_1_i_workload_factory.html#a15c140be4ddceffee16436f009d3ed94">CreateTensorHandle</a>(inputTensorInfo);</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.<a class="code" href="classarmnn_1_1_i_workload_factory.html#a15c140be4ddceffee16436f009d3ed94">CreateTensorHandle</a>(outputTensorInfo);</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>  <a class="code" href="structarmnn_1_1_convert_fp16_to_fp32_queue_descriptor.html">armnn::ConvertFp16ToFp32QueueDescriptor</a> data;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <a class="code" href="structarmnn_1_1_workload_info.html">armnn::WorkloadInfo</a> <a class="code" href="namespacearmnn.html#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">info</a>;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get());</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get());</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>  std::unique_ptr<armnn::IWorkload> workload = workloadFactory.<a class="code" href="classarmnn_1_1_i_workload_factory.html#a83e0a21747c1ce29b2083c1e3b1d88af">CreateConvertFp16ToFp32</a>(data, info);</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>  inputHandle->Allocate();</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  outputHandle->Allocate();</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>  <a class="code" href="_tensor_copy_utils_8cpp.html#ae15f1a3c55d2db87683577de9fa4437c">CopyDataToITensorHandle</a>(inputHandle.get(), &input[0][0][0][0]);</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>  workload->Execute();</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>  <a class="code" href="_tensor_copy_utils_8cpp.html#a99b626c58a926dc7d6df78d22ec186c8">CopyDataFromITensorHandle</a>(&ret.output[0][0][0][0], outputHandle.get());</div><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="keywordflow">return</span> ret;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> }</div><div class="ttc" id="classarmnn_1_1_i_workload_factory_html_a83e0a21747c1ce29b2083c1e3b1d88af"><div class="ttname"><a href="classarmnn_1_1_i_workload_factory.html#a83e0a21747c1ce29b2083c1e3b1d88af">armnn::IWorkloadFactory::CreateConvertFp16ToFp32</a></div><div class="ttdeci">virtual std::unique_ptr< IWorkload > CreateConvertFp16ToFp32(const ConvertFp16ToFp32QueueDescriptor &descriptor, const WorkloadInfo &info) const</div><div class="ttdef"><b>Definition:</b> <a href="_workload_factory_8cpp_source.html#l01130">WorkloadFactory.cpp:1130</a></div></div> |
| 135 | <div class="ttc" id="_tensor_copy_utils_8cpp_html_ae15f1a3c55d2db87683577de9fa4437c"><div class="ttname"><a href="_tensor_copy_utils_8cpp.html#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.html#l00009">TensorCopyUtils.cpp:9</a></div></div> |
| 136 | <div class="ttc" id="namespacearmnn_html_a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c"><div class="ttname"><a href="namespacearmnn.html#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">armnn::BoostLogSeverityMapping::info</a></div></div> |
| 137 | <div class="ttc" id="classarmnn_1_1_tensor_info_html"><div class="ttname"><a href="classarmnn_1_1_tensor_info.html">armnn::TensorInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.html#l00053">Tensor.hpp:53</a></div></div> |
| 138 | <div class="ttc" id="classarmnn_1_1_i_workload_factory_html_a15c140be4ddceffee16436f009d3ed94"><div class="ttname"><a href="classarmnn_1_1_i_workload_factory.html#a15c140be4ddceffee16436f009d3ed94">armnn::IWorkloadFactory::CreateTensorHandle</a></div><div class="ttdeci">virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo, const bool IsMemoryManaged=true) const =0</div></div> |
| 139 | <div class="ttc" id="struct_layer_test_result_html"><div class="ttname"><a href="struct_layer_test_result.html">LayerTestResult</a></div><div class="ttdef"><b>Definition:</b> <a href="_layer_test_result_8hpp_source.html#l00029">LayerTestResult.hpp:29</a></div></div> |
| 140 | <div class="ttc" id="_tensor_copy_utils_8cpp_html_a99b626c58a926dc7d6df78d22ec186c8"><div class="ttname"><a href="_tensor_copy_utils_8cpp.html#a99b626c58a926dc7d6df78d22ec186c8">CopyDataFromITensorHandle</a></div><div class="ttdeci">void CopyDataFromITensorHandle(void *memory, const armnn::ITensorHandle *tensorHandle)</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_copy_utils_8cpp_source.html#l00014">TensorCopyUtils.cpp:14</a></div></div> |
| 141 | <div class="ttc" id="structarmnn_1_1_convert_fp16_to_fp32_queue_descriptor_html"><div class="ttname"><a href="structarmnn_1_1_convert_fp16_to_fp32_queue_descriptor.html">armnn::ConvertFp16ToFp32QueueDescriptor</a></div><div class="ttdef"><b>Definition:</b> <a href="_workload_data_8hpp_source.html#l00410">WorkloadData.hpp:410</a></div></div> |
| 142 | <div class="ttc" id="structarmnn_1_1_workload_info_html"><div class="ttname"><a href="structarmnn_1_1_workload_info.html">armnn::WorkloadInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="include_2armnn_2backends_2_workload_info_8hpp_source.html#l00016">WorkloadInfo.hpp:16</a></div></div> |
| 143 | <div class="ttc" id="namespacearmnn_html_ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204"><div class="ttname"><a href="namespacearmnn.html#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">armnn::DataType::Float32</a></div></div> |
| 144 | <div class="ttc" id="namespacearmnn_html_ad8ed01ff3ff33333d8e19db4d2818bb6a26e6ed77470c6f2f830ecf874e6c0d55"><div class="ttname"><a href="namespacearmnn.html#ad8ed01ff3ff33333d8e19db4d2818bb6a26e6ed77470c6f2f830ecf874e6c0d55">armnn::DataType::Float16</a></div></div> |
| 145 | </div><!-- fragment --> |
| 146 | </div> |
| 147 | </div> |
| 148 | </div><!-- contents --> |
| 149 | </div><!-- doc-content --> |
| 150 | <!-- start footer part --> |
| 151 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 152 | <ul> |
| 153 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_0f3cdec46afbc61a1ded8e1687c9c9a0.html">backends</a></li><li class="navelem"><a class="el" href="dir_797a213d7d01b98ef12d53b0820ea64e.html">backendsCommon</a></li><li class="navelem"><a class="el" href="dir_28bfe507f7e135bdae07c2a6b7f66696.html">test</a></li><li class="navelem"><a class="el" href="dir_99a30439342d160875b21dac3498ad7f.html">layerTests</a></li><li class="navelem"><a class="el" href="_convert_fp16_to_fp32_test_impl_8cpp.html">ConvertFp16ToFp32TestImpl.cpp</a></li> |
| 154 | <li class="footer">Generated on Fri Mar 13 2020 16:07:00 for ArmNN by |
| 155 | <a href="http://www.doxygen.org/index.html"> |
| 156 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 157 | </ul> |
| 158 | </div> |
| 159 | </body> |
| 160 | </html> |