Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 1 | <!-- HTML header for doxygen 1.8.9.1--> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 6 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 7 | <meta name="generator" content="Doxygen 1.8.11"/> |
| 8 | <meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines --> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 9 | <title>Compute Library: src/core/CL/cl_kernels/pooling_layer.cl File Reference</title> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 10 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 11 | <script type="text/javascript" src="jquery.js"></script> |
| 12 | <script type="text/javascript" src="dynsections.js"></script> |
| 13 | <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 14 | <script type="text/javascript" src="resize.js"></script> |
| 15 | <script type="text/javascript" src="navtreedata.js"></script> |
| 16 | <script type="text/javascript" src="navtree.js"></script> |
| 17 | <script type="text/javascript"> |
| 18 | $(document).ready(initResizable); |
| 19 | $(window).load(resizeHeight); |
| 20 | </script> |
| 21 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 22 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 23 | <script type="text/javascript" src="search/search.js"></script> |
| 24 | <script type="text/javascript"> |
| 25 | $(document).ready(function() { init_search(); }); |
| 26 | </script> |
| 27 | <script type="text/x-mathjax-config"> |
| 28 | MathJax.Hub.Config({ |
| 29 | extensions: ["tex2jax.js"], |
| 30 | jax: ["input/TeX","output/HTML-CSS"], |
| 31 | }); |
| 32 | </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> |
| 33 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 34 | </head> |
| 35 | <body> |
| 36 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 37 | <div id="titlearea"> |
| 38 | <table cellspacing="0" cellpadding="0"> |
| 39 | <tbody> |
| 40 | <tr style="height: 56px;"> |
| 41 | <td style="padding-left: 0.5em;"> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 42 | <div id="projectname">Compute Library |
| 43 |  <span id="projectnumber">v17.06</span> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 44 | </div> |
| 45 | </td> |
| 46 | </tr> |
| 47 | </tbody> |
| 48 | </table> |
| 49 | </div> |
| 50 | <!-- end header part --> |
| 51 | <!-- Generated by Doxygen 1.8.11 --> |
| 52 | <script type="text/javascript"> |
| 53 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 54 | </script> |
| 55 | <div id="navrow1" class="tabs"> |
| 56 | <ul class="tablist"> |
| 57 | <li><a href="index.xhtml"><span>Main Page</span></a></li> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 58 | <li><a href="pages.xhtml"><span>Related Pages</span></a></li> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 59 | <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li> |
| 60 | <li><a href="annotated.xhtml"><span>Data Structures</span></a></li> |
| 61 | <li class="current"><a href="files.xhtml"><span>Files</span></a></li> |
| 62 | <li> |
| 63 | <div id="MSearchBox" class="MSearchBoxInactive"> |
| 64 | <span class="left"> |
| 65 | <img id="MSearchSelect" src="search/mag_sel.png" |
| 66 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 67 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 68 | alt=""/> |
| 69 | <input type="text" id="MSearchField" value="Search" accesskey="S" |
| 70 | onfocus="searchBox.OnSearchFieldFocus(true)" |
| 71 | onblur="searchBox.OnSearchFieldFocus(false)" |
| 72 | onkeyup="searchBox.OnSearchFieldChange(event)"/> |
| 73 | </span><span class="right"> |
| 74 | <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> |
| 75 | </span> |
| 76 | </div> |
| 77 | </li> |
| 78 | </ul> |
| 79 | </div> |
| 80 | <div id="navrow2" class="tabs2"> |
| 81 | <ul class="tablist"> |
| 82 | <li><a href="files.xhtml"><span>File List</span></a></li> |
| 83 | <li><a href="globals.xhtml"><span>Globals</span></a></li> |
| 84 | </ul> |
| 85 | </div> |
| 86 | </div><!-- top --> |
| 87 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 88 | <div id="nav-tree"> |
| 89 | <div id="nav-tree-contents"> |
| 90 | <div id="nav-sync" class="sync"></div> |
| 91 | </div> |
| 92 | </div> |
| 93 | <div id="splitbar" style="-moz-user-select:none;" |
| 94 | class="ui-resizable-handle"> |
| 95 | </div> |
| 96 | </div> |
| 97 | <script type="text/javascript"> |
| 98 | $(document).ready(function(){initNavTree('pooling__layer_8cl.xhtml','');}); |
| 99 | </script> |
| 100 | <div id="doc-content"> |
| 101 | <!-- window showing the filter options --> |
| 102 | <div id="MSearchSelectWindow" |
| 103 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 104 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 105 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 106 | </div> |
| 107 | |
| 108 | <!-- iframe showing the search results (closed by default) --> |
| 109 | <div id="MSearchResultsWindow"> |
| 110 | <iframe src="javascript:void(0)" frameborder="0" |
| 111 | name="MSearchResults" id="MSearchResults"> |
| 112 | </iframe> |
| 113 | </div> |
| 114 | |
| 115 | <div class="header"> |
| 116 | <div class="summary"> |
| 117 | <a href="#define-members">Macros</a> | |
| 118 | <a href="#func-members">Functions</a> </div> |
| 119 | <div class="headertitle"> |
| 120 | <div class="title">pooling_layer.cl File Reference</div> </div> |
| 121 | </div><!--header--> |
| 122 | <div class="contents"> |
| 123 | <div class="textblock"><code>#include "<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>"</code><br /> |
| 124 | </div> |
| 125 | <p><a href="pooling__layer_8cl_source.xhtml">Go to the source code of this file.</a></p> |
| 126 | <table class="memberdecls"> |
| 127 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> |
| 128 | Macros</h2></td></tr> |
| 129 | <tr class="memitem:a482ef7d59a5f474ca126e737c7f0978a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="pooling__layer_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(x, y)   ((x) + (y))</td></tr> |
| 130 | <tr class="separator:a482ef7d59a5f474ca126e737c7f0978a"><td class="memSeparator" colspan="2"> </td></tr> |
| 131 | </table><table class="memberdecls"> |
| 132 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 133 | Functions</h2></td></tr> |
| 134 | <tr class="memitem:a60440813daa769d486c5786d52b91340"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="pooling__layer_8cl.xhtml#a60440813daa769d486c5786d52b91340">calculate_avg_scale</a> (const int pool_size, 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> |
| 135 | <tr class="separator:a60440813daa769d486c5786d52b91340"><td class="memSeparator" colspan="2"> </td></tr> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 136 | <tr class="memitem:a1ba58966776b7e6fb81c5432968db43d"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="pooling__layer_8cl.xhtml#a1ba58966776b7e6fb81c5432968db43d">pooling_layer_2</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, int2 max_dims, int2 strides, int2 paddings)</td></tr> |
| 137 | <tr class="memdesc:a1ba58966776b7e6fb81c5432968db43d"><td class="mdescLeft"> </td><td class="mdescRight">Performs a pooling function of pool size equal to 2. <a href="#a1ba58966776b7e6fb81c5432968db43d">More...</a><br /></td></tr> |
| 138 | <tr class="separator:a1ba58966776b7e6fb81c5432968db43d"><td class="memSeparator" colspan="2"> </td></tr> |
| 139 | <tr class="memitem:ad30794c96842e822dc6f2b992db79f97"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="pooling__layer_8cl.xhtml#ad30794c96842e822dc6f2b992db79f97">pooling_layer_3</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, int2 max_dims, int2 strides, int2 paddings)</td></tr> |
| 140 | <tr class="memdesc:ad30794c96842e822dc6f2b992db79f97"><td class="mdescLeft"> </td><td class="mdescRight">Performs a pooling function of pool size equal to 3. <a href="#ad30794c96842e822dc6f2b992db79f97">More...</a><br /></td></tr> |
| 141 | <tr class="separator:ad30794c96842e822dc6f2b992db79f97"><td class="memSeparator" colspan="2"> </td></tr> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 142 | </table> |
| 143 | <h2 class="groupheader">Macro Definition Documentation</h2> |
| 144 | <a class="anchor" id="a482ef7d59a5f474ca126e737c7f0978a"></a> |
| 145 | <div class="memitem"> |
| 146 | <div class="memproto"> |
| 147 | <table class="memname"> |
| 148 | <tr> |
| 149 | <td class="memname">#define POOL_OP</td> |
| 150 | <td>(</td> |
| 151 | <td class="paramtype"> </td> |
| 152 | <td class="paramname">x, </td> |
| 153 | </tr> |
| 154 | <tr> |
| 155 | <td class="paramkey"></td> |
| 156 | <td></td> |
| 157 | <td class="paramtype"> </td> |
| 158 | <td class="paramname">y </td> |
| 159 | </tr> |
| 160 | <tr> |
| 161 | <td></td> |
| 162 | <td>)</td> |
| 163 | <td></td><td>   ((x) + (y))</td> |
| 164 | </tr> |
| 165 | </table> |
| 166 | </div><div class="memdoc"> |
| 167 | |
| 168 | <p>Definition at line <a class="el" href="pooling__layer_8cl_source.xhtml#l00027">27</a> of file <a class="el" href="pooling__layer_8cl_source.xhtml">pooling_layer.cl</a>.</p> |
| 169 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 170 | <p>Referenced by <a class="el" href="pooling__layer_8cl_source.xhtml#l00068">pooling_layer_2()</a>, and <a class="el" href="pooling__layer_8cl_source.xhtml#l00126">pooling_layer_3()</a>.</p> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 171 | |
| 172 | </div> |
| 173 | </div> |
| 174 | <h2 class="groupheader">Function Documentation</h2> |
| 175 | <a class="anchor" id="a60440813daa769d486c5786d52b91340"></a> |
| 176 | <div class="memitem"> |
| 177 | <div class="memproto"> |
| 178 | <table class="memname"> |
| 179 | <tr> |
| 180 | <td class="memname">float calculate_avg_scale </td> |
| 181 | <td>(</td> |
| 182 | <td class="paramtype">const int </td> |
| 183 | <td class="paramname"><em>pool_size</em>, </td> |
| 184 | </tr> |
| 185 | <tr> |
| 186 | <td class="paramkey"></td> |
| 187 | <td></td> |
| 188 | <td class="paramtype">const int </td> |
| 189 | <td class="paramname"><em>upper_bound_w</em>, </td> |
| 190 | </tr> |
| 191 | <tr> |
| 192 | <td class="paramkey"></td> |
| 193 | <td></td> |
| 194 | <td class="paramtype">const int </td> |
| 195 | <td class="paramname"><em>upper_bound_h</em>, </td> |
| 196 | </tr> |
| 197 | <tr> |
| 198 | <td class="paramkey"></td> |
| 199 | <td></td> |
| 200 | <td class="paramtype">const int </td> |
| 201 | <td class="paramname"><em>pad_x</em>, </td> |
| 202 | </tr> |
| 203 | <tr> |
| 204 | <td class="paramkey"></td> |
| 205 | <td></td> |
| 206 | <td class="paramtype">const int </td> |
| 207 | <td class="paramname"><em>pad_y</em>, </td> |
| 208 | </tr> |
| 209 | <tr> |
| 210 | <td class="paramkey"></td> |
| 211 | <td></td> |
| 212 | <td class="paramtype">const int </td> |
| 213 | <td class="paramname"><em>stride_x</em>, </td> |
| 214 | </tr> |
| 215 | <tr> |
| 216 | <td class="paramkey"></td> |
| 217 | <td></td> |
| 218 | <td class="paramtype">const int </td> |
| 219 | <td class="paramname"><em>stride_y</em> </td> |
| 220 | </tr> |
| 221 | <tr> |
| 222 | <td></td> |
| 223 | <td>)</td> |
| 224 | <td></td><td></td> |
| 225 | </tr> |
| 226 | </table> |
| 227 | </div><div class="memdoc"> |
| 228 | |
| 229 | <p>Definition at line <a class="el" href="pooling__layer_8cl_source.xhtml#l00032">32</a> of file <a class="el" href="pooling__layer_8cl_source.xhtml">pooling_layer.cl</a>.</p> |
| 230 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 231 | <p>References <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00875">arm_compute::test::fixed_point_arithmetic::detail::min()</a>.</p> |
| 232 | |
| 233 | <p>Referenced by <a class="el" href="pooling__layer_8cl_source.xhtml#l00068">pooling_layer_2()</a>, and <a class="el" href="pooling__layer_8cl_source.xhtml#l00126">pooling_layer_3()</a>.</p> |
| 234 | <div class="fragment"><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="keywordtype">int</span> start_x = get_global_id(0) * stride_x - pad_x;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <span class="keywordtype">int</span> start_y = get_global_id(1) * stride_y - pad_y;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <span class="keywordtype">int</span> end_x = <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">min</a>(start_x + pool_size, upper_bound_w);</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <span class="keywordtype">int</span> end_y = <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">min</a>(start_y + pool_size, upper_bound_h);</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="keywordflow">return</span> 1.f / ((end_y - start_y) * (end_x - start_x));</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> }</div><div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_aabcf39e3917f842dbc5fbb0d802f24d5"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">arm_compute::test::fixed_point_arithmetic::detail::min</a></div><div class="ttdeci">fixed_point< T > min(fixed_point< T > x, fixed_point< T > y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00875">FixedPoint.h:875</a></div></div> |
| 235 | </div><!-- fragment --> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 236 | </div> |
| 237 | </div> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 238 | <a class="anchor" id="a1ba58966776b7e6fb81c5432968db43d"></a> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 239 | <div class="memitem"> |
| 240 | <div class="memproto"> |
| 241 | <table class="memname"> |
| 242 | <tr> |
| 243 | <td class="memname">__kernel void pooling_layer_2 </td> |
| 244 | <td>(</td> |
| 245 | <td class="paramtype">__global uchar * </td> |
| 246 | <td class="paramname"><em>input_ptr</em>, </td> |
| 247 | </tr> |
| 248 | <tr> |
| 249 | <td class="paramkey"></td> |
| 250 | <td></td> |
| 251 | <td class="paramtype">uint </td> |
| 252 | <td class="paramname"><em>input_stride_x</em>, </td> |
| 253 | </tr> |
| 254 | <tr> |
| 255 | <td class="paramkey"></td> |
| 256 | <td></td> |
| 257 | <td class="paramtype">uint </td> |
| 258 | <td class="paramname"><em>input_step_x</em>, </td> |
| 259 | </tr> |
| 260 | <tr> |
| 261 | <td class="paramkey"></td> |
| 262 | <td></td> |
| 263 | <td class="paramtype">uint </td> |
| 264 | <td class="paramname"><em>input_stride_y</em>, </td> |
| 265 | </tr> |
| 266 | <tr> |
| 267 | <td class="paramkey"></td> |
| 268 | <td></td> |
| 269 | <td class="paramtype">uint </td> |
| 270 | <td class="paramname"><em>input_step_y</em>, </td> |
| 271 | </tr> |
| 272 | <tr> |
| 273 | <td class="paramkey"></td> |
| 274 | <td></td> |
| 275 | <td class="paramtype">uint </td> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 276 | <td class="paramname"><em>input_stride_z</em>, </td> |
| 277 | </tr> |
| 278 | <tr> |
| 279 | <td class="paramkey"></td> |
| 280 | <td></td> |
| 281 | <td class="paramtype">uint </td> |
| 282 | <td class="paramname"><em>input_step_z</em>, </td> |
| 283 | </tr> |
| 284 | <tr> |
| 285 | <td class="paramkey"></td> |
| 286 | <td></td> |
| 287 | <td class="paramtype">uint </td> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 288 | <td class="paramname"><em>input_offset_first_element_in_bytes</em>, </td> |
| 289 | </tr> |
| 290 | <tr> |
| 291 | <td class="paramkey"></td> |
| 292 | <td></td> |
| 293 | <td class="paramtype">__global uchar * </td> |
| 294 | <td class="paramname"><em>output_ptr</em>, </td> |
| 295 | </tr> |
| 296 | <tr> |
| 297 | <td class="paramkey"></td> |
| 298 | <td></td> |
| 299 | <td class="paramtype">uint </td> |
| 300 | <td class="paramname"><em>output_stride_x</em>, </td> |
| 301 | </tr> |
| 302 | <tr> |
| 303 | <td class="paramkey"></td> |
| 304 | <td></td> |
| 305 | <td class="paramtype">uint </td> |
| 306 | <td class="paramname"><em>output_step_x</em>, </td> |
| 307 | </tr> |
| 308 | <tr> |
| 309 | <td class="paramkey"></td> |
| 310 | <td></td> |
| 311 | <td class="paramtype">uint </td> |
| 312 | <td class="paramname"><em>output_stride_y</em>, </td> |
| 313 | </tr> |
| 314 | <tr> |
| 315 | <td class="paramkey"></td> |
| 316 | <td></td> |
| 317 | <td class="paramtype">uint </td> |
| 318 | <td class="paramname"><em>output_step_y</em>, </td> |
| 319 | </tr> |
| 320 | <tr> |
| 321 | <td class="paramkey"></td> |
| 322 | <td></td> |
| 323 | <td class="paramtype">uint </td> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 324 | <td class="paramname"><em>output_stride_z</em>, </td> |
| 325 | </tr> |
| 326 | <tr> |
| 327 | <td class="paramkey"></td> |
| 328 | <td></td> |
| 329 | <td class="paramtype">uint </td> |
| 330 | <td class="paramname"><em>output_step_z</em>, </td> |
| 331 | </tr> |
| 332 | <tr> |
| 333 | <td class="paramkey"></td> |
| 334 | <td></td> |
| 335 | <td class="paramtype">uint </td> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 336 | <td class="paramname"><em>output_offset_first_element_in_bytes</em>, </td> |
| 337 | </tr> |
| 338 | <tr> |
| 339 | <td class="paramkey"></td> |
| 340 | <td></td> |
| 341 | <td class="paramtype">int2 </td> |
| 342 | <td class="paramname"><em>max_dims</em>, </td> |
| 343 | </tr> |
| 344 | <tr> |
| 345 | <td class="paramkey"></td> |
| 346 | <td></td> |
| 347 | <td class="paramtype">int2 </td> |
| 348 | <td class="paramname"><em>strides</em>, </td> |
| 349 | </tr> |
| 350 | <tr> |
| 351 | <td class="paramkey"></td> |
| 352 | <td></td> |
| 353 | <td class="paramtype">int2 </td> |
| 354 | <td class="paramname"><em>paddings</em> </td> |
| 355 | </tr> |
| 356 | <tr> |
| 357 | <td></td> |
| 358 | <td>)</td> |
| 359 | <td></td><td></td> |
| 360 | </tr> |
| 361 | </table> |
| 362 | </div><div class="memdoc"> |
| 363 | |
| 364 | <p>Performs a pooling function of pool size equal to 2. </p> |
| 365 | <dl class="section note"><dt>Note</dt><dd>Pooling stride must be passed using -DPOOL_STRIDE e.g -DPOOL_STRIDE=2. Supported strides are 1,2,3 </dd> |
| 366 | <dd> |
| 367 | Datatype must be passed using -DDATA_TYPE e.g. -DDATA_TYPE=float. Supported data types are F16, F32; </dd> |
| 368 | <dd> |
| 369 | In case of average pooling -DPOOL_AVG must be provided otherwise max pooling will be performed.</dd></dl> |
| 370 | <dl class="params"><dt>Parameters</dt><dd> |
| 371 | <table class="params"> |
| 372 | <tr><td class="paramdir">[in]</td><td class="paramname">input_ptr</td><td>Pointer to the source image. Supported data types: F16, F32 </td></tr> |
| 373 | <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> |
| 374 | <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> |
| 375 | <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> |
| 376 | <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> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 377 | <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> |
| 378 | <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> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 379 | <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> |
| 380 | <tr><td class="paramdir">[out]</td><td class="paramname">output_ptr</td><td>Pointer to the destination image. Supported data types: F16, F32 </td></tr> |
| 381 | <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> |
| 382 | <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> |
| 383 | <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> |
| 384 | <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> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 385 | <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> |
| 386 | <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> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 387 | <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> |
| 388 | <tr><td class="paramdir">[in]</td><td class="paramname">max_dims</td><td>The maximum index that can be accessed in x and y dimension (width + pad) </td></tr> |
| 389 | <tr><td class="paramdir">[in]</td><td class="paramname">strides</td><td>The pooling operation strides in each dimension </td></tr> |
| 390 | <tr><td class="paramdir">[in]</td><td class="paramname">paddings</td><td>The pooling operation paddings in each dimension </td></tr> |
| 391 | </table> |
| 392 | </dd> |
| 393 | </dl> |
| 394 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 395 | <p>Definition at line <a class="el" href="pooling__layer_8cl_source.xhtml#l00068">68</a> of file <a class="el" href="pooling__layer_8cl_source.xhtml">pooling_layer.cl</a>.</p> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 396 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 397 | <p>References <a class="el" href="pooling__layer_8cl_source.xhtml#l00032">calculate_avg_scale()</a>, <a class="el" href="helpers_8h_source.xhtml#l00079">CONVERT_TO_TENSOR3D_STRUCT</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, <a class="el" href="pooling__layer_8cl_source.xhtml#l00027">POOL_OP</a>, <a class="el" href="helpers_8h_source.xhtml#l00106">Tensor3D::ptr</a>, <a class="el" href="helpers_8h_source.xhtml#l00213">tensor3D_offset()</a>, and <a class="el" href="helpers_8h_source.xhtml#l00032">VEC_DATA_TYPE</a>.</p> |
| 398 | <div class="fragment"><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> {</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="comment">// Get pixels pointer</span></div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> input = <a class="code" href="helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(input);</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> output = <a class="code" href="helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(output);</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="comment">// Load data</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 2)</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  data0 = vload2(0, (__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a2101b2fe0193ce227ae4e0945e321d85">tensor3D_offset</a>(&input, 0, 0, 0));</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 2)</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  data1 = vload2(0, (__global DATA_TYPE *)<a class="code" href="helpers_8h.xhtml#a2101b2fe0193ce227ae4e0945e321d85">tensor3D_offset</a>(&input, 0, 1, 0));</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="comment">// Perform calculations</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  data0 = <a class="code" href="pooling__layer_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(data0, data1);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  DATA_TYPE res = <a class="code" href="pooling__layer_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(data0.s0, data0.s1);</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="comment">// Divide by 4 in case of average pooling</span></div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span> <span class="preprocessor">#ifdef POOL_AVG</span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  res *= <a class="code" href="pooling__layer_8cl.xhtml#a60440813daa769d486c5786d52b91340">calculate_avg_scale</a>(2, max_dims.x, max_dims.y, paddings.x, paddings.y, strides.x, strides.y);</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="comment">// Store result</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  *(__global DATA_TYPE *)output.<a class="code" href="struct_tensor3_d.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> = res;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> }</div><div class="ttc" id="pooling__layer_8cl_xhtml_a482ef7d59a5f474ca126e737c7f0978a"><div class="ttname"><a href="pooling__layer_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_8cl_source.xhtml#l00027">pooling_layer.cl:27</a></div></div> |
| 399 | <div class="ttc" id="helpers_8h_xhtml_a31c8c760f08fb1a331b16b7c204321dc"><div class="ttname"><a href="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="helpers_8h_source.xhtml#l00079">helpers.h:79</a></div></div> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 400 | <div class="ttc" id="convolution3x3_8cl_xhtml_afb8c72ce35c4a1f4a2588d6573e54aa1"><div class="ttname"><a href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a></div><div class="ttdeci">#define DATA_TYPE</div><div class="ttdef"><b>Definition:</b> <a href="convolution3x3_8cl_source.xhtml#l00027">convolution3x3.cl:27</a></div></div> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 401 | <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="helpers_8h_source.xhtml#l00104">helpers.h:104</a></div></div> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 402 | <div class="ttc" id="pooling__layer_8cl_xhtml_a60440813daa769d486c5786d52b91340"><div class="ttname"><a href="pooling__layer_8cl.xhtml#a60440813daa769d486c5786d52b91340">calculate_avg_scale</a></div><div class="ttdeci">float calculate_avg_scale(const int pool_size, 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_8cl_source.xhtml#l00032">pooling_layer.cl:32</a></div></div> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 403 | <div class="ttc" id="helpers_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a></div><div class="ttdeci">#define VEC_DATA_TYPE(type, size)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00032">helpers.h:32</a></div></div> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 404 | <div class="ttc" id="helpers_8h_xhtml_a2101b2fe0193ce227ae4e0945e321d85"><div class="ttname"><a href="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="helpers_8h_source.xhtml#l00213">helpers.h:213</a></div></div> |
| 405 | <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="helpers_8h_source.xhtml#l00106">helpers.h:106</a></div></div> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 406 | </div><!-- fragment --> |
| 407 | </div> |
| 408 | </div> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 409 | <a class="anchor" id="ad30794c96842e822dc6f2b992db79f97"></a> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 410 | <div class="memitem"> |
| 411 | <div class="memproto"> |
| 412 | <table class="memname"> |
| 413 | <tr> |
| 414 | <td class="memname">__kernel void pooling_layer_3 </td> |
| 415 | <td>(</td> |
| 416 | <td class="paramtype">__global uchar * </td> |
| 417 | <td class="paramname"><em>input_ptr</em>, </td> |
| 418 | </tr> |
| 419 | <tr> |
| 420 | <td class="paramkey"></td> |
| 421 | <td></td> |
| 422 | <td class="paramtype">uint </td> |
| 423 | <td class="paramname"><em>input_stride_x</em>, </td> |
| 424 | </tr> |
| 425 | <tr> |
| 426 | <td class="paramkey"></td> |
| 427 | <td></td> |
| 428 | <td class="paramtype">uint </td> |
| 429 | <td class="paramname"><em>input_step_x</em>, </td> |
| 430 | </tr> |
| 431 | <tr> |
| 432 | <td class="paramkey"></td> |
| 433 | <td></td> |
| 434 | <td class="paramtype">uint </td> |
| 435 | <td class="paramname"><em>input_stride_y</em>, </td> |
| 436 | </tr> |
| 437 | <tr> |
| 438 | <td class="paramkey"></td> |
| 439 | <td></td> |
| 440 | <td class="paramtype">uint </td> |
| 441 | <td class="paramname"><em>input_step_y</em>, </td> |
| 442 | </tr> |
| 443 | <tr> |
| 444 | <td class="paramkey"></td> |
| 445 | <td></td> |
| 446 | <td class="paramtype">uint </td> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 447 | <td class="paramname"><em>input_stride_z</em>, </td> |
| 448 | </tr> |
| 449 | <tr> |
| 450 | <td class="paramkey"></td> |
| 451 | <td></td> |
| 452 | <td class="paramtype">uint </td> |
| 453 | <td class="paramname"><em>input_step_z</em>, </td> |
| 454 | </tr> |
| 455 | <tr> |
| 456 | <td class="paramkey"></td> |
| 457 | <td></td> |
| 458 | <td class="paramtype">uint </td> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 459 | <td class="paramname"><em>input_offset_first_element_in_bytes</em>, </td> |
| 460 | </tr> |
| 461 | <tr> |
| 462 | <td class="paramkey"></td> |
| 463 | <td></td> |
| 464 | <td class="paramtype">__global uchar * </td> |
| 465 | <td class="paramname"><em>output_ptr</em>, </td> |
| 466 | </tr> |
| 467 | <tr> |
| 468 | <td class="paramkey"></td> |
| 469 | <td></td> |
| 470 | <td class="paramtype">uint </td> |
| 471 | <td class="paramname"><em>output_stride_x</em>, </td> |
| 472 | </tr> |
| 473 | <tr> |
| 474 | <td class="paramkey"></td> |
| 475 | <td></td> |
| 476 | <td class="paramtype">uint </td> |
| 477 | <td class="paramname"><em>output_step_x</em>, </td> |
| 478 | </tr> |
| 479 | <tr> |
| 480 | <td class="paramkey"></td> |
| 481 | <td></td> |
| 482 | <td class="paramtype">uint </td> |
| 483 | <td class="paramname"><em>output_stride_y</em>, </td> |
| 484 | </tr> |
| 485 | <tr> |
| 486 | <td class="paramkey"></td> |
| 487 | <td></td> |
| 488 | <td class="paramtype">uint </td> |
| 489 | <td class="paramname"><em>output_step_y</em>, </td> |
| 490 | </tr> |
| 491 | <tr> |
| 492 | <td class="paramkey"></td> |
| 493 | <td></td> |
| 494 | <td class="paramtype">uint </td> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 495 | <td class="paramname"><em>output_stride_z</em>, </td> |
| 496 | </tr> |
| 497 | <tr> |
| 498 | <td class="paramkey"></td> |
| 499 | <td></td> |
| 500 | <td class="paramtype">uint </td> |
| 501 | <td class="paramname"><em>output_step_z</em>, </td> |
| 502 | </tr> |
| 503 | <tr> |
| 504 | <td class="paramkey"></td> |
| 505 | <td></td> |
| 506 | <td class="paramtype">uint </td> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 507 | <td class="paramname"><em>output_offset_first_element_in_bytes</em>, </td> |
| 508 | </tr> |
| 509 | <tr> |
| 510 | <td class="paramkey"></td> |
| 511 | <td></td> |
| 512 | <td class="paramtype">int2 </td> |
| 513 | <td class="paramname"><em>max_dims</em>, </td> |
| 514 | </tr> |
| 515 | <tr> |
| 516 | <td class="paramkey"></td> |
| 517 | <td></td> |
| 518 | <td class="paramtype">int2 </td> |
| 519 | <td class="paramname"><em>strides</em>, </td> |
| 520 | </tr> |
| 521 | <tr> |
| 522 | <td class="paramkey"></td> |
| 523 | <td></td> |
| 524 | <td class="paramtype">int2 </td> |
| 525 | <td class="paramname"><em>paddings</em> </td> |
| 526 | </tr> |
| 527 | <tr> |
| 528 | <td></td> |
| 529 | <td>)</td> |
| 530 | <td></td><td></td> |
| 531 | </tr> |
| 532 | </table> |
| 533 | </div><div class="memdoc"> |
| 534 | |
| 535 | <p>Performs a pooling function of pool size equal to 3. </p> |
| 536 | <dl class="section note"><dt>Note</dt><dd>Pooling stride must be passed using -DPOOL_STRIDE e.g -DPOOL_STRIDE=2. Supported strides are 1,2,3 </dd> |
| 537 | <dd> |
| 538 | Datatype must be passed using -DDATA_TYPE e.g. -DDATA_TYPE=float. Supported data types are F16, F32; </dd> |
| 539 | <dd> |
| 540 | In case of average pooling -DPOOL_AVG must be provided otherwise max pooling will be performed.</dd></dl> |
| 541 | <dl class="params"><dt>Parameters</dt><dd> |
| 542 | <table class="params"> |
| 543 | <tr><td class="paramdir">[in]</td><td class="paramname">input_ptr</td><td>Pointer to the source image. Supported data types: F16, F32 </td></tr> |
| 544 | <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> |
| 545 | <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> |
| 546 | <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> |
| 547 | <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> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 548 | <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> |
| 549 | <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> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 550 | <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> |
| 551 | <tr><td class="paramdir">[out]</td><td class="paramname">output_ptr</td><td>Pointer to the destination image. Supported data types: F16, F32 </td></tr> |
| 552 | <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> |
| 553 | <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> |
| 554 | <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> |
| 555 | <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> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 556 | <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> |
| 557 | <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> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 558 | <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> |
| 559 | <tr><td class="paramdir">[in]</td><td class="paramname">max_dims</td><td>The maximum index that can be accessed in x and y dimension (width + pad) </td></tr> |
| 560 | <tr><td class="paramdir">[in]</td><td class="paramname">strides</td><td>The pooling operation strides in each dimension </td></tr> |
| 561 | <tr><td class="paramdir">[in]</td><td class="paramname">paddings</td><td>The pooling operation paddings in each dimension </td></tr> |
| 562 | </table> |
| 563 | </dd> |
| 564 | </dl> |
| 565 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 566 | <p>Definition at line <a class="el" href="pooling__layer_8cl_source.xhtml#l00126">126</a> of file <a class="el" href="pooling__layer_8cl_source.xhtml">pooling_layer.cl</a>.</p> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 567 | |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 568 | <p>References <a class="el" href="pooling__layer_8cl_source.xhtml#l00032">calculate_avg_scale()</a>, <a class="el" href="helpers_8h_source.xhtml#l00079">CONVERT_TO_TENSOR3D_STRUCT</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, <a class="el" href="pooling__layer_8cl_source.xhtml#l00027">POOL_OP</a>, <a class="el" href="helpers_8h_source.xhtml#l00106">Tensor3D::ptr</a>, <a class="el" href="helpers_8h_source.xhtml#l00213">tensor3D_offset()</a>, and <a class="el" href="helpers_8h_source.xhtml#l00032">VEC_DATA_TYPE</a>.</p> |
| 569 | <div class="fragment"><div class="line"><a name="l00134"></a><span class="lineno"> 134</span> {</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="comment">// Get pixels pointer</span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> input = <a class="code" href="helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(input);</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> output = <a class="code" href="helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(output);</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span> </div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="comment">// Load data</span></div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 3)</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  data0 = vload3(0, (__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="helpers_8h.xhtml#a2101b2fe0193ce227ae4e0945e321d85">tensor3D_offset</a>(&input, 0, 0, 0));</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 3)</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  data1 = vload3(0, (__global DATA_TYPE *)<a class="code" href="helpers_8h.xhtml#a2101b2fe0193ce227ae4e0945e321d85">tensor3D_offset</a>(&input, 0, 1, 0));</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(DATA_TYPE, 3)</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  data2 = vload3(0, (__global DATA_TYPE *)<a class="code" href="helpers_8h.xhtml#a2101b2fe0193ce227ae4e0945e321d85">tensor3D_offset</a>(&input, 0, 2, 0));</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> </div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="comment">// Perform calculations</span></div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  data0 = <a class="code" href="pooling__layer_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(data0, data1);</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  data0 = <a class="code" href="pooling__layer_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(data0, data2);</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  DATA_TYPE res = <a class="code" href="pooling__layer_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(<a class="code" href="pooling__layer_8cl.xhtml#a482ef7d59a5f474ca126e737c7f0978a">POOL_OP</a>(data0.s0, data0.s1), data0.s2);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span> </div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="comment">// Divide by 4 in case of average pooling</span></div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span> <span class="preprocessor">#ifdef POOL_AVG</span></div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  res *= <a class="code" href="pooling__layer_8cl.xhtml#a60440813daa769d486c5786d52b91340">calculate_avg_scale</a>(3, max_dims.x, max_dims.y, paddings.x, paddings.y, strides.x, strides.y);</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span> <span class="preprocessor">#endif</span></div><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="comment">// Store result</span></div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  *(__global DATA_TYPE *)output.<a class="code" href="struct_tensor3_d.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> = res;</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span> }</div><div class="ttc" id="pooling__layer_8cl_xhtml_a482ef7d59a5f474ca126e737c7f0978a"><div class="ttname"><a href="pooling__layer_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_8cl_source.xhtml#l00027">pooling_layer.cl:27</a></div></div> |
| 570 | <div class="ttc" id="helpers_8h_xhtml_a31c8c760f08fb1a331b16b7c204321dc"><div class="ttname"><a href="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="helpers_8h_source.xhtml#l00079">helpers.h:79</a></div></div> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 571 | <div class="ttc" id="convolution3x3_8cl_xhtml_afb8c72ce35c4a1f4a2588d6573e54aa1"><div class="ttname"><a href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a></div><div class="ttdeci">#define DATA_TYPE</div><div class="ttdef"><b>Definition:</b> <a href="convolution3x3_8cl_source.xhtml#l00027">convolution3x3.cl:27</a></div></div> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 572 | <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="helpers_8h_source.xhtml#l00104">helpers.h:104</a></div></div> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 573 | <div class="ttc" id="pooling__layer_8cl_xhtml_a60440813daa769d486c5786d52b91340"><div class="ttname"><a href="pooling__layer_8cl.xhtml#a60440813daa769d486c5786d52b91340">calculate_avg_scale</a></div><div class="ttdeci">float calculate_avg_scale(const int pool_size, 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_8cl_source.xhtml#l00032">pooling_layer.cl:32</a></div></div> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 574 | <div class="ttc" id="helpers_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a></div><div class="ttdeci">#define VEC_DATA_TYPE(type, size)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00032">helpers.h:32</a></div></div> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 575 | <div class="ttc" id="helpers_8h_xhtml_a2101b2fe0193ce227ae4e0945e321d85"><div class="ttname"><a href="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="helpers_8h_source.xhtml#l00213">helpers.h:213</a></div></div> |
| 576 | <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="helpers_8h_source.xhtml#l00106">helpers.h:106</a></div></div> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 577 | </div><!-- fragment --> |
| 578 | </div> |
| 579 | </div> |
| 580 | </div><!-- contents --> |
| 581 | </div><!-- doc-content --> |
| 582 | <!-- start footer part --> |
| 583 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 584 | <ul> |
| 585 | <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_8cl.xhtml">pooling_layer.cl</a></li> |
Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [diff] [blame^] | 586 | <li class="footer">Generated on Fri Jun 23 2017 15:44:34 for Compute Library by |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 587 | <a href="http://www.doxygen.org/index.html"> |
| 588 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li> |
| 589 | </ul> |
| 590 | </div> |
| 591 | </body> |
| 592 | </html> |