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/neon/workloads/NeonConvertFp32ToFp16Workload.cpp Source File</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('_neon_convert_fp32_to_fp16_workload_8cpp_source.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="headertitle"> |
| 84 | <div class="title">NeonConvertFp32ToFp16Workload.cpp</div> </div> |
| 85 | </div><!--header--> |
| 86 | <div class="contents"> |
| 87 | <a href="_neon_convert_fp32_to_fp16_workload_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> <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">#include "<a class="code" href="_neon_convert_fp32_to_fp16_workload_8hpp.html">NeonConvertFp32ToFp16Workload.hpp</a>"</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="_half_8hpp.html">Half.hpp</a>></span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#include <<a class="code" href="_profiling_8hpp.html">Profiling.hpp</a>></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> </div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#include <<a class="code" href="_floating_point_converter_8hpp.html">armnnUtils/FloatingPointConverter.hpp</a>></span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> </div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#include <<a class="code" href="_workload_utils_8hpp.html">backendsCommon/WorkloadUtils.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="keyword">namespace </span><a class="code" href="namespacearmnn.html">armnn</a></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> {</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="classarmnn_1_1_neon_convert_fp32_to_fp16_workload.html#a074e5e0c6d0901ec2a2a2cba69e5df98"> 18</a></span> <a class="code" href="classarmnn_1_1_neon_convert_fp32_to_fp16_workload.html#a074e5e0c6d0901ec2a2a2cba69e5df98">NeonConvertFp32ToFp16Workload::NeonConvertFp32ToFp16Workload</a>(<span class="keyword">const</span> <a class="code" href="structarmnn_1_1_convert_fp32_to_fp16_queue_descriptor.html">ConvertFp32ToFp16QueueDescriptor</a>& descriptor,</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  <span class="keyword">const</span> <a class="code" href="structarmnn_1_1_workload_info.html">WorkloadInfo</a>& info)</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  : <a class="code" href="classarmnn_1_1_multi_typed_workload.html">Float32ToFloat16Workload</a><<a class="code" href="structarmnn_1_1_convert_fp32_to_fp16_queue_descriptor.html">ConvertFp32ToFp16QueueDescriptor</a>>(descriptor, info)</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>  this-><a class="code" href="classarmnn_1_1_base_workload.html#a0a487c549c63319505095b855ea3c195">m_Data</a>.<a class="code" href="structarmnn_1_1_queue_descriptor.html#a765d2cee4ccce5b9467e0c2b6d25b84a">ValidateInputsOutputs</a>(<span class="stringliteral">"NeonConvertFp32ToFp16Workload"</span>, 1, 1);</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  <a class="code" href="namespacearmnn.html#afb5b53a8b0c01d4f27830bef0f25ca09">GatherTensorHandlePairs</a>(descriptor, m_TensorHandlePairs);</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> </div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="classarmnn_1_1_neon_convert_fp32_to_fp16_workload.html#ae071e8822437c78baea75c3aef3a263a"> 26</a></span> <span class="keywordtype">void</span> <a class="code" href="classarmnn_1_1_neon_convert_fp32_to_fp16_workload.html#ae071e8822437c78baea75c3aef3a263a">NeonConvertFp32ToFp16Workload::Execute</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="keyword"></span>{</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  <a class="code" href="_neon_workload_utils_8hpp.html#a8bf91fd5e5875631bcf6abbcd97fe2f4">ARMNN_SCOPED_PROFILING_EVENT_NEON</a>(<span class="stringliteral">"NeonConvertFp32ToFp16Workload_Execute"</span>);</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>  <span class="keyword">auto</span> convertFunc = [](uint8_t* dst, <span class="keyword">const</span> uint8_t* src, <span class="keywordtype">size_t</span> size)</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  {</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  <span class="keyword">auto</span> input = <span class="keyword">reinterpret_cast<</span><span class="keyword">const </span><span class="keywordtype">float</span>*<span class="keyword">></span>(src);</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="keyword">auto</span> output = <span class="keyword">reinterpret_cast<</span><a class="code" href="namespacearmnn.html#a0f38fa92b2468d5378258a2b074c1a31">Half</a>*<span class="keyword">></span>(dst);</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="keywordtype">size_t</span> numElements = size/2; <span class="comment">// 2 bytes per fp16</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <a class="code" href="classarmnn_utils_1_1_floating_point_converter.html#af0fdbfb53596052d571cb73899f9da2b">armnnUtils::FloatingPointConverter::ConvertFloat32To16</a>(input, numElements, output);</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  };</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>& pair : m_TensorHandlePairs)</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  {</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <a class="code" href="namespacearmnn.html#a92c91193007aa49f4732d6dba5397f8d">CopyTensorContentsGeneric</a>(pair.first, pair.second, convertFunc);</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> }</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> } <span class="comment">//namespace armnn</span></div><div class="ttc" id="namespacearmnn_html_a0f38fa92b2468d5378258a2b074c1a31"><div class="ttname"><a href="namespacearmnn.html#a0f38fa92b2468d5378258a2b074c1a31">armnn::Half</a></div><div class="ttdeci">half_float::half Half</div><div class="ttdef"><b>Definition:</b> <a href="_half_8hpp_source.html#l00016">Half.hpp:16</a></div></div> |
| 88 | <div class="ttc" id="_neon_workload_utils_8hpp_html_a8bf91fd5e5875631bcf6abbcd97fe2f4"><div class="ttname"><a href="_neon_workload_utils_8hpp.html#a8bf91fd5e5875631bcf6abbcd97fe2f4">ARMNN_SCOPED_PROFILING_EVENT_NEON</a></div><div class="ttdeci">#define ARMNN_SCOPED_PROFILING_EVENT_NEON(name)</div><div class="ttdef"><b>Definition:</b> <a href="_neon_workload_utils_8hpp_source.html#l00017">NeonWorkloadUtils.hpp:17</a></div></div> |
| 89 | <div class="ttc" id="_neon_convert_fp32_to_fp16_workload_8hpp_html"><div class="ttname"><a href="_neon_convert_fp32_to_fp16_workload_8hpp.html">NeonConvertFp32ToFp16Workload.hpp</a></div></div> |
| 90 | <div class="ttc" id="namespacearmnn_html_a92c91193007aa49f4732d6dba5397f8d"><div class="ttname"><a href="namespacearmnn.html#a92c91193007aa49f4732d6dba5397f8d">armnn::CopyTensorContentsGeneric</a></div><div class="ttdeci">void CopyTensorContentsGeneric(const ITensorHandle *srcTensor, ITensorHandle *dstTensor, CopyFunc copy)</div><div class="ttdef"><b>Definition:</b> <a href="_workload_utils_8hpp_source.html#l00049">WorkloadUtils.hpp:49</a></div></div> |
| 91 | <div class="ttc" id="structarmnn_1_1_convert_fp32_to_fp16_queue_descriptor_html"><div class="ttname"><a href="structarmnn_1_1_convert_fp32_to_fp16_queue_descriptor.html">armnn::ConvertFp32ToFp16QueueDescriptor</a></div><div class="ttdef"><b>Definition:</b> <a href="_workload_data_8hpp_source.html#l00415">WorkloadData.hpp:415</a></div></div> |
| 92 | <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> |
| 93 | <div class="ttc" id="_floating_point_converter_8hpp_html"><div class="ttname"><a href="_floating_point_converter_8hpp.html">FloatingPointConverter.hpp</a></div></div> |
| 94 | <div class="ttc" id="classarmnn_1_1_neon_convert_fp32_to_fp16_workload_html_ae071e8822437c78baea75c3aef3a263a"><div class="ttname"><a href="classarmnn_1_1_neon_convert_fp32_to_fp16_workload.html#ae071e8822437c78baea75c3aef3a263a">armnn::NeonConvertFp32ToFp16Workload::Execute</a></div><div class="ttdeci">virtual void Execute() const override</div><div class="ttdef"><b>Definition:</b> <a href="_neon_convert_fp32_to_fp16_workload_8cpp_source.html#l00026">NeonConvertFp32ToFp16Workload.cpp:26</a></div></div> |
| 95 | <div class="ttc" id="_workload_utils_8hpp_html"><div class="ttname"><a href="_workload_utils_8hpp.html">WorkloadUtils.hpp</a></div></div> |
| 96 | <div class="ttc" id="classarmnn_utils_1_1_floating_point_converter_html_af0fdbfb53596052d571cb73899f9da2b"><div class="ttname"><a href="classarmnn_utils_1_1_floating_point_converter.html#af0fdbfb53596052d571cb73899f9da2b">armnnUtils::FloatingPointConverter::ConvertFloat32To16</a></div><div class="ttdeci">static void ConvertFloat32To16(const float *srcFloat32Buffer, size_t numElements, void *dstFloat16Buffer)</div><div class="ttdef"><b>Definition:</b> <a href="_floating_point_converter_8cpp_source.html#l00015">FloatingPointConverter.cpp:15</a></div></div> |
| 97 | <div class="ttc" id="classarmnn_1_1_base_workload_html_a0a487c549c63319505095b855ea3c195"><div class="ttname"><a href="classarmnn_1_1_base_workload.html#a0a487c549c63319505095b855ea3c195">armnn::BaseWorkload::m_Data</a></div><div class="ttdeci">const QueueDescriptor m_Data</div><div class="ttdef"><b>Definition:</b> <a href="_workload_8hpp_source.html#l00046">Workload.hpp:46</a></div></div> |
| 98 | <div class="ttc" id="classarmnn_1_1_neon_convert_fp32_to_fp16_workload_html_a074e5e0c6d0901ec2a2a2cba69e5df98"><div class="ttname"><a href="classarmnn_1_1_neon_convert_fp32_to_fp16_workload.html#a074e5e0c6d0901ec2a2a2cba69e5df98">armnn::NeonConvertFp32ToFp16Workload::NeonConvertFp32ToFp16Workload</a></div><div class="ttdeci">NeonConvertFp32ToFp16Workload(const ConvertFp32ToFp16QueueDescriptor &descriptor, const WorkloadInfo &info)</div><div class="ttdef"><b>Definition:</b> <a href="_neon_convert_fp32_to_fp16_workload_8cpp_source.html#l00018">NeonConvertFp32ToFp16Workload.cpp:18</a></div></div> |
| 99 | <div class="ttc" id="classarmnn_1_1_multi_typed_workload_html"><div class="ttname"><a href="classarmnn_1_1_multi_typed_workload.html">armnn::MultiTypedWorkload</a></div><div class="ttdef"><b>Definition:</b> <a href="_workload_8hpp_source.html#l00105">Workload.hpp:105</a></div></div> |
| 100 | <div class="ttc" id="namespacearmnn_html_afb5b53a8b0c01d4f27830bef0f25ca09"><div class="ttname"><a href="namespacearmnn.html#afb5b53a8b0c01d4f27830bef0f25ca09">armnn::GatherTensorHandlePairs</a></div><div class="ttdeci">void GatherTensorHandlePairs(const DescriptorType &descriptor, std::vector< std::pair< SrcTensorHandleType *, DstTensorHandleType *>> &tensorHandlePairs)</div><div class="ttdef"><b>Definition:</b> <a href="_workload_utils_8hpp_source.html#l00192">WorkloadUtils.hpp:192</a></div></div> |
| 101 | <div class="ttc" id="namespacearmnn_html"><div class="ttname"><a href="namespacearmnn.html">armnn</a></div><div class="ttdef"><b>Definition:</b> <a href="_backend_helper_8hpp_source.html#l00011">BackendHelper.hpp:11</a></div></div> |
| 102 | <div class="ttc" id="structarmnn_1_1_queue_descriptor_html_a765d2cee4ccce5b9467e0c2b6d25b84a"><div class="ttname"><a href="structarmnn_1_1_queue_descriptor.html#a765d2cee4ccce5b9467e0c2b6d25b84a">armnn::QueueDescriptor::ValidateInputsOutputs</a></div><div class="ttdeci">void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const</div><div class="ttdef"><b>Definition:</b> <a href="_workload_data_8cpp_source.html#l00459">WorkloadData.cpp:459</a></div></div> |
| 103 | <div class="ttc" id="_profiling_8hpp_html"><div class="ttname"><a href="_profiling_8hpp.html">Profiling.hpp</a></div></div> |
| 104 | <div class="ttc" id="_half_8hpp_html"><div class="ttname"><a href="_half_8hpp.html">Half.hpp</a></div></div> |
| 105 | </div><!-- fragment --></div><!-- contents --> |
| 106 | </div><!-- doc-content --> |
| 107 | <!-- start footer part --> |
| 108 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 109 | <ul> |
| 110 | <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_d86eb514662c7c08e168285f21d00ea1.html">neon</a></li><li class="navelem"><a class="el" href="dir_369c3c20501d0d10bd0354bf11c2f559.html">workloads</a></li><li class="navelem"><a class="el" href="_neon_convert_fp32_to_fp16_workload_8cpp.html">NeonConvertFp32ToFp16Workload.cpp</a></li> |
| 111 | <li class="footer">Generated on Fri Mar 13 2020 16:06:58 for ArmNN by |
| 112 | <a href="http://www.doxygen.org/index.html"> |
| 113 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 114 | </ul> |
| 115 | </div> |
| 116 | </body> |
| 117 | </html> |