Anthony Barbier | dbdab85 | 2017-06-23 15:42:00 +0100 | [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 --> |
| 9 | <title>Compute Library: src/core/CL/cl_kernels/batchnormalization_layer.cl File Reference</title> |
| 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;"> |
| 42 | <div id="projectname">Compute Library |
| 43 |  <span id="projectnumber">v17.06</span> |
| 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> |
| 58 | <li><a href="pages.xhtml"><span>Related Pages</span></a></li> |
| 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('batchnormalization__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="#func-members">Functions</a> </div> |
| 118 | <div class="headertitle"> |
| 119 | <div class="title">batchnormalization_layer.cl File Reference</div> </div> |
| 120 | </div><!--header--> |
| 121 | <div class="contents"> |
| 122 | <div class="textblock"><code>#include "<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>"</code><br /> |
| 123 | </div> |
| 124 | <p><a href="batchnormalization__layer_8cl_source.xhtml">Go to the source code of this file.</a></p> |
| 125 | <table class="memberdecls"> |
| 126 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 127 | Functions</h2></td></tr> |
| 128 | <tr class="memitem:a38320a1607c05acba75c51c0fb3aec38"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="batchnormalization__layer_8cl.xhtml#a38320a1607c05acba75c51c0fb3aec38">batchnormalization_layer</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, __global uchar *mean_ptr, uint mean_stride_x, uint mean_step_x, uint mean_offset_first_element_in_bytes, __global uchar *var_ptr, uint var_stride_x, uint var_step_x, uint var_offset_first_element_in_bytes, __global uchar *beta_ptr, uint beta_stride_x, uint beta_step_x, uint beta_offset_first_element_in_bytes, __global uchar *gamma_ptr, uint gamma_stride_x, uint gamma_step_x, uint gamma_offset_first_element_in_bytes, float epsilon)</td></tr> |
| 129 | <tr class="memdesc:a38320a1607c05acba75c51c0fb3aec38"><td class="mdescLeft"> </td><td class="mdescRight">Apply batch normalization. <a href="#a38320a1607c05acba75c51c0fb3aec38">More...</a><br /></td></tr> |
| 130 | <tr class="separator:a38320a1607c05acba75c51c0fb3aec38"><td class="memSeparator" colspan="2"> </td></tr> |
| 131 | </table> |
| 132 | <h2 class="groupheader">Function Documentation</h2> |
| 133 | <a class="anchor" id="a38320a1607c05acba75c51c0fb3aec38"></a> |
| 134 | <div class="memitem"> |
| 135 | <div class="memproto"> |
| 136 | <table class="memname"> |
| 137 | <tr> |
| 138 | <td class="memname">__kernel void batchnormalization_layer </td> |
| 139 | <td>(</td> |
| 140 | <td class="paramtype">__global uchar * </td> |
| 141 | <td class="paramname"><em>input_ptr</em>, </td> |
| 142 | </tr> |
| 143 | <tr> |
| 144 | <td class="paramkey"></td> |
| 145 | <td></td> |
| 146 | <td class="paramtype">uint </td> |
| 147 | <td class="paramname"><em>input_stride_x</em>, </td> |
| 148 | </tr> |
| 149 | <tr> |
| 150 | <td class="paramkey"></td> |
| 151 | <td></td> |
| 152 | <td class="paramtype">uint </td> |
| 153 | <td class="paramname"><em>input_step_x</em>, </td> |
| 154 | </tr> |
| 155 | <tr> |
| 156 | <td class="paramkey"></td> |
| 157 | <td></td> |
| 158 | <td class="paramtype">uint </td> |
| 159 | <td class="paramname"><em>input_stride_y</em>, </td> |
| 160 | </tr> |
| 161 | <tr> |
| 162 | <td class="paramkey"></td> |
| 163 | <td></td> |
| 164 | <td class="paramtype">uint </td> |
| 165 | <td class="paramname"><em>input_step_y</em>, </td> |
| 166 | </tr> |
| 167 | <tr> |
| 168 | <td class="paramkey"></td> |
| 169 | <td></td> |
| 170 | <td class="paramtype">uint </td> |
| 171 | <td class="paramname"><em>input_stride_z</em>, </td> |
| 172 | </tr> |
| 173 | <tr> |
| 174 | <td class="paramkey"></td> |
| 175 | <td></td> |
| 176 | <td class="paramtype">uint </td> |
| 177 | <td class="paramname"><em>input_step_z</em>, </td> |
| 178 | </tr> |
| 179 | <tr> |
| 180 | <td class="paramkey"></td> |
| 181 | <td></td> |
| 182 | <td class="paramtype">uint </td> |
| 183 | <td class="paramname"><em>input_offset_first_element_in_bytes</em>, </td> |
| 184 | </tr> |
| 185 | <tr> |
| 186 | <td class="paramkey"></td> |
| 187 | <td></td> |
| 188 | <td class="paramtype">__global uchar * </td> |
| 189 | <td class="paramname"><em>output_ptr</em>, </td> |
| 190 | </tr> |
| 191 | <tr> |
| 192 | <td class="paramkey"></td> |
| 193 | <td></td> |
| 194 | <td class="paramtype">uint </td> |
| 195 | <td class="paramname"><em>output_stride_x</em>, </td> |
| 196 | </tr> |
| 197 | <tr> |
| 198 | <td class="paramkey"></td> |
| 199 | <td></td> |
| 200 | <td class="paramtype">uint </td> |
| 201 | <td class="paramname"><em>output_step_x</em>, </td> |
| 202 | </tr> |
| 203 | <tr> |
| 204 | <td class="paramkey"></td> |
| 205 | <td></td> |
| 206 | <td class="paramtype">uint </td> |
| 207 | <td class="paramname"><em>output_stride_y</em>, </td> |
| 208 | </tr> |
| 209 | <tr> |
| 210 | <td class="paramkey"></td> |
| 211 | <td></td> |
| 212 | <td class="paramtype">uint </td> |
| 213 | <td class="paramname"><em>output_step_y</em>, </td> |
| 214 | </tr> |
| 215 | <tr> |
| 216 | <td class="paramkey"></td> |
| 217 | <td></td> |
| 218 | <td class="paramtype">uint </td> |
| 219 | <td class="paramname"><em>output_stride_z</em>, </td> |
| 220 | </tr> |
| 221 | <tr> |
| 222 | <td class="paramkey"></td> |
| 223 | <td></td> |
| 224 | <td class="paramtype">uint </td> |
| 225 | <td class="paramname"><em>output_step_z</em>, </td> |
| 226 | </tr> |
| 227 | <tr> |
| 228 | <td class="paramkey"></td> |
| 229 | <td></td> |
| 230 | <td class="paramtype">uint </td> |
| 231 | <td class="paramname"><em>output_offset_first_element_in_bytes</em>, </td> |
| 232 | </tr> |
| 233 | <tr> |
| 234 | <td class="paramkey"></td> |
| 235 | <td></td> |
| 236 | <td class="paramtype">__global uchar * </td> |
| 237 | <td class="paramname"><em>mean_ptr</em>, </td> |
| 238 | </tr> |
| 239 | <tr> |
| 240 | <td class="paramkey"></td> |
| 241 | <td></td> |
| 242 | <td class="paramtype">uint </td> |
| 243 | <td class="paramname"><em>mean_stride_x</em>, </td> |
| 244 | </tr> |
| 245 | <tr> |
| 246 | <td class="paramkey"></td> |
| 247 | <td></td> |
| 248 | <td class="paramtype">uint </td> |
| 249 | <td class="paramname"><em>mean_step_x</em>, </td> |
| 250 | </tr> |
| 251 | <tr> |
| 252 | <td class="paramkey"></td> |
| 253 | <td></td> |
| 254 | <td class="paramtype">uint </td> |
| 255 | <td class="paramname"><em>mean_offset_first_element_in_bytes</em>, </td> |
| 256 | </tr> |
| 257 | <tr> |
| 258 | <td class="paramkey"></td> |
| 259 | <td></td> |
| 260 | <td class="paramtype">__global uchar * </td> |
| 261 | <td class="paramname"><em>var_ptr</em>, </td> |
| 262 | </tr> |
| 263 | <tr> |
| 264 | <td class="paramkey"></td> |
| 265 | <td></td> |
| 266 | <td class="paramtype">uint </td> |
| 267 | <td class="paramname"><em>var_stride_x</em>, </td> |
| 268 | </tr> |
| 269 | <tr> |
| 270 | <td class="paramkey"></td> |
| 271 | <td></td> |
| 272 | <td class="paramtype">uint </td> |
| 273 | <td class="paramname"><em>var_step_x</em>, </td> |
| 274 | </tr> |
| 275 | <tr> |
| 276 | <td class="paramkey"></td> |
| 277 | <td></td> |
| 278 | <td class="paramtype">uint </td> |
| 279 | <td class="paramname"><em>var_offset_first_element_in_bytes</em>, </td> |
| 280 | </tr> |
| 281 | <tr> |
| 282 | <td class="paramkey"></td> |
| 283 | <td></td> |
| 284 | <td class="paramtype">__global uchar * </td> |
| 285 | <td class="paramname"><em>beta_ptr</em>, </td> |
| 286 | </tr> |
| 287 | <tr> |
| 288 | <td class="paramkey"></td> |
| 289 | <td></td> |
| 290 | <td class="paramtype">uint </td> |
| 291 | <td class="paramname"><em>beta_stride_x</em>, </td> |
| 292 | </tr> |
| 293 | <tr> |
| 294 | <td class="paramkey"></td> |
| 295 | <td></td> |
| 296 | <td class="paramtype">uint </td> |
| 297 | <td class="paramname"><em>beta_step_x</em>, </td> |
| 298 | </tr> |
| 299 | <tr> |
| 300 | <td class="paramkey"></td> |
| 301 | <td></td> |
| 302 | <td class="paramtype">uint </td> |
| 303 | <td class="paramname"><em>beta_offset_first_element_in_bytes</em>, </td> |
| 304 | </tr> |
| 305 | <tr> |
| 306 | <td class="paramkey"></td> |
| 307 | <td></td> |
| 308 | <td class="paramtype">__global uchar * </td> |
| 309 | <td class="paramname"><em>gamma_ptr</em>, </td> |
| 310 | </tr> |
| 311 | <tr> |
| 312 | <td class="paramkey"></td> |
| 313 | <td></td> |
| 314 | <td class="paramtype">uint </td> |
| 315 | <td class="paramname"><em>gamma_stride_x</em>, </td> |
| 316 | </tr> |
| 317 | <tr> |
| 318 | <td class="paramkey"></td> |
| 319 | <td></td> |
| 320 | <td class="paramtype">uint </td> |
| 321 | <td class="paramname"><em>gamma_step_x</em>, </td> |
| 322 | </tr> |
| 323 | <tr> |
| 324 | <td class="paramkey"></td> |
| 325 | <td></td> |
| 326 | <td class="paramtype">uint </td> |
| 327 | <td class="paramname"><em>gamma_offset_first_element_in_bytes</em>, </td> |
| 328 | </tr> |
| 329 | <tr> |
| 330 | <td class="paramkey"></td> |
| 331 | <td></td> |
| 332 | <td class="paramtype">float </td> |
| 333 | <td class="paramname"><em>epsilon</em> </td> |
| 334 | </tr> |
| 335 | <tr> |
| 336 | <td></td> |
| 337 | <td>)</td> |
| 338 | <td></td><td></td> |
| 339 | </tr> |
| 340 | </table> |
| 341 | </div><div class="memdoc"> |
| 342 | |
| 343 | <p>Apply batch normalization. </p> |
| 344 | <dl class="params"><dt>Parameters</dt><dd> |
| 345 | <table class="params"> |
| 346 | <tr><td class="paramdir">[in]</td><td class="paramname">input_ptr</td><td>Pointer to the first source tensor. Supported data types: F32 </td></tr> |
| 347 | <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_x</td><td>Stride of the first source tensor in X dimension (in bytes) </td></tr> |
| 348 | <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> |
| 349 | <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_y</td><td>Stride of the first source tensor in Y dimension (in bytes) </td></tr> |
| 350 | <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> |
| 351 | <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_z</td><td>Stride of the first source tensor in Z dimension (in bytes) </td></tr> |
| 352 | <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> |
| 353 | <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 first source tensor </td></tr> |
| 354 | <tr><td class="paramdir">[out]</td><td class="paramname">output_ptr</td><td>Pointer to the destination tensor. Supported data types: F32 </td></tr> |
| 355 | <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> |
| 356 | <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> |
| 357 | <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> |
| 358 | <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> |
| 359 | <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> |
| 360 | <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> |
| 361 | <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 tensor </td></tr> |
| 362 | <tr><td class="paramdir">[in]</td><td class="paramname">mean_ptr</td><td>Pointer to the mean source tensor. Supported data types: F32 </td></tr> |
| 363 | <tr><td class="paramdir">[in]</td><td class="paramname">mean_stride_x</td><td>Stride of the mean source tensor in X dimension (in bytes) </td></tr> |
| 364 | <tr><td class="paramdir">[in]</td><td class="paramname">mean_step_x</td><td>mean_stride_x * number of elements along X processed per workitem(in bytes) </td></tr> |
| 365 | <tr><td class="paramdir">[in]</td><td class="paramname">mean_offset_first_element_in_bytes</td><td>The offset of the first element in the mean source tensor </td></tr> |
| 366 | <tr><td class="paramdir">[in]</td><td class="paramname">var_ptr</td><td>Pointer to the var tensor. Supported data types: F32 </td></tr> |
| 367 | <tr><td class="paramdir">[in]</td><td class="paramname">var_stride_x</td><td>Stride of the var tensor in X dimension (in bytes) </td></tr> |
| 368 | <tr><td class="paramdir">[in]</td><td class="paramname">var_step_x</td><td>var_stride_x * number of elements along X processed per workitem(in bytes) </td></tr> |
| 369 | <tr><td class="paramdir">[in]</td><td class="paramname">var_offset_first_element_in_bytes</td><td>The offset of the first element in the var source tensor </td></tr> |
| 370 | <tr><td class="paramdir">[in]</td><td class="paramname">beta_ptr</td><td>Pointer to the beta source tensor. Supported data types: F32 </td></tr> |
| 371 | <tr><td class="paramdir">[in]</td><td class="paramname">beta_stride_x</td><td>Stride of the beta source tensor in X dimension (in bytes) </td></tr> |
| 372 | <tr><td class="paramdir">[in]</td><td class="paramname">beta_step_x</td><td>beta_stride_x * number of elements along X processed per workitem(in bytes) </td></tr> |
| 373 | <tr><td class="paramdir">[in]</td><td class="paramname">beta_offset_first_element_in_bytes</td><td>The offset of the first element in the beta source tensor </td></tr> |
| 374 | <tr><td class="paramdir">[in]</td><td class="paramname">gamma_ptr</td><td>Pointer to the gamma source tensor. Supported data types: F32 </td></tr> |
| 375 | <tr><td class="paramdir">[in]</td><td class="paramname">gamma_stride_x</td><td>Stride of the gamma source tensor in X dimension (in bytes) </td></tr> |
| 376 | <tr><td class="paramdir">[in]</td><td class="paramname">gamma_step_x</td><td>gamma_stride_x * number of elements along X processed per workitem(in bytes) </td></tr> |
| 377 | <tr><td class="paramdir">[in]</td><td class="paramname">gamma_offset_first_element_in_bytes</td><td>The offset of the first element in the gamma source tensor </td></tr> |
| 378 | <tr><td class="paramdir">[in]</td><td class="paramname">epsilon</td><td>Epsilon parameter in the batch normalization equation </td></tr> |
| 379 | </table> |
| 380 | </dd> |
| 381 | </dl> |
| 382 | |
| 383 | <p>Definition at line <a class="el" href="batchnormalization__layer_8cl_source.xhtml#l00062">62</a> of file <a class="el" href="batchnormalization__layer_8cl_source.xhtml">batchnormalization_layer.cl</a>.</p> |
| 384 | |
| 385 | <p>References <a class="el" href="helpers_8h_source.xhtml#l00079">CONVERT_TO_TENSOR3D_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00067">CONVERT_TO_VECTOR_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00089">Vector::ptr</a>, <a class="el" href="helpers_8h_source.xhtml#l00106">Tensor3D::ptr</a>, and <a class="el" href="helpers_8h_source.xhtml#l00091">Vector::stride_x</a>.</p> |
| 386 | <div class="fragment"><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> {</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> in = <a class="code" href="helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(input);</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> out = <a class="code" href="helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(output);</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <a class="code" href="struct_vector.xhtml">Vector</a> mean = <a class="code" href="helpers_8h.xhtml#a527bfdf5eeb306f1cf01c4a8e29f38e0">CONVERT_TO_VECTOR_STRUCT</a>(mean);</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <a class="code" href="struct_vector.xhtml">Vector</a> var = <a class="code" href="helpers_8h.xhtml#a527bfdf5eeb306f1cf01c4a8e29f38e0">CONVERT_TO_VECTOR_STRUCT</a>(var);</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <a class="code" href="struct_vector.xhtml">Vector</a> beta = <a class="code" href="helpers_8h.xhtml#a527bfdf5eeb306f1cf01c4a8e29f38e0">CONVERT_TO_VECTOR_STRUCT</a>(beta);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <a class="code" href="struct_vector.xhtml">Vector</a> gamma = <a class="code" href="helpers_8h.xhtml#a527bfdf5eeb306f1cf01c4a8e29f38e0">CONVERT_TO_VECTOR_STRUCT</a>(gamma);</div><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>  float4 _in = 0;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  float4 denominator = 0;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  float4 numerator = 0;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  float4 x_bar = 0;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  float4 gamma_vec = 0;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  float4 beta_vec = 0;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> </div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> current_slice = get_global_id(2);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  _in = vload4(0, (__global <span class="keywordtype">float</span> *)in.<a class="code" href="struct_tensor3_d.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  denominator = *((__global <span class="keywordtype">float</span> *)(var.<a class="code" href="struct_vector.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> + current_slice * var.<a class="code" href="struct_vector.xhtml#ae01febbfd0689ef709f3ff6fdd2abc7e">stride_x</a>));</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  denominator = rsqrt(denominator + epsilon);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="comment">// Calculate x bar and store results</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  numerator = *((__global <span class="keywordtype">float</span> *)(mean.<a class="code" href="struct_vector.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> + current_slice * mean.<a class="code" href="struct_vector.xhtml#ae01febbfd0689ef709f3ff6fdd2abc7e">stride_x</a>));</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  numerator = _in - numerator;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  x_bar = numerator * denominator;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  gamma_vec = *((__global <span class="keywordtype">float</span> *)(gamma.<a class="code" href="struct_vector.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> + current_slice * beta.<a class="code" href="struct_vector.xhtml#ae01febbfd0689ef709f3ff6fdd2abc7e">stride_x</a>));</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  beta_vec = *((__global <span class="keywordtype">float</span> *)(beta.<a class="code" href="struct_vector.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> + current_slice * beta.<a class="code" href="struct_vector.xhtml#ae01febbfd0689ef709f3ff6fdd2abc7e">stride_x</a>));</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  vstore4(gamma_vec * x_bar + beta_vec, 0, (__global <span class="keywordtype">float</span> *)out.<a class="code" href="struct_tensor3_d.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> }</div><div class="ttc" id="struct_vector_xhtml"><div class="ttname"><a href="struct_vector.xhtml">Vector</a></div><div class="ttdoc">Structure to hold Vector information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00087">helpers.h:87</a></div></div> |
| 387 | <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> |
| 388 | <div class="ttc" id="helpers_8h_xhtml_a527bfdf5eeb306f1cf01c4a8e29f38e0"><div class="ttname"><a href="helpers_8h.xhtml#a527bfdf5eeb306f1cf01c4a8e29f38e0">CONVERT_TO_VECTOR_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_VECTOR_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00067">helpers.h:67</a></div></div> |
| 389 | <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> |
| 390 | <div class="ttc" id="struct_vector_xhtml_ae01febbfd0689ef709f3ff6fdd2abc7e"><div class="ttname"><a href="struct_vector.xhtml#ae01febbfd0689ef709f3ff6fdd2abc7e">Vector::stride_x</a></div><div class="ttdeci">int stride_x</div><div class="ttdoc">Stride of the image in X dimension (in bytes) </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00091">helpers.h:91</a></div></div> |
| 391 | <div class="ttc" id="struct_vector_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_vector.xhtml#acf52c23cbd7424606c10a606524e3e32">Vector::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#l00089">helpers.h:89</a></div></div> |
| 392 | <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> |
| 393 | </div><!-- fragment --> |
| 394 | </div> |
| 395 | </div> |
| 396 | </div><!-- contents --> |
| 397 | </div><!-- doc-content --> |
| 398 | <!-- start footer part --> |
| 399 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 400 | <ul> |
| 401 | <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="batchnormalization__layer_8cl.xhtml">batchnormalization_layer.cl</a></li> |
| 402 | <li class="footer">Generated on Fri Jun 23 2017 15:44:34 for Compute Library by |
| 403 | <a href="http://www.doxygen.org/index.html"> |
| 404 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li> |
| 405 | </ul> |
| 406 | </div> |
| 407 | </body> |
| 408 | </html> |