Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 1 | <!-- HTML header for doxygen 1.8.15--> |
| 2 | <!-- Remember to use version doxygen 1.8.15 +--> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 3 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 4 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 5 | <head> |
| 6 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 7 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 8 | <meta name="generator" content="Doxygen 1.8.15"/> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 9 | <meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines --> |
| 10 | <title>Compute Library: src/core/CL/cl_kernels/pooling_layer_quantized.cl File Reference</title> |
| 11 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 12 | <script type="text/javascript" src="jquery.js"></script> |
| 13 | <script type="text/javascript" src="dynsections.js"></script> |
| 14 | <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 15 | <script type="text/javascript" src="resize.js"></script> |
| 16 | <script type="text/javascript" src="navtreedata.js"></script> |
| 17 | <script type="text/javascript" src="navtree.js"></script> |
| 18 | <script type="text/javascript"> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 19 | /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 20 | $(document).ready(initResizable); |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 21 | /* @license-end */</script> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 22 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 23 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 24 | <script type="text/javascript" src="search/search.js"></script> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 25 | <script type="text/x-mathjax-config"> |
| 26 | MathJax.Hub.Config({ |
| 27 | extensions: ["tex2jax.js"], |
| 28 | jax: ["input/TeX","output/HTML-CSS"], |
| 29 | }); |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 30 | </script><script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 31 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 32 | <link href="stylesheet.css" rel="stylesheet" type="text/css"/> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 33 | </head> |
| 34 | <body> |
| 35 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 36 | <div id="titlearea"> |
| 37 | <table cellspacing="0" cellpadding="0"> |
| 38 | <tbody> |
| 39 | <tr style="height: 56px;"> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 40 | <img alt="Compute Library" src="https://raw.githubusercontent.com/ARM-software/ComputeLibrary/gh-pages/ACL_logo.png" style="max-width: 100%;margin-top: 15px;margin-left: 10px"/> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 41 | <td style="padding-left: 0.5em;"> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 42 | <div id="projectname"> |
Jenkins | 7f09cf7 | 2020-01-22 18:08:16 +0000 | [diff] [blame^] | 43 |  <span id="projectnumber">19.11.1</span> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 44 | </div> |
| 45 | </td> |
| 46 | </tr> |
| 47 | </tbody> |
| 48 | </table> |
| 49 | </div> |
| 50 | <!-- end header part --> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 51 | <!-- Generated by Doxygen 1.8.15 --> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 52 | <script type="text/javascript"> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 53 | /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 54 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 55 | /* @license-end */ |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 56 | </script> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 57 | <script type="text/javascript" src="menudata.js"></script> |
| 58 | <script type="text/javascript" src="menu.js"></script> |
| 59 | <script type="text/javascript"> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 60 | /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 61 | $(function() { |
| 62 | initMenu('',true,false,'search.php','Search'); |
| 63 | $(document).ready(function() { init_search(); }); |
| 64 | }); |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 65 | /* @license-end */</script> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 66 | <div id="main-nav"></div> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 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"> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 79 | /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 80 | $(document).ready(function(){initNavTree('pooling__layer__quantized_8cl.xhtml','');}); |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 81 | /* @license-end */ |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 82 | </script> |
| 83 | <div id="doc-content"> |
| 84 | <!-- window showing the filter options --> |
| 85 | <div id="MSearchSelectWindow" |
| 86 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 87 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 88 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 89 | </div> |
| 90 | |
| 91 | <!-- iframe showing the search results (closed by default) --> |
| 92 | <div id="MSearchResultsWindow"> |
| 93 | <iframe src="javascript:void(0)" frameborder="0" |
| 94 | name="MSearchResults" id="MSearchResults"> |
| 95 | </iframe> |
| 96 | </div> |
| 97 | |
| 98 | <div class="header"> |
| 99 | <div class="summary"> |
| 100 | <a href="#define-members">Macros</a> | |
| 101 | <a href="#func-members">Functions</a> </div> |
| 102 | <div class="headertitle"> |
| 103 | <div class="title">pooling_layer_quantized.cl File Reference</div> </div> |
| 104 | </div><!--header--> |
| 105 | <div class="contents"> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 106 | <div class="textblock"><code>#include "<a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml">helpers.h</a>"</code><br /> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 107 | </div> |
| 108 | <p><a href="pooling__layer__quantized_8cl_source.xhtml">Go to the source code of this file.</a></p> |
| 109 | <table class="memberdecls"> |
| 110 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> |
| 111 | Macros</h2></td></tr> |
| 112 | <tr class="memitem:a482ef7d59a5f474ca126e737c7f0978a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="pooling__layer__quantized_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(x, y)   ((x) + (y))</td></tr> |
| 113 | <tr class="separator:a482ef7d59a5f474ca126e737c7f0978a"><td class="memSeparator" colspan="2"> </td></tr> |
| 114 | <tr class="memitem:a5db17889d824975fefb2ce2f4690637f"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="pooling__layer__quantized_8cl.xhtml#a5db17889d824975fefb2ce2f4690637f">DIV_OP</a>(x, y)   (x * (1.f / y))</td></tr> |
| 115 | <tr class="separator:a5db17889d824975fefb2ce2f4690637f"><td class="memSeparator" colspan="2"> </td></tr> |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 116 | <tr class="memitem:a6c01fa98d360a9d52926dc6a5a599711"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="pooling__layer__quantized_8cl.xhtml#a6c01fa98d360a9d52926dc6a5a599711">DIV_OP_NHWC</a>(x, y)   (convert_float8(x) * (float8)(1.f / y))</td></tr> |
| 117 | <tr class="separator:a6c01fa98d360a9d52926dc6a5a599711"><td class="memSeparator" colspan="2"> </td></tr> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 118 | </table><table class="memberdecls"> |
| 119 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 120 | Functions</h2></td></tr> |
Anthony Barbier | 06ea048 | 2018-02-22 15:45:35 +0000 | [diff] [blame] | 121 | <tr class="memitem:a4057c01dd49145c5e463f1cea52542df"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="pooling__layer__quantized_8cl.xhtml#a4057c01dd49145c5e463f1cea52542df">calculate_avg_scale</a> (const int pool_size_x, const int pool_size_y, const int upper_bound_w, const int upper_bound_h, const int pad_x, const int pad_y, const int stride_x, const int stride_y)</td></tr> |
| 122 | <tr class="separator:a4057c01dd49145c5e463f1cea52542df"><td class="memSeparator" colspan="2"> </td></tr> |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 123 | <tr class="memitem:a5c74cefcb6318451b5785dd00bd9b05f"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="pooling__layer__quantized_8cl.xhtml#a5c74cefcb6318451b5785dd00bd9b05f">pooling_layer_MxN_quantized_nchw</a> (__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_stride_z, uint input_step_z, uint input_offset_first_element_in_bytes, __global uchar *output_ptr, uint output_stride_x, uint output_step_x, uint output_stride_y, uint output_step_y, uint output_stride_z, uint output_step_z, uint output_offset_first_element_in_bytes)</td></tr> |
| 124 | <tr class="memdesc:a5c74cefcb6318451b5785dd00bd9b05f"><td class="mdescLeft"> </td><td class="mdescRight">Performs a pooling function of pool size equal to N (NCHW) <a href="#a5c74cefcb6318451b5785dd00bd9b05f">More...</a><br /></td></tr> |
| 125 | <tr class="separator:a5c74cefcb6318451b5785dd00bd9b05f"><td class="memSeparator" colspan="2"> </td></tr> |
| 126 | <tr class="memitem:a235920cb0f8577da6e104ccb03fbda25"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="pooling__layer__quantized_8cl.xhtml#a235920cb0f8577da6e104ccb03fbda25">calculate_avg_scale_nhwc</a> (const int pool_size_x, const int pool_size_y, int upper_bound_w, int upper_bound_h, const int pad_x, const int pad_y, const int stride_x, const int stride_y)</td></tr> |
| 127 | <tr class="separator:a235920cb0f8577da6e104ccb03fbda25"><td class="memSeparator" colspan="2"> </td></tr> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 128 | <tr class="memitem:a1231ef5ce1d409f6bd145e971fa7e2ea"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="pooling__layer__quantized_8cl.xhtml#a1231ef5ce1d409f6bd145e971fa7e2ea">pooling_layer_MxN_quantized_nhwc</a> (__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_stride_z, uint input_step_z, uint input_stride_w, uint input_step_w, uint input_offset_first_element_in_bytes, __global uchar *output_ptr, uint output_stride_x, uint output_step_x, uint output_stride_y, uint output_step_y, uint output_stride_z, uint output_step_z, uint output_stride_w, uint output_step_w, uint output_offset_first_element_in_bytes)</td></tr> |
| 129 | <tr class="memdesc:a1231ef5ce1d409f6bd145e971fa7e2ea"><td class="mdescLeft"> </td><td class="mdescRight">Performs a pooling function of pool size equal to N (NHWC) <a href="#a1231ef5ce1d409f6bd145e971fa7e2ea">More...</a><br /></td></tr> |
| 130 | <tr class="separator:a1231ef5ce1d409f6bd145e971fa7e2ea"><td class="memSeparator" colspan="2"> </td></tr> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 131 | </table> |
| 132 | <h2 class="groupheader">Macro Definition Documentation</h2> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 133 | <a id="a5db17889d824975fefb2ce2f4690637f"></a> |
| 134 | <h2 class="memtitle"><span class="permalink"><a href="#a5db17889d824975fefb2ce2f4690637f">◆ </a></span>DIV_OP</h2> |
| 135 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 136 | <div class="memitem"> |
| 137 | <div class="memproto"> |
| 138 | <table class="memname"> |
| 139 | <tr> |
| 140 | <td class="memname">#define DIV_OP</td> |
| 141 | <td>(</td> |
| 142 | <td class="paramtype"> </td> |
| 143 | <td class="paramname">x, </td> |
| 144 | </tr> |
| 145 | <tr> |
| 146 | <td class="paramkey"></td> |
| 147 | <td></td> |
| 148 | <td class="paramtype"> </td> |
| 149 | <td class="paramname">y </td> |
| 150 | </tr> |
| 151 | <tr> |
| 152 | <td></td> |
| 153 | <td>)</td> |
| 154 | <td></td><td>   (x * (1.f / y))</td> |
| 155 | </tr> |
| 156 | </table> |
| 157 | </div><div class="memdoc"> |
| 158 | |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 159 | <p class="definition">Definition at line <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00047">47</a> of file <a class="el" href="pooling__layer__quantized_8cl_source.xhtml">pooling_layer_quantized.cl</a>.</p> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 160 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 161 | </div> |
| 162 | </div> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 163 | <a id="a6c01fa98d360a9d52926dc6a5a599711"></a> |
| 164 | <h2 class="memtitle"><span class="permalink"><a href="#a6c01fa98d360a9d52926dc6a5a599711">◆ </a></span>DIV_OP_NHWC</h2> |
| 165 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 166 | <div class="memitem"> |
| 167 | <div class="memproto"> |
| 168 | <table class="memname"> |
| 169 | <tr> |
| 170 | <td class="memname">#define DIV_OP_NHWC</td> |
| 171 | <td>(</td> |
| 172 | <td class="paramtype"> </td> |
| 173 | <td class="paramname">x, </td> |
| 174 | </tr> |
| 175 | <tr> |
| 176 | <td class="paramkey"></td> |
| 177 | <td></td> |
| 178 | <td class="paramtype"> </td> |
| 179 | <td class="paramname">y </td> |
| 180 | </tr> |
| 181 | <tr> |
| 182 | <td></td> |
| 183 | <td>)</td> |
| 184 | <td></td><td>   (convert_float8(x) * (float8)(1.f / y))</td> |
| 185 | </tr> |
| 186 | </table> |
| 187 | </div><div class="memdoc"> |
| 188 | |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 189 | <p class="definition">Definition at line <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00049">49</a> of file <a class="el" href="pooling__layer__quantized_8cl_source.xhtml">pooling_layer_quantized.cl</a>.</p> |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 190 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 191 | </div> |
| 192 | </div> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 193 | <a id="a482ef7d59a5f474ca126e737c7f0978a"></a> |
| 194 | <h2 class="memtitle"><span class="permalink"><a href="#a482ef7d59a5f474ca126e737c7f0978a">◆ </a></span>POOL_OP</h2> |
| 195 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 196 | <div class="memitem"> |
| 197 | <div class="memproto"> |
| 198 | <table class="memname"> |
| 199 | <tr> |
| 200 | <td class="memname">#define POOL_OP</td> |
| 201 | <td>(</td> |
| 202 | <td class="paramtype"> </td> |
| 203 | <td class="paramname">x, </td> |
| 204 | </tr> |
| 205 | <tr> |
| 206 | <td class="paramkey"></td> |
| 207 | <td></td> |
| 208 | <td class="paramtype"> </td> |
| 209 | <td class="paramname">y </td> |
| 210 | </tr> |
| 211 | <tr> |
| 212 | <td></td> |
| 213 | <td>)</td> |
| 214 | <td></td><td>   ((x) + (y))</td> |
| 215 | </tr> |
| 216 | </table> |
| 217 | </div><div class="memdoc"> |
| 218 | |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 219 | <p class="definition">Definition at line <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00042">42</a> of file <a class="el" href="pooling__layer__quantized_8cl_source.xhtml">pooling_layer_quantized.cl</a>.</p> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 220 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 221 | </div> |
| 222 | </div> |
| 223 | <h2 class="groupheader">Function Documentation</h2> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 224 | <a id="a4057c01dd49145c5e463f1cea52542df"></a> |
| 225 | <h2 class="memtitle"><span class="permalink"><a href="#a4057c01dd49145c5e463f1cea52542df">◆ </a></span>calculate_avg_scale()</h2> |
| 226 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 227 | <div class="memitem"> |
| 228 | <div class="memproto"> |
| 229 | <table class="memname"> |
| 230 | <tr> |
| 231 | <td class="memname">int calculate_avg_scale </td> |
| 232 | <td>(</td> |
| 233 | <td class="paramtype">const int </td> |
Anthony Barbier | 06ea048 | 2018-02-22 15:45:35 +0000 | [diff] [blame] | 234 | <td class="paramname"><em>pool_size_x</em>, </td> |
| 235 | </tr> |
| 236 | <tr> |
| 237 | <td class="paramkey"></td> |
| 238 | <td></td> |
| 239 | <td class="paramtype">const int </td> |
| 240 | <td class="paramname"><em>pool_size_y</em>, </td> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 241 | </tr> |
| 242 | <tr> |
| 243 | <td class="paramkey"></td> |
| 244 | <td></td> |
| 245 | <td class="paramtype">const int </td> |
| 246 | <td class="paramname"><em>upper_bound_w</em>, </td> |
| 247 | </tr> |
| 248 | <tr> |
| 249 | <td class="paramkey"></td> |
| 250 | <td></td> |
| 251 | <td class="paramtype">const int </td> |
| 252 | <td class="paramname"><em>upper_bound_h</em>, </td> |
| 253 | </tr> |
| 254 | <tr> |
| 255 | <td class="paramkey"></td> |
| 256 | <td></td> |
| 257 | <td class="paramtype">const int </td> |
| 258 | <td class="paramname"><em>pad_x</em>, </td> |
| 259 | </tr> |
| 260 | <tr> |
| 261 | <td class="paramkey"></td> |
| 262 | <td></td> |
| 263 | <td class="paramtype">const int </td> |
| 264 | <td class="paramname"><em>pad_y</em>, </td> |
| 265 | </tr> |
| 266 | <tr> |
| 267 | <td class="paramkey"></td> |
| 268 | <td></td> |
| 269 | <td class="paramtype">const int </td> |
| 270 | <td class="paramname"><em>stride_x</em>, </td> |
| 271 | </tr> |
| 272 | <tr> |
| 273 | <td class="paramkey"></td> |
| 274 | <td></td> |
| 275 | <td class="paramtype">const int </td> |
| 276 | <td class="paramname"><em>stride_y</em> </td> |
| 277 | </tr> |
| 278 | <tr> |
| 279 | <td></td> |
| 280 | <td>)</td> |
| 281 | <td></td><td></td> |
| 282 | </tr> |
| 283 | </table> |
| 284 | </div><div class="memdoc"> |
| 285 | |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 286 | <p class="definition">Definition at line <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00055">55</a> of file <a class="el" href="pooling__layer__quantized_8cl_source.xhtml">pooling_layer_quantized.cl</a>.</p> |
| 287 | <div class="fragment"><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> {</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordtype">int</span> start_x = get_global_id(0) * stride_x - pad_x;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordtype">int</span> start_y = get_global_id(1) * stride_y - pad_y;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> end_x = min(start_x + pool_size_x, upper_bound_w);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> end_y = min(start_y + pool_size_y, upper_bound_h);</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="preprocessor">#if defined(EXCLUDE_PADDING)</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  start_x = max(0, start_x);</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  start_y = max(0, start_y);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="preprocessor">#endif </span><span class="comment">/* defined(EXCLUDE_PADDING) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keywordflow">return</span> ((end_y - start_y) * (end_x - start_x));</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> }</div></div><!-- fragment --> |
| 288 | <p class="reference">Referenced by <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00095">pooling_layer_MxN_quantized_nchw()</a>.</p> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 289 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 290 | </div> |
| 291 | </div> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 292 | <a id="a235920cb0f8577da6e104ccb03fbda25"></a> |
| 293 | <h2 class="memtitle"><span class="permalink"><a href="#a235920cb0f8577da6e104ccb03fbda25">◆ </a></span>calculate_avg_scale_nhwc()</h2> |
| 294 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 295 | <div class="memitem"> |
| 296 | <div class="memproto"> |
| 297 | <table class="memname"> |
| 298 | <tr> |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 299 | <td class="memname">int calculate_avg_scale_nhwc </td> |
| 300 | <td>(</td> |
| 301 | <td class="paramtype">const int </td> |
| 302 | <td class="paramname"><em>pool_size_x</em>, </td> |
| 303 | </tr> |
| 304 | <tr> |
| 305 | <td class="paramkey"></td> |
| 306 | <td></td> |
| 307 | <td class="paramtype">const int </td> |
| 308 | <td class="paramname"><em>pool_size_y</em>, </td> |
| 309 | </tr> |
| 310 | <tr> |
| 311 | <td class="paramkey"></td> |
| 312 | <td></td> |
| 313 | <td class="paramtype">int </td> |
| 314 | <td class="paramname"><em>upper_bound_w</em>, </td> |
| 315 | </tr> |
| 316 | <tr> |
| 317 | <td class="paramkey"></td> |
| 318 | <td></td> |
| 319 | <td class="paramtype">int </td> |
| 320 | <td class="paramname"><em>upper_bound_h</em>, </td> |
| 321 | </tr> |
| 322 | <tr> |
| 323 | <td class="paramkey"></td> |
| 324 | <td></td> |
| 325 | <td class="paramtype">const int </td> |
| 326 | <td class="paramname"><em>pad_x</em>, </td> |
| 327 | </tr> |
| 328 | <tr> |
| 329 | <td class="paramkey"></td> |
| 330 | <td></td> |
| 331 | <td class="paramtype">const int </td> |
| 332 | <td class="paramname"><em>pad_y</em>, </td> |
| 333 | </tr> |
| 334 | <tr> |
| 335 | <td class="paramkey"></td> |
| 336 | <td></td> |
| 337 | <td class="paramtype">const int </td> |
| 338 | <td class="paramname"><em>stride_x</em>, </td> |
| 339 | </tr> |
| 340 | <tr> |
| 341 | <td class="paramkey"></td> |
| 342 | <td></td> |
| 343 | <td class="paramtype">const int </td> |
| 344 | <td class="paramname"><em>stride_y</em> </td> |
| 345 | </tr> |
| 346 | <tr> |
| 347 | <td></td> |
| 348 | <td>)</td> |
| 349 | <td></td><td></td> |
| 350 | </tr> |
| 351 | </table> |
| 352 | </div><div class="memdoc"> |
| 353 | |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 354 | <p class="definition">Definition at line <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00154">154</a> of file <a class="el" href="pooling__layer__quantized_8cl_source.xhtml">pooling_layer_quantized.cl</a>.</p> |
| 355 | <div class="fragment"><div class="line"><a name="l00156"></a><span class="lineno"> 156</span> {</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keywordtype">int</span> start_x = get_global_id(1) * stride_x - pad_x;</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> <span class="preprocessor">#if defined(DST_DEPTH)</span></div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="keywordtype">int</span> start_y = (get_global_id(2) % DST_DEPTH) * stride_y - pad_y;</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span> <span class="preprocessor">#else </span><span class="comment">/* defined(DST_DEPTH) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordtype">int</span> start_y = get_global_id(2) * stride_y - pad_y;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> <span class="preprocessor">#endif </span><span class="comment">/* defined(DST_DEPTH) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span> </div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> end_x = min(start_x + pool_size_x, upper_bound_w);</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> end_y = min(start_y + pool_size_y, upper_bound_h);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span> </div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  start_x = max(0, start_x);</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  start_y = max(0, start_y);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span> </div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keywordflow">return</span> ((end_y - start_y) * (end_x - start_x));</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span> }</div></div><!-- fragment --> |
| 356 | <p class="reference">Referenced by <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00203">pooling_layer_MxN_quantized_nhwc()</a>.</p> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 357 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 358 | </div> |
| 359 | </div> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 360 | <a id="a5c74cefcb6318451b5785dd00bd9b05f"></a> |
| 361 | <h2 class="memtitle"><span class="permalink"><a href="#a5c74cefcb6318451b5785dd00bd9b05f">◆ </a></span>pooling_layer_MxN_quantized_nchw()</h2> |
| 362 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 363 | <div class="memitem"> |
| 364 | <div class="memproto"> |
| 365 | <table class="memname"> |
| 366 | <tr> |
| 367 | <td class="memname">__kernel void pooling_layer_MxN_quantized_nchw </td> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 368 | <td>(</td> |
| 369 | <td class="paramtype">__global uchar * </td> |
| 370 | <td class="paramname"><em>input_ptr</em>, </td> |
| 371 | </tr> |
| 372 | <tr> |
| 373 | <td class="paramkey"></td> |
| 374 | <td></td> |
| 375 | <td class="paramtype">uint </td> |
| 376 | <td class="paramname"><em>input_stride_x</em>, </td> |
| 377 | </tr> |
| 378 | <tr> |
| 379 | <td class="paramkey"></td> |
| 380 | <td></td> |
| 381 | <td class="paramtype">uint </td> |
| 382 | <td class="paramname"><em>input_step_x</em>, </td> |
| 383 | </tr> |
| 384 | <tr> |
| 385 | <td class="paramkey"></td> |
| 386 | <td></td> |
| 387 | <td class="paramtype">uint </td> |
| 388 | <td class="paramname"><em>input_stride_y</em>, </td> |
| 389 | </tr> |
| 390 | <tr> |
| 391 | <td class="paramkey"></td> |
| 392 | <td></td> |
| 393 | <td class="paramtype">uint </td> |
| 394 | <td class="paramname"><em>input_step_y</em>, </td> |
| 395 | </tr> |
| 396 | <tr> |
| 397 | <td class="paramkey"></td> |
| 398 | <td></td> |
| 399 | <td class="paramtype">uint </td> |
| 400 | <td class="paramname"><em>input_stride_z</em>, </td> |
| 401 | </tr> |
| 402 | <tr> |
| 403 | <td class="paramkey"></td> |
| 404 | <td></td> |
| 405 | <td class="paramtype">uint </td> |
| 406 | <td class="paramname"><em>input_step_z</em>, </td> |
| 407 | </tr> |
| 408 | <tr> |
| 409 | <td class="paramkey"></td> |
| 410 | <td></td> |
| 411 | <td class="paramtype">uint </td> |
| 412 | <td class="paramname"><em>input_offset_first_element_in_bytes</em>, </td> |
| 413 | </tr> |
| 414 | <tr> |
| 415 | <td class="paramkey"></td> |
| 416 | <td></td> |
| 417 | <td class="paramtype">__global uchar * </td> |
| 418 | <td class="paramname"><em>output_ptr</em>, </td> |
| 419 | </tr> |
| 420 | <tr> |
| 421 | <td class="paramkey"></td> |
| 422 | <td></td> |
| 423 | <td class="paramtype">uint </td> |
| 424 | <td class="paramname"><em>output_stride_x</em>, </td> |
| 425 | </tr> |
| 426 | <tr> |
| 427 | <td class="paramkey"></td> |
| 428 | <td></td> |
| 429 | <td class="paramtype">uint </td> |
| 430 | <td class="paramname"><em>output_step_x</em>, </td> |
| 431 | </tr> |
| 432 | <tr> |
| 433 | <td class="paramkey"></td> |
| 434 | <td></td> |
| 435 | <td class="paramtype">uint </td> |
| 436 | <td class="paramname"><em>output_stride_y</em>, </td> |
| 437 | </tr> |
| 438 | <tr> |
| 439 | <td class="paramkey"></td> |
| 440 | <td></td> |
| 441 | <td class="paramtype">uint </td> |
| 442 | <td class="paramname"><em>output_step_y</em>, </td> |
| 443 | </tr> |
| 444 | <tr> |
| 445 | <td class="paramkey"></td> |
| 446 | <td></td> |
| 447 | <td class="paramtype">uint </td> |
| 448 | <td class="paramname"><em>output_stride_z</em>, </td> |
| 449 | </tr> |
| 450 | <tr> |
| 451 | <td class="paramkey"></td> |
| 452 | <td></td> |
| 453 | <td class="paramtype">uint </td> |
| 454 | <td class="paramname"><em>output_step_z</em>, </td> |
| 455 | </tr> |
| 456 | <tr> |
| 457 | <td class="paramkey"></td> |
| 458 | <td></td> |
| 459 | <td class="paramtype">uint </td> |
| 460 | <td class="paramname"><em>output_offset_first_element_in_bytes</em> </td> |
| 461 | </tr> |
| 462 | <tr> |
| 463 | <td></td> |
| 464 | <td>)</td> |
| 465 | <td></td><td></td> |
| 466 | </tr> |
| 467 | </table> |
| 468 | </div><div class="memdoc"> |
| 469 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 470 | <p>Performs a pooling function of pool size equal to N (NCHW) </p> |
Anthony Barbier | 06ea048 | 2018-02-22 15:45:35 +0000 | [diff] [blame] | 471 | <dl class="section note"><dt>Note</dt><dd>Pool sizes must be passed using -DPOOL_SIZE_X and -DPOOL_SIZE_Y e.g. -DPOOL_SIZE_X=13; </dd> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 472 | <dd> |
| 473 | In case of average pooling the following information must be passed at compile time: -DPOOL_AVG must be provided otherwise max pooling will be performed. -DMAX_WIDTH and -DMAX_HEIGHT which are the maximum accessible indeces in x and y dimensions (width + pad) -DSTRIDE_X and -DSTRIDE_Y which are the steps of the window along the x and y directions -DPAD_X and -DPAD_Y which are the pooling paddings in x and y dimension</dd></dl> |
| 474 | <dl class="params"><dt>Parameters</dt><dd> |
| 475 | <table class="params"> |
| 476 | <tr><td class="paramdir">[in]</td><td class="paramname">input_ptr</td><td>Pointer to the source image. Supported data types: QASYMM8 </td></tr> |
| 477 | <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr> |
| 478 | <tr><td class="paramdir">[in]</td><td class="paramname">input_step_x</td><td>input_stride_x * number of elements along X processed per workitem(in bytes) </td></tr> |
| 479 | <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr> |
| 480 | <tr><td class="paramdir">[in]</td><td class="paramname">input_step_y</td><td>input_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr> |
| 481 | <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_z</td><td>Stride of the source tensor in Z dimension (in bytes) </td></tr> |
| 482 | <tr><td class="paramdir">[in]</td><td class="paramname">input_step_z</td><td>input_stride_z * number of elements along Z processed per workitem(in bytes) </td></tr> |
| 483 | <tr><td class="paramdir">[in]</td><td class="paramname">input_offset_first_element_in_bytes</td><td>The offset of the first element in the source image </td></tr> |
| 484 | <tr><td class="paramdir">[out]</td><td class="paramname">output_ptr</td><td>Pointer to the destination image. Supported data types: same as <code>input_ptr</code> </td></tr> |
| 485 | <tr><td class="paramdir">[in]</td><td class="paramname">output_stride_x</td><td>Stride of the destination image in X dimension (in bytes) </td></tr> |
| 486 | <tr><td class="paramdir">[in]</td><td class="paramname">output_step_x</td><td>output_stride_x * number of elements along X processed per workitem(in bytes) </td></tr> |
| 487 | <tr><td class="paramdir">[in]</td><td class="paramname">output_stride_y</td><td>Stride of the destination image in Y dimension (in bytes) </td></tr> |
| 488 | <tr><td class="paramdir">[in]</td><td class="paramname">output_step_y</td><td>output_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr> |
| 489 | <tr><td class="paramdir">[in]</td><td class="paramname">output_stride_z</td><td>Stride of the source tensor in Z dimension (in bytes) </td></tr> |
| 490 | <tr><td class="paramdir">[in]</td><td class="paramname">output_step_z</td><td>output_stride_z * number of elements along Z processed per workitem(in bytes) </td></tr> |
| 491 | <tr><td class="paramdir">[in]</td><td class="paramname">output_offset_first_element_in_bytes</td><td>The offset of the first element in the destination image </td></tr> |
| 492 | </table> |
| 493 | </dd> |
| 494 | </dl> |
| 495 | |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 496 | <p class="definition">Definition at line <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00095">95</a> of file <a class="el" href="pooling__layer__quantized_8cl_source.xhtml">pooling_layer_quantized.cl</a>.</p> |
Jenkins | 0e205f7 | 2019-11-28 16:53:35 +0000 | [diff] [blame] | 497 | <div class="fragment"><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">// Get pixels pointer</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a8fcf2ddd9a1d58b1b280f5c0aed71845">input</a> = <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a8fcf2ddd9a1d58b1b280f5c0aed71845">input</a>);</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> output = <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(output);</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>  int8 vdata = 0;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordtype">int</span> sdata = 0;</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="comment">// Load data</span></div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordflow">for</span>(<span class="keywordtype">int</span> y = 0; y < POOL_SIZE_Y; y++)</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>  <span class="keywordtype">int</span> x = 0;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keywordflow">for</span>(; x <= ((int)POOL_SIZE_X - 8); x += 8)</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  {</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  uchar8 data = vload8(0, (__global uchar *)<a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a2101b2fe0193ce227ae4e0945e321d85">tensor3D_offset</a>(&<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a8fcf2ddd9a1d58b1b280f5c0aed71845">input</a>, x, y, 0));</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  int8 data0 = convert_int8(data);</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  vdata = <a class="code" href="pooling__layer__quantized_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(vdata, data0);</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> </div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="comment">// Leftover</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">for</span>(; x < (int)POOL_SIZE_X; ++x)</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  {</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  uchar data = *((__global uchar *)<a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a2101b2fe0193ce227ae4e0945e321d85">tensor3D_offset</a>(&<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a8fcf2ddd9a1d58b1b280f5c0aed71845">input</a>, x, y, 0));</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keywordtype">int</span> data0 = convert_int(data);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  sdata = <a class="code" href="pooling__layer__quantized_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(sdata, data0);</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>  }</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span> </div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="comment">// Reduce result</span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  int4 reduce4 = <a class="code" href="pooling__layer__quantized_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(vdata.s0123, vdata.s4567);</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  int2 reduce2 = <a class="code" href="pooling__layer__quantized_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(reduce4.s01, reduce4.s23);</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordtype">int</span> res = <a class="code" href="pooling__layer__quantized_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(reduce2.s0, reduce2.s1);</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  res = <a class="code" href="pooling__layer__quantized_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(res, sdata);</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span> </div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="preprocessor">#if defined(POOL_AVG)</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  res = <a class="code" href="namespacearm__compute.xhtml#aaae2b6b1c3f4404121346a4c27b22647">round</a>(<a class="code" href="pooling__layer__quantized_8cl.xhtml#a5db17889d824975fefb2ce2f4690637f">DIV_OP</a>(res, <a class="code" href="pooling__layer__quantized_8cl.xhtml#a4057c01dd49145c5e463f1cea52542df">calculate_avg_scale</a>(POOL_SIZE_X, POOL_SIZE_Y, MAX_WIDTH, MAX_HEIGHT, PAD_X, PAD_Y, STRIDE_X, STRIDE_Y)));</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span> <span class="preprocessor">#endif </span><span class="comment">/* defined(POOL_AVG) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span> </div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  uchar result_u8 = convert_uchar(res);</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span> </div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span> <span class="preprocessor">#if defined(OFFSET_IN1) && defined(OFFSET_OUT) && defined(SCALE_IN1) && defined(SCALE_OUT)</span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> </div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="keyword">const</span> <span class="keywordtype">float</span> result_f32 = convert_float(result_u8);</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keyword">const</span> <span class="keywordtype">float</span> input_offset = (float)OFFSET_IN1;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keyword">const</span> <span class="keywordtype">float</span> input_scale = (float)SCALE_IN1;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="keyword">const</span> <span class="keywordtype">float</span> scale_out = (float)SCALE_OUT;</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="keyword">const</span> <span class="keywordtype">float</span> offset_out = (float)OFFSET_OUT;</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keyword">const</span> <span class="keywordtype">float</span> in_f32 = (result_f32 - input_offset) * input_scale;</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keyword">const</span> <span class="keywordtype">float</span> out_f32 = in_f32 / scale_out + offset_out;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  result_u8 = convert_uchar_sat(convert_int_rte(out_f32));</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span> </div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> <span class="preprocessor">#endif </span><span class="comment">/* defined(OFFSET_IN1) && defined(OFFSET_OUT) && defined(SCALE_IN1) && defined(SCALE_OUT) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span> </div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  *(__global uchar *)output.<a class="code" href="struct_tensor3_d.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> = result_u8;</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span> }</div><div class="ttc" id="pooling__layer__quantized_8cl_xhtml_a482ef7d59a5f474ca126e737c7f0978a"><div class="ttname"><a href="pooling__layer__quantized_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a></div><div class="ttdeci">#define POOL_OP(x, y)</div><div class="ttdef"><b>Definition:</b> <a href="pooling__layer__quantized_8cl_source.xhtml#l00042">pooling_layer_quantized.cl:42</a></div></div> |
| 498 | <div class="ttc" id="struct_tensor3_d_xhtml"><div class="ttname"><a href="struct_tensor3_d.xhtml">Tensor3D</a></div><div class="ttdoc">Structure to hold 3D tensor information.</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00358">helpers.h:358</a></div></div> |
| 499 | <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a8fcf2ddd9a1d58b1b280f5c0aed71845"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a8fcf2ddd9a1d58b1b280f5c0aed71845">arm_compute::test::validation::input</a></div><div class="ttdeci">auto input</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_l_s_t_m_layer_quantized_8cpp_source.xhtml#l00487">LSTMLayerQuantized.cpp:487</a></div></div> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 500 | <div class="ttc" id="namespacearm__compute_xhtml_aaae2b6b1c3f4404121346a4c27b22647"><div class="ttname"><a href="namespacearm__compute.xhtml#aaae2b6b1c3f4404121346a4c27b22647">arm_compute::round</a></div><div class="ttdeci">int round(float x, RoundingPolicy rounding_policy)</div><div class="ttdoc">Return a rounded value of x.</div><div class="ttdef"><b>Definition:</b> <a href="_rounding_8cpp_source.xhtml#l00035">Rounding.cpp:35</a></div></div> |
Jenkins | 0e205f7 | 2019-11-28 16:53:35 +0000 | [diff] [blame] | 501 | <div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_a31c8c760f08fb1a331b16b7c204321dc"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_TENSOR3D_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00326">helpers.h:326</a></div></div> |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 502 | <div class="ttc" id="pooling__layer__quantized_8cl_xhtml_a5db17889d824975fefb2ce2f4690637f"><div class="ttname"><a href="pooling__layer__quantized_8cl.xhtml#a5db17889d824975fefb2ce2f4690637f">DIV_OP</a></div><div class="ttdeci">#define DIV_OP(x, y)</div><div class="ttdef"><b>Definition:</b> <a href="pooling__layer__quantized_8cl_source.xhtml#l00047">pooling_layer_quantized.cl:47</a></div></div> |
Jenkins | 0e205f7 | 2019-11-28 16:53:35 +0000 | [diff] [blame] | 503 | <div class="ttc" id="struct_tensor3_d_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_tensor3_d.xhtml#acf52c23cbd7424606c10a606524e3e32">Tensor3D::ptr</a></div><div class="ttdeci">__global uchar * ptr</div><div class="ttdoc">Pointer to the starting postion of the buffer.</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00360">helpers.h:360</a></div></div> |
| 504 | <div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_a2101b2fe0193ce227ae4e0945e321d85"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a2101b2fe0193ce227ae4e0945e321d85">tensor3D_offset</a></div><div class="ttdeci">__global const uchar * tensor3D_offset(const Tensor3D *tensor, int x, int y, int z)</div><div class="ttdoc">Get the pointer position of a Tensor3D.</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00522">helpers.h:522</a></div></div> |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 505 | <div class="ttc" id="pooling__layer__quantized_8cl_xhtml_a4057c01dd49145c5e463f1cea52542df"><div class="ttname"><a href="pooling__layer__quantized_8cl.xhtml#a4057c01dd49145c5e463f1cea52542df">calculate_avg_scale</a></div><div class="ttdeci">int calculate_avg_scale(const int pool_size_x, const int pool_size_y, const int upper_bound_w, const int upper_bound_h, const int pad_x, const int pad_y, const int stride_x, const int stride_y)</div><div class="ttdef"><b>Definition:</b> <a href="pooling__layer__quantized_8cl_source.xhtml#l00055">pooling_layer_quantized.cl:55</a></div></div> |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 506 | </div><!-- fragment --> |
Jenkins | 0e205f7 | 2019-11-28 16:53:35 +0000 | [diff] [blame] | 507 | <p class="reference">References <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00055">calculate_avg_scale()</a>, <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00326">CONVERT_TO_TENSOR3D_STRUCT</a>, <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00047">DIV_OP</a>, <a class="el" href="_c_l_2_l_s_t_m_layer_quantized_8cpp_source.xhtml#l00487">arm_compute::test::validation::input</a>, <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00042">POOL_OP</a>, <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00360">Tensor3D::ptr</a>, <a class="el" href="_rounding_8cpp_source.xhtml#l00035">arm_compute::round()</a>, and <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00522">tensor3D_offset()</a>.</p> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 508 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 509 | </div> |
| 510 | </div> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 511 | <a id="a1231ef5ce1d409f6bd145e971fa7e2ea"></a> |
| 512 | <h2 class="memtitle"><span class="permalink"><a href="#a1231ef5ce1d409f6bd145e971fa7e2ea">◆ </a></span>pooling_layer_MxN_quantized_nhwc()</h2> |
| 513 | |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 514 | <div class="memitem"> |
| 515 | <div class="memproto"> |
| 516 | <table class="memname"> |
| 517 | <tr> |
| 518 | <td class="memname">__kernel void pooling_layer_MxN_quantized_nhwc </td> |
| 519 | <td>(</td> |
| 520 | <td class="paramtype">__global uchar * </td> |
| 521 | <td class="paramname"><em>input_ptr</em>, </td> |
| 522 | </tr> |
| 523 | <tr> |
| 524 | <td class="paramkey"></td> |
| 525 | <td></td> |
| 526 | <td class="paramtype">uint </td> |
| 527 | <td class="paramname"><em>input_stride_x</em>, </td> |
| 528 | </tr> |
| 529 | <tr> |
| 530 | <td class="paramkey"></td> |
| 531 | <td></td> |
| 532 | <td class="paramtype">uint </td> |
| 533 | <td class="paramname"><em>input_step_x</em>, </td> |
| 534 | </tr> |
| 535 | <tr> |
| 536 | <td class="paramkey"></td> |
| 537 | <td></td> |
| 538 | <td class="paramtype">uint </td> |
| 539 | <td class="paramname"><em>input_stride_y</em>, </td> |
| 540 | </tr> |
| 541 | <tr> |
| 542 | <td class="paramkey"></td> |
| 543 | <td></td> |
| 544 | <td class="paramtype">uint </td> |
| 545 | <td class="paramname"><em>input_step_y</em>, </td> |
| 546 | </tr> |
| 547 | <tr> |
| 548 | <td class="paramkey"></td> |
| 549 | <td></td> |
| 550 | <td class="paramtype">uint </td> |
| 551 | <td class="paramname"><em>input_stride_z</em>, </td> |
| 552 | </tr> |
| 553 | <tr> |
| 554 | <td class="paramkey"></td> |
| 555 | <td></td> |
| 556 | <td class="paramtype">uint </td> |
| 557 | <td class="paramname"><em>input_step_z</em>, </td> |
| 558 | </tr> |
| 559 | <tr> |
| 560 | <td class="paramkey"></td> |
| 561 | <td></td> |
| 562 | <td class="paramtype">uint </td> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 563 | <td class="paramname"><em>input_stride_w</em>, </td> |
| 564 | </tr> |
| 565 | <tr> |
| 566 | <td class="paramkey"></td> |
| 567 | <td></td> |
| 568 | <td class="paramtype">uint </td> |
| 569 | <td class="paramname"><em>input_step_w</em>, </td> |
| 570 | </tr> |
| 571 | <tr> |
| 572 | <td class="paramkey"></td> |
| 573 | <td></td> |
| 574 | <td class="paramtype">uint </td> |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 575 | <td class="paramname"><em>input_offset_first_element_in_bytes</em>, </td> |
| 576 | </tr> |
| 577 | <tr> |
| 578 | <td class="paramkey"></td> |
| 579 | <td></td> |
| 580 | <td class="paramtype">__global uchar * </td> |
| 581 | <td class="paramname"><em>output_ptr</em>, </td> |
| 582 | </tr> |
| 583 | <tr> |
| 584 | <td class="paramkey"></td> |
| 585 | <td></td> |
| 586 | <td class="paramtype">uint </td> |
| 587 | <td class="paramname"><em>output_stride_x</em>, </td> |
| 588 | </tr> |
| 589 | <tr> |
| 590 | <td class="paramkey"></td> |
| 591 | <td></td> |
| 592 | <td class="paramtype">uint </td> |
| 593 | <td class="paramname"><em>output_step_x</em>, </td> |
| 594 | </tr> |
| 595 | <tr> |
| 596 | <td class="paramkey"></td> |
| 597 | <td></td> |
| 598 | <td class="paramtype">uint </td> |
| 599 | <td class="paramname"><em>output_stride_y</em>, </td> |
| 600 | </tr> |
| 601 | <tr> |
| 602 | <td class="paramkey"></td> |
| 603 | <td></td> |
| 604 | <td class="paramtype">uint </td> |
| 605 | <td class="paramname"><em>output_step_y</em>, </td> |
| 606 | </tr> |
| 607 | <tr> |
| 608 | <td class="paramkey"></td> |
| 609 | <td></td> |
| 610 | <td class="paramtype">uint </td> |
| 611 | <td class="paramname"><em>output_stride_z</em>, </td> |
| 612 | </tr> |
| 613 | <tr> |
| 614 | <td class="paramkey"></td> |
| 615 | <td></td> |
| 616 | <td class="paramtype">uint </td> |
| 617 | <td class="paramname"><em>output_step_z</em>, </td> |
| 618 | </tr> |
| 619 | <tr> |
| 620 | <td class="paramkey"></td> |
| 621 | <td></td> |
| 622 | <td class="paramtype">uint </td> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 623 | <td class="paramname"><em>output_stride_w</em>, </td> |
| 624 | </tr> |
| 625 | <tr> |
| 626 | <td class="paramkey"></td> |
| 627 | <td></td> |
| 628 | <td class="paramtype">uint </td> |
| 629 | <td class="paramname"><em>output_step_w</em>, </td> |
| 630 | </tr> |
| 631 | <tr> |
| 632 | <td class="paramkey"></td> |
| 633 | <td></td> |
| 634 | <td class="paramtype">uint </td> |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 635 | <td class="paramname"><em>output_offset_first_element_in_bytes</em> </td> |
| 636 | </tr> |
| 637 | <tr> |
| 638 | <td></td> |
| 639 | <td>)</td> |
| 640 | <td></td><td></td> |
| 641 | </tr> |
| 642 | </table> |
| 643 | </div><div class="memdoc"> |
| 644 | |
| 645 | <p>Performs a pooling function of pool size equal to N (NHWC) </p> |
| 646 | <dl class="section note"><dt>Note</dt><dd>Pool sizes must be passed using -DPOOL_SIZE_X and -DPOOL_SIZE_Y e.g. -DPOOL_SIZE_X=13; </dd> |
| 647 | <dd> |
| 648 | Tensors width and height must be passed at compile time using -DMAX_WIDTH and -DMAX_HEIGHT </dd> |
| 649 | <dd> |
| 650 | Strides must be passed at compile time using -DSTRIDE_X and -DSTRIDE_Y which are the steps of the window along the x and y directions </dd> |
| 651 | <dd> |
| 652 | Pad values must be passed at compile time using -DPAD_X and -DPAD_Y which are the pooling paddings in x and y dimension </dd> |
| 653 | <dd> |
| 654 | In case of average pooling the following information must be passed at compile time: -DPOOL_AVG must be provided otherwise max pooling will be performed.</dd></dl> |
| 655 | <dl class="params"><dt>Parameters</dt><dd> |
| 656 | <table class="params"> |
| 657 | <tr><td class="paramdir">[in]</td><td class="paramname">input_ptr</td><td>Pointer to the source image. Supported data types: QASYMM8 </td></tr> |
| 658 | <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr> |
| 659 | <tr><td class="paramdir">[in]</td><td class="paramname">input_step_x</td><td>input_stride_x * number of elements along X processed per workitem(in bytes) </td></tr> |
| 660 | <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr> |
| 661 | <tr><td class="paramdir">[in]</td><td class="paramname">input_step_y</td><td>input_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr> |
| 662 | <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_z</td><td>Stride of the source tensor in Z dimension (in bytes) </td></tr> |
| 663 | <tr><td class="paramdir">[in]</td><td class="paramname">input_step_z</td><td>input_stride_z * number of elements along Z processed per workitem(in bytes) </td></tr> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 664 | <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_w</td><td>Stride of the source tensor in W dimension (in bytes) </td></tr> |
| 665 | <tr><td class="paramdir">[in]</td><td class="paramname">input_step_w</td><td>input_stride_w * number of elements along W processed per workitem(in bytes) </td></tr> |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 666 | <tr><td class="paramdir">[in]</td><td class="paramname">input_offset_first_element_in_bytes</td><td>The offset of the first element in the source image </td></tr> |
| 667 | <tr><td class="paramdir">[out]</td><td class="paramname">output_ptr</td><td>Pointer to the destination image. Supported data types: same as <code>input_ptr</code> </td></tr> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 668 | <tr><td class="paramdir">[in]</td><td class="paramname">output_stride_x</td><td>Stride of the destination tensor in X dimension (in bytes) </td></tr> |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 669 | <tr><td class="paramdir">[in]</td><td class="paramname">output_step_x</td><td>output_stride_x * number of elements along X processed per workitem(in bytes) </td></tr> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 670 | <tr><td class="paramdir">[in]</td><td class="paramname">output_stride_y</td><td>Stride of the destination tensor in Y dimension (in bytes) </td></tr> |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 671 | <tr><td class="paramdir">[in]</td><td class="paramname">output_step_y</td><td>output_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 672 | <tr><td class="paramdir">[in]</td><td class="paramname">output_stride_z</td><td>Stride of the destination tensor in Z dimension (in bytes) </td></tr> |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 673 | <tr><td class="paramdir">[in]</td><td class="paramname">output_step_z</td><td>output_stride_z * number of elements along Z processed per workitem(in bytes) </td></tr> |
Jenkins | b9abeae | 2018-11-22 11:58:08 +0000 | [diff] [blame] | 674 | <tr><td class="paramdir">[in]</td><td class="paramname">output_stride_w</td><td>Stride of the destination tensor in W dimension (in bytes) </td></tr> |
| 675 | <tr><td class="paramdir">[in]</td><td class="paramname">output_step_w</td><td>output_stride_w * number of elements along W processed per workitem(in bytes) </td></tr> |
Jenkins | b3a371b | 2018-05-23 11:36:53 +0100 | [diff] [blame] | 676 | <tr><td class="paramdir">[in]</td><td class="paramname">output_offset_first_element_in_bytes</td><td>The offset of the first element in the destination image </td></tr> |
| 677 | </table> |
| 678 | </dd> |
| 679 | </dl> |
| 680 | |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 681 | <p class="definition">Definition at line <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00203">203</a> of file <a class="el" href="pooling__layer__quantized_8cl_source.xhtml">pooling_layer_quantized.cl</a>.</p> |
Jenkins | 0e205f7 | 2019-11-28 16:53:35 +0000 | [diff] [blame] | 682 | <div class="fragment"><div class="line"><a name="l00206"></a><span class="lineno"> 206</span> {</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="comment">// Get pixels pointer</span></div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span> <span class="preprocessor">#if defined(DST_DEPTH)</span></div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <a class="code" href="struct_tensor4_d.xhtml">Tensor4D</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a8fcf2ddd9a1d58b1b280f5c0aed71845">input</a> = <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a23b9032d1b9d59547545e457f82ee478">CONVERT_TO_TENSOR4D_STRUCT</a>(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a8fcf2ddd9a1d58b1b280f5c0aed71845">input</a>, DST_DEPTH);</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <a class="code" href="struct_tensor4_d.xhtml">Tensor4D</a> output = <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a23b9032d1b9d59547545e457f82ee478">CONVERT_TO_TENSOR4D_STRUCT</a>(output, DST_DEPTH);</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span> <span class="preprocessor">#else </span><span class="comment">/* defined(DST_DEPTH) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a8fcf2ddd9a1d58b1b280f5c0aed71845">input</a> = <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a8fcf2ddd9a1d58b1b280f5c0aed71845">input</a>);</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> output = <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(output);</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span> <span class="preprocessor">#endif </span><span class="comment">/* defined(DST_DEPTH) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span> </div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  int8 vdata = 0;</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span> </div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> idx_width = get_global_id(1) * STRIDE_X;</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span> <span class="preprocessor">#if defined(DST_DEPTH)</span></div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> idx_height = (get_global_id(2) % DST_DEPTH) * STRIDE_Y;</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span> <span class="preprocessor">#else </span><span class="comment">/* defined(DST_DEPTH) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> idx_height = get_global_id(2) * STRIDE_Y;</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span> <span class="preprocessor">#endif </span><span class="comment">/* defined(DST_DEPTH) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span> </div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordflow">for</span>(<span class="keywordtype">int</span> y = 0; y < POOL_SIZE_Y; ++y)</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  {</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="keywordtype">int</span> y1 = <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#af77145fbdc6b0c8931148f5597d9de53">select</a>(y, PAD_Y - idx_height, y + idx_height - PAD_Y < 0 || y + idx_height - PAD_Y >= MAX_HEIGHT);</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="keywordflow">for</span>(<span class="keywordtype">int</span> x = 0; x < POOL_SIZE_X; ++x)</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  {</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keywordtype">int</span> x1 = <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#af77145fbdc6b0c8931148f5597d9de53">select</a>(x, PAD_X - idx_width - 1, x + idx_width - PAD_X < 0 || x + idx_width - PAD_X >= MAX_WIDTH);</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  x1 = <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#af77145fbdc6b0c8931148f5597d9de53">select</a>(x1, PAD_X - idx_width - 1, y != y1);</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span> </div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span> <span class="preprocessor">#if defined(DST_DEPTH)</span></div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  uchar8 data = vload8(0, (__global uchar *)<a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#ad442fb5ec8be1fff97f543150de5d822">tensor4D_offset</a>(&<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a8fcf2ddd9a1d58b1b280f5c0aed71845">input</a>, 0, x1 - PAD_X, y1 - PAD_Y, 0));</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span> <span class="preprocessor">#else </span><span class="comment">/* defined(DST_DEPTH) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  uchar8 data = vload8(0, (__global uchar *)<a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a2101b2fe0193ce227ae4e0945e321d85">tensor3D_offset</a>(&<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a8fcf2ddd9a1d58b1b280f5c0aed71845">input</a>, 0, x1 - PAD_X, y1 - PAD_Y));</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span> <span class="preprocessor">#endif </span><span class="comment">/* defined(DST_DEPTH) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span> </div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  int8 data0 = convert_int8(data);</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  vdata = <a class="code" href="pooling__layer__quantized_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(vdata, data0);</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  }</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  }</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span> </div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span> <span class="preprocessor">#if defined(POOL_AVG)</span></div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="comment">// Divide by pool region in case of average pooling</span></div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  vdata = convert_int8(<a class="code" href="namespacearm__compute.xhtml#aaae2b6b1c3f4404121346a4c27b22647">round</a>(<a class="code" href="pooling__layer__quantized_8cl.xhtml#a6c01fa98d360a9d52926dc6a5a599711">DIV_OP_NHWC</a>(vdata, <a class="code" href="pooling__layer__quantized_8cl.xhtml#a235920cb0f8577da6e104ccb03fbda25">calculate_avg_scale_nhwc</a>(POOL_SIZE_X, POOL_SIZE_Y, MAX_WIDTH, MAX_HEIGHT, PAD_X, PAD_Y, STRIDE_X, STRIDE_Y))));</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span> <span class="preprocessor">#endif </span><span class="comment">/* defined(POOL_AVG) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span> </div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  uchar8 out_u8 = convert_uchar8(vdata);</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span> <span class="preprocessor">#if defined(OFFSET_IN1) && defined(OFFSET_OUT) && defined(SCALE_IN1) && defined(SCALE_OUT)</span></div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  REQUANTIZE(8, out_u8, OFFSET_IN1, OFFSET_OUT, SCALE_IN1, SCALE_OUT, out_u8);</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span> <span class="preprocessor">#endif </span><span class="comment">/* defined(OFFSET_IN1) && defined(OFFSET_OUT) && defined(SCALE_IN1) && defined(SCALE_OUT) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span> </div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="comment">// Store result</span></div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  vstore8(out_u8, 0, (__global uchar *)output.<a class="code" href="struct_tensor3_d.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span> }</div><div class="ttc" id="pooling__layer__quantized_8cl_xhtml_a482ef7d59a5f474ca126e737c7f0978a"><div class="ttname"><a href="pooling__layer__quantized_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a></div><div class="ttdeci">#define POOL_OP(x, y)</div><div class="ttdef"><b>Definition:</b> <a href="pooling__layer__quantized_8cl_source.xhtml#l00042">pooling_layer_quantized.cl:42</a></div></div> |
| 683 | <div class="ttc" id="struct_tensor3_d_xhtml"><div class="ttname"><a href="struct_tensor3_d.xhtml">Tensor3D</a></div><div class="ttdoc">Structure to hold 3D tensor information.</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00358">helpers.h:358</a></div></div> |
| 684 | <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a8fcf2ddd9a1d58b1b280f5c0aed71845"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a8fcf2ddd9a1d58b1b280f5c0aed71845">arm_compute::test::validation::input</a></div><div class="ttdeci">auto input</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_l_s_t_m_layer_quantized_8cpp_source.xhtml#l00487">LSTMLayerQuantized.cpp:487</a></div></div> |
| 685 | <div class="ttc" id="struct_tensor4_d_xhtml"><div class="ttname"><a href="struct_tensor4_d.xhtml">Tensor4D</a></div><div class="ttdoc">Structure to hold 4D tensor information.</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00368">helpers.h:368</a></div></div> |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 686 | <div class="ttc" id="pooling__layer__quantized_8cl_xhtml_a235920cb0f8577da6e104ccb03fbda25"><div class="ttname"><a href="pooling__layer__quantized_8cl.xhtml#a235920cb0f8577da6e104ccb03fbda25">calculate_avg_scale_nhwc</a></div><div class="ttdeci">int calculate_avg_scale_nhwc(const int pool_size_x, const int pool_size_y, int upper_bound_w, int upper_bound_h, const int pad_x, const int pad_y, const int stride_x, const int stride_y)</div><div class="ttdef"><b>Definition:</b> <a href="pooling__layer__quantized_8cl_source.xhtml#l00154">pooling_layer_quantized.cl:154</a></div></div> |
Jenkins | 0e205f7 | 2019-11-28 16:53:35 +0000 | [diff] [blame] | 687 | <div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_ad442fb5ec8be1fff97f543150de5d822"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#ad442fb5ec8be1fff97f543150de5d822">tensor4D_offset</a></div><div class="ttdeci">__global const uchar * tensor4D_offset(const Tensor4D *tensor, int x, int y, int z, int w)</div><div class="ttdoc">Get the pointer position of a Tensor4D.</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00535">helpers.h:535</a></div></div> |
| 688 | <div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_a23b9032d1b9d59547545e457f82ee478"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a23b9032d1b9d59547545e457f82ee478">CONVERT_TO_TENSOR4D_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_TENSOR4D_STRUCT(name, mod_size)</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00333">helpers.h:333</a></div></div> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 689 | <div class="ttc" id="namespacearm__compute_xhtml_aaae2b6b1c3f4404121346a4c27b22647"><div class="ttname"><a href="namespacearm__compute.xhtml#aaae2b6b1c3f4404121346a4c27b22647">arm_compute::round</a></div><div class="ttdeci">int round(float x, RoundingPolicy rounding_policy)</div><div class="ttdoc">Return a rounded value of x.</div><div class="ttdef"><b>Definition:</b> <a href="_rounding_8cpp_source.xhtml#l00035">Rounding.cpp:35</a></div></div> |
Jenkins | 0e205f7 | 2019-11-28 16:53:35 +0000 | [diff] [blame] | 690 | <div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_a31c8c760f08fb1a331b16b7c204321dc"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_TENSOR3D_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00326">helpers.h:326</a></div></div> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 691 | <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_af77145fbdc6b0c8931148f5597d9de53"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#af77145fbdc6b0c8931148f5597d9de53">arm_compute::test::validation::select</a></div><div class="ttdeci">CLSelect select</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_select_8cpp_source.xhtml#l00164">Select.cpp:164</a></div></div> |
Jenkins | 0e205f7 | 2019-11-28 16:53:35 +0000 | [diff] [blame] | 692 | <div class="ttc" id="struct_tensor3_d_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_tensor3_d.xhtml#acf52c23cbd7424606c10a606524e3e32">Tensor3D::ptr</a></div><div class="ttdeci">__global uchar * ptr</div><div class="ttdoc">Pointer to the starting postion of the buffer.</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00360">helpers.h:360</a></div></div> |
Jenkins | 4ba87db | 2019-05-23 17:11:51 +0100 | [diff] [blame] | 693 | <div class="ttc" id="pooling__layer__quantized_8cl_xhtml_a6c01fa98d360a9d52926dc6a5a599711"><div class="ttname"><a href="pooling__layer__quantized_8cl.xhtml#a6c01fa98d360a9d52926dc6a5a599711">DIV_OP_NHWC</a></div><div class="ttdeci">#define DIV_OP_NHWC(x, y)</div><div class="ttdef"><b>Definition:</b> <a href="pooling__layer__quantized_8cl_source.xhtml#l00049">pooling_layer_quantized.cl:49</a></div></div> |
Jenkins | 0e205f7 | 2019-11-28 16:53:35 +0000 | [diff] [blame] | 694 | <div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_a2101b2fe0193ce227ae4e0945e321d85"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a2101b2fe0193ce227ae4e0945e321d85">tensor3D_offset</a></div><div class="ttdeci">__global const uchar * tensor3D_offset(const Tensor3D *tensor, int x, int y, int z)</div><div class="ttdoc">Get the pointer position of a Tensor3D.</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00522">helpers.h:522</a></div></div> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 695 | </div><!-- fragment --> |
Jenkins | 0e205f7 | 2019-11-28 16:53:35 +0000 | [diff] [blame] | 696 | <p class="reference">References <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00154">calculate_avg_scale_nhwc()</a>, <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00326">CONVERT_TO_TENSOR3D_STRUCT</a>, <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00333">CONVERT_TO_TENSOR4D_STRUCT</a>, <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00049">DIV_OP_NHWC</a>, <a class="el" href="_c_l_2_l_s_t_m_layer_quantized_8cpp_source.xhtml#l00487">arm_compute::test::validation::input</a>, <a class="el" href="pooling__layer__quantized_8cl_source.xhtml#l00042">POOL_OP</a>, <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00360">Tensor3D::ptr</a>, <a class="el" href="_rounding_8cpp_source.xhtml#l00035">arm_compute::round()</a>, <a class="el" href="_c_l_2_select_8cpp_source.xhtml#l00164">arm_compute::test::validation::select</a>, <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00522">tensor3D_offset()</a>, and <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00535">tensor4D_offset()</a>.</p> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 697 | |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 698 | </div> |
| 699 | </div> |
| 700 | </div><!-- contents --> |
| 701 | </div><!-- doc-content --> |
| 702 | <!-- start footer part --> |
| 703 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 704 | <ul> |
| 705 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_aebb8dcc11953d78e620bbef0b9e2183.xhtml">core</a></li><li class="navelem"><a class="el" href="dir_8c278f79c760e5c5fbd911f9870614c1.xhtml">CL</a></li><li class="navelem"><a class="el" href="dir_25885286e9dad4fa105b7b25a8031bbf.xhtml">cl_kernels</a></li><li class="navelem"><a class="el" href="pooling__layer__quantized_8cl.xhtml">pooling_layer_quantized.cl</a></li> |
Jenkins | 7f09cf7 | 2020-01-22 18:08:16 +0000 | [diff] [blame^] | 706 | <li class="footer">Generated on Wed Jan 22 2020 18:07:48 for Compute Library by |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 707 | <a href="http://www.doxygen.org/index.html"> |
Jenkins | 514be65 | 2019-02-28 12:25:18 +0000 | [diff] [blame] | 708 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li> |
Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +0000 | [diff] [blame] | 709 | </ul> |
| 710 | </div> |
| 711 | </body> |
| 712 | </html> |