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">
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/depthwise_convolution.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);
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(); });
27 <script type="text/x-mathjax-config">
29 extensions: ["tex2jax.js"],
30 jax: ["input/TeX","output/HTML-CSS"],
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" />
36 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
38 <table cellspacing="0" cellpadding="0">
40 <tr style="height: 56px;">
41 <td style="padding-left: 0.5em;">
42 <div id="projectname">Compute Library
43  <span id="projectnumber">18.02</span>
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');
55 <div id="navrow1" class="tabs">
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>
63 <div id="MSearchBox" class="MSearchBoxInactive">
65 <img id="MSearchSelect" src="search/mag_sel.png"
66 onmouseover="return searchBox.OnSearchSelectShow()"
67 onmouseout="return searchBox.OnSearchSelectHide()"
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>
80 <div id="navrow2" class="tabs2">
82 <li><a href="files.xhtml"><span>File List</span></a></li>
83 <li><a href="globals.xhtml"><span>Globals</span></a></li>
87 <div id="side-nav" class="ui-resizable side-nav-resizable">
89 <div id="nav-tree-contents">
90 <div id="nav-sync" class="sync"></div>
93 <div id="splitbar" style="-moz-user-select:none;"
94 class="ui-resizable-handle">
97 <script type="text/javascript">
98 $(document).ready(function(){initNavTree('depthwise__convolution_8cl.xhtml','');});
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)">
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">
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">depthwise_convolution.cl File Reference</div> </div>
122 <div class="contents">
123 <div class="textblock"><code>#include "<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>"</code><br />
125 <p><a href="depthwise__convolution_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:aa5ab4cf85fe56de3821727cfcef327d9"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(acc, src0, weights_row0)</td></tr>
130 <tr class="separator:aa5ab4cf85fe56de3821727cfcef327d9"><td class="memSeparator" colspan="2"> </td></tr>
131 <tr class="memitem:a31cbdd6b28ee6331839432f69d87fdcb"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="depthwise__convolution_8cl.xhtml#a31cbdd6b28ee6331839432f69d87fdcb">CONVOLUTION1x3_BIFROST2X1_STRIDE2</a>(acc, src0, src1, weights_row0)</td></tr>
132 <tr class="separator:a31cbdd6b28ee6331839432f69d87fdcb"><td class="memSeparator" colspan="2"> </td></tr>
133 </table><table class="memberdecls">
134 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
135 Functions</h2></td></tr>
136 <tr class="memitem:a2fbbf5b73260b66b310d4d857db5289e"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="depthwise__convolution_8cl.xhtml#a2fbbf5b73260b66b310d4d857db5289e">depthwise_convolution_3x3_stridex1_stridey1_bifrost</a> (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_stride_z, uint src_step_z, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_stride_z, uint dst_step_z, uint dst_offset_first_element_in_bytes, __global uchar *weights_ptr, uint weights_stride_x, uint weights_step_x, uint weights_stride_y, uint weights_step_y, uint weights_stride_z, uint weights_step_z, uint weights_offset_first_element_in_bytes, __global uchar *biases_ptr, uint biases_stride_x, uint biases_step_x, uint biases_offset_first_element_in_bytes)</td></tr>
137 <tr class="memdesc:a2fbbf5b73260b66b310d4d857db5289e"><td class="mdescLeft"> </td><td class="mdescRight">This OpenCL kernel is optimized for Bifrost architectures and computes the depthwise convolution 3x3 when both stride_x and stride_y are equal to 1. <a href="#a2fbbf5b73260b66b310d4d857db5289e">More...</a><br /></td></tr>
138 <tr class="separator:a2fbbf5b73260b66b310d4d857db5289e"><td class="memSeparator" colspan="2"> </td></tr>
139 <tr class="memitem:a328ab548c536089e8238fb33de617bec"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="depthwise__convolution_8cl.xhtml#a328ab548c536089e8238fb33de617bec">depthwise_convolution_3x3_stridex2_stridey2_bifrost</a> (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_stride_z, uint src_step_z, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_stride_z, uint dst_step_z, uint dst_offset_first_element_in_bytes, __global uchar *weights_ptr, uint weights_stride_x, uint weights_step_x, uint weights_stride_y, uint weights_step_y, uint weights_stride_z, uint weights_step_z, uint weights_offset_first_element_in_bytes, __global uchar *biases_ptr, uint biases_stride_x, uint biases_step_x, uint biases_offset_first_element_in_bytes)</td></tr>
140 <tr class="memdesc:a328ab548c536089e8238fb33de617bec"><td class="mdescLeft"> </td><td class="mdescRight">This OpenCL kernel is optimized for Bifrost architectures and computes the depthwise convolution 3x3 when both stride_x and stride_y are equal to 2. <a href="#a328ab548c536089e8238fb33de617bec">More...</a><br /></td></tr>
141 <tr class="separator:a328ab548c536089e8238fb33de617bec"><td class="memSeparator" colspan="2"> </td></tr>
143 <h2 class="groupheader">Macro Definition Documentation</h2>
144 <a class="anchor" id="aa5ab4cf85fe56de3821727cfcef327d9"></a>
145 <div class="memitem">
146 <div class="memproto">
147 <table class="memname">
149 <td class="memname">#define CONVOLUTION1x3_BIFROST2X1_STRIDE1</td>
151 <td class="paramtype"> </td>
152 <td class="paramname">acc, </td>
155 <td class="paramkey"></td>
157 <td class="paramtype"> </td>
158 <td class="paramname">src0, </td>
161 <td class="paramkey"></td>
163 <td class="paramtype"> </td>
164 <td class="paramname">weights_row0 </td>
172 </div><div class="memdoc">
173 <b>Value:</b><div class="fragment"><div class="line">({ \</div><div class="line"> acc.s0 = fma(src0.s0, weights_row0.s0, acc.s0); \</div><div class="line"> acc.s0 = fma(src0.s1, weights_row0.s1, acc.s0); \</div><div class="line"> acc.s0 = fma(src0.s2, weights_row0.s2, acc.s0); \</div><div class="line"> acc.s1 = fma(src0.s1, weights_row0.s0, acc.s1); \</div><div class="line"> acc.s1 = fma(src0.s2, weights_row0.s1, acc.s1); \</div><div class="line"> acc.s1 = fma(src0.s3, weights_row0.s2, acc.s1); \</div><div class="line"> })</div></div><!-- fragment -->
174 <p>Definition at line <a class="el" href="depthwise__convolution_8cl_source.xhtml#l00211">211</a> of file <a class="el" href="depthwise__convolution_8cl_source.xhtml">depthwise_convolution.cl</a>.</p>
176 <p>Referenced by <a class="el" href="depthwise__convolution_8cl_source.xhtml#l00263">depthwise_convolution_3x3_stridex1_stridey1_bifrost()</a>.</p>
180 <a class="anchor" id="a31cbdd6b28ee6331839432f69d87fdcb"></a>
181 <div class="memitem">
182 <div class="memproto">
183 <table class="memname">
185 <td class="memname">#define CONVOLUTION1x3_BIFROST2X1_STRIDE2</td>
187 <td class="paramtype"> </td>
188 <td class="paramname">acc, </td>
191 <td class="paramkey"></td>
193 <td class="paramtype"> </td>
194 <td class="paramname">src0, </td>
197 <td class="paramkey"></td>
199 <td class="paramtype"> </td>
200 <td class="paramname">src1, </td>
203 <td class="paramkey"></td>
205 <td class="paramtype"> </td>
206 <td class="paramname">weights_row0 </td>
214 </div><div class="memdoc">
215 <b>Value:</b><div class="fragment"><div class="line">({ \</div><div class="line"> acc.s0 = fma(src0.s0, weights_row0.s0, acc.s0); \</div><div class="line"> acc.s0 = fma(src0.s1, weights_row0.s1, acc.s0); \</div><div class="line"> acc.s0 = fma(src0.s2, weights_row0.s2, acc.s0); \</div><div class="line"> acc.s1 = fma(src0.s2, weights_row0.s0, acc.s1); \</div><div class="line"> acc.s1 = fma(src0.s3, weights_row0.s1, acc.s1); \</div><div class="line"> acc.s1 = fma(src1.s0, weights_row0.s2, acc.s1); \</div><div class="line"> })</div></div><!-- fragment -->
216 <p>Definition at line <a class="el" href="depthwise__convolution_8cl_source.xhtml#l00221">221</a> of file <a class="el" href="depthwise__convolution_8cl_source.xhtml">depthwise_convolution.cl</a>.</p>
218 <p>Referenced by <a class="el" href="depthwise__convolution_8cl_source.xhtml#l00360">depthwise_convolution_3x3_stridex2_stridey2_bifrost()</a>.</p>
222 <h2 class="groupheader">Function Documentation</h2>
223 <a class="anchor" id="a2fbbf5b73260b66b310d4d857db5289e"></a>
224 <div class="memitem">
225 <div class="memproto">
226 <table class="memname">
228 <td class="memname">__kernel void depthwise_convolution_3x3_stridex1_stridey1_bifrost </td>
230 <td class="paramtype">__global uchar * </td>
231 <td class="paramname"><em>src_ptr</em>, </td>
234 <td class="paramkey"></td>
236 <td class="paramtype">uint </td>
237 <td class="paramname"><em>src_stride_x</em>, </td>
240 <td class="paramkey"></td>
242 <td class="paramtype">uint </td>
243 <td class="paramname"><em>src_step_x</em>, </td>
246 <td class="paramkey"></td>
248 <td class="paramtype">uint </td>
249 <td class="paramname"><em>src_stride_y</em>, </td>
252 <td class="paramkey"></td>
254 <td class="paramtype">uint </td>
255 <td class="paramname"><em>src_step_y</em>, </td>
258 <td class="paramkey"></td>
260 <td class="paramtype">uint </td>
261 <td class="paramname"><em>src_stride_z</em>, </td>
264 <td class="paramkey"></td>
266 <td class="paramtype">uint </td>
267 <td class="paramname"><em>src_step_z</em>, </td>
270 <td class="paramkey"></td>
272 <td class="paramtype">uint </td>
273 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
276 <td class="paramkey"></td>
278 <td class="paramtype">__global uchar * </td>
279 <td class="paramname"><em>dst_ptr</em>, </td>
282 <td class="paramkey"></td>
284 <td class="paramtype">uint </td>
285 <td class="paramname"><em>dst_stride_x</em>, </td>
288 <td class="paramkey"></td>
290 <td class="paramtype">uint </td>
291 <td class="paramname"><em>dst_step_x</em>, </td>
294 <td class="paramkey"></td>
296 <td class="paramtype">uint </td>
297 <td class="paramname"><em>dst_stride_y</em>, </td>
300 <td class="paramkey"></td>
302 <td class="paramtype">uint </td>
303 <td class="paramname"><em>dst_step_y</em>, </td>
306 <td class="paramkey"></td>
308 <td class="paramtype">uint </td>
309 <td class="paramname"><em>dst_stride_z</em>, </td>
312 <td class="paramkey"></td>
314 <td class="paramtype">uint </td>
315 <td class="paramname"><em>dst_step_z</em>, </td>
318 <td class="paramkey"></td>
320 <td class="paramtype">uint </td>
321 <td class="paramname"><em>dst_offset_first_element_in_bytes</em>, </td>
324 <td class="paramkey"></td>
326 <td class="paramtype">__global uchar * </td>
327 <td class="paramname"><em>weights_ptr</em>, </td>
330 <td class="paramkey"></td>
332 <td class="paramtype">uint </td>
333 <td class="paramname"><em>weights_stride_x</em>, </td>
336 <td class="paramkey"></td>
338 <td class="paramtype">uint </td>
339 <td class="paramname"><em>weights_step_x</em>, </td>
342 <td class="paramkey"></td>
344 <td class="paramtype">uint </td>
345 <td class="paramname"><em>weights_stride_y</em>, </td>
348 <td class="paramkey"></td>
350 <td class="paramtype">uint </td>
351 <td class="paramname"><em>weights_step_y</em>, </td>
354 <td class="paramkey"></td>
356 <td class="paramtype">uint </td>
357 <td class="paramname"><em>weights_stride_z</em>, </td>
360 <td class="paramkey"></td>
362 <td class="paramtype">uint </td>
363 <td class="paramname"><em>weights_step_z</em>, </td>
366 <td class="paramkey"></td>
368 <td class="paramtype">uint </td>
369 <td class="paramname"><em>weights_offset_first_element_in_bytes</em>, </td>
372 <td class="paramkey"></td>
374 <td class="paramtype">__global uchar * </td>
375 <td class="paramname"><em>biases_ptr</em>, </td>
378 <td class="paramkey"></td>
380 <td class="paramtype">uint </td>
381 <td class="paramname"><em>biases_stride_x</em>, </td>
384 <td class="paramkey"></td>
386 <td class="paramtype">uint </td>
387 <td class="paramname"><em>biases_step_x</em>, </td>
390 <td class="paramkey"></td>
392 <td class="paramtype">uint </td>
393 <td class="paramname"><em>biases_offset_first_element_in_bytes</em> </td>
401 </div><div class="memdoc">
403 <p>This OpenCL kernel is optimized for Bifrost architectures and computes the depthwise convolution 3x3 when both stride_x and stride_y are equal to 1. </p>
404 <dl class="params"><dt>Parameters</dt><dd>
405 <table class="params">
406 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source image. Supported data types: F32 </td></tr>
407 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr>
408 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_x</td><td>src_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
409 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr>
410 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
411 <tr><td class="paramdir">[in]</td><td class="paramname">src_offset_first_element_in_bytes</td><td>The offset of the first element in the source image </td></tr>
412 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_z</td><td>Stride of the source tensor in Z dimension (in bytes) </td></tr>
413 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_z</td><td>src_stride_z * number of elements along Y processed per workitem(in bytes) </td></tr>
414 <tr><td class="paramdir">[in]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination tensor. Supported data types: F32 </td></tr>
415 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_x</td><td>Stride of the destination tensor in X dimension (in bytes) </td></tr>
416 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_x</td><td>dst_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
417 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_y</td><td>Stride of the destination tensor in Y dimension (in bytes) </td></tr>
418 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_y</td><td>dst_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
419 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_z</td><td>Stride of the destination tensor in Z dimension (in bytes) </td></tr>
420 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_z</td><td>dst_stride_z * number of elements along Y processed per workitem(in bytes) </td></tr>
421 <tr><td class="paramdir">[in]</td><td class="paramname">dst_offset_first_element_in_bytes</td><td>The offset of the first element in the destination tensor </td></tr>
422 <tr><td class="paramdir">[in]</td><td class="paramname">weights_ptr</td><td>Pointer to the weights tensor. Supported data types: F32 </td></tr>
423 <tr><td class="paramdir">[in]</td><td class="paramname">weights_stride_x</td><td>Stride of the weights tensor in X dimension (in bytes) </td></tr>
424 <tr><td class="paramdir">[in]</td><td class="paramname">weights_step_x</td><td>weights_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
425 <tr><td class="paramdir">[in]</td><td class="paramname">weights_stride_y</td><td>Stride of the weights tensor in Y dimension (in bytes) </td></tr>
426 <tr><td class="paramdir">[in]</td><td class="paramname">weights_step_y</td><td>weights_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
427 <tr><td class="paramdir">[in]</td><td class="paramname">weights_stride_z</td><td>Stride of the weights tensor in Z dimension (in bytes) </td></tr>
428 <tr><td class="paramdir">[in]</td><td class="paramname">weights_step_z</td><td>weights_stride_z * number of elements along Y processed per workitem(in bytes) </td></tr>
429 <tr><td class="paramdir">[in]</td><td class="paramname">weights_offset_first_element_in_bytes</td><td>The offset of the first element in the biases vector </td></tr>
430 <tr><td class="paramdir">[in]</td><td class="paramname">biases_ptr</td><td>(Optional) Pointer to the biases vector. Supported data types: F32 </td></tr>
431 <tr><td class="paramdir">[in]</td><td class="paramname">biases_stride_x</td><td>(Optional) Stride of the biases vector in X dimension (in bytes) </td></tr>
432 <tr><td class="paramdir">[in]</td><td class="paramname">biases_step_x</td><td>(Optional) biases_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
433 <tr><td class="paramdir">[in]</td><td class="paramname">biases_offset_first_element_in_bytes</td><td>(Optional) The offset of the first element in the biases vector </td></tr>
438 <p>Definition at line <a class="el" href="depthwise__convolution_8cl_source.xhtml#l00263">263</a> of file <a class="el" href="depthwise__convolution_8cl_source.xhtml">depthwise_convolution.cl</a>.</p>
440 <p>References <a class="el" href="helpers_8h_source.xhtml#l00114">CONVERT_TENSOR3D_TO_IMAGE_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00117">CONVERT_TO_TENSOR3D_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00099">CONVERT_TO_VECTOR_STRUCT_NO_STEP</a>, <a class="el" href="depthwise__convolution_8cl_source.xhtml#l00211">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>, <a class="el" href="helpers_8h_source.xhtml#l00301">offset()</a>, <a class="el" href="helpers_8h_source.xhtml#l00142">Image::ptr</a>, <a class="el" href="helpers_8h_source.xhtml#l00151">Tensor3D::ptr</a>, and <a class="el" href="helpers_8h_source.xhtml#l00290">vector_offset()</a>.</p>
441 <div class="fragment"><div class="line"><a name="l00272"></a><span class="lineno"> 272</span> {</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <a class="code" href="struct_image.xhtml">Image</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">src</a> = <a class="code" href="helpers_8h.xhtml#a541f8db866a0fa93ee67d58ea31a7d0c">CONVERT_TENSOR3D_TO_IMAGE_STRUCT</a>(src);</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  <a class="code" href="struct_image.xhtml">Image</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#adbf67dcee294e673cf796f1ed8aeb6a4">dst</a> = <a class="code" href="helpers_8h.xhtml#a541f8db866a0fa93ee67d58ea31a7d0c">CONVERT_TENSOR3D_TO_IMAGE_STRUCT</a>(dst);</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> weights = <a class="code" href="helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(weights);</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span> </div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  float2 pixels0 = 0.0f;</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  float2 pixels1 = 0.0f;</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  float2 pixels2 = 0.0f;</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  float2 pixels3 = 0.0f;</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span> </div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  __global uchar *weights_addr = (__global uchar *)weights.<a class="code" href="struct_tensor3_d.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>;</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  __global uchar *src_addr = (__global uchar *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 0);</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span> </div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  <span class="comment">// Load the weights</span></div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  float3 weights_row0 = vload3(0, (__global <span class="keywordtype">float</span> *)(weights_addr + 0 * weights_stride_y));</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  float3 weights_row1 = vload3(0, (__global <span class="keywordtype">float</span> *)(weights_addr + 1 * weights_stride_y));</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  float3 weights_row2 = vload3(0, (__global <span class="keywordtype">float</span> *)(weights_addr + 2 * weights_stride_y));</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span> </div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="comment">// Note: Since each work-item computes 4x2 elements, we need to load 4 rows from the input tensor</span></div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  float4 src00 = vload4(0, (__global <span class="keywordtype">float</span> *)(src_addr + 0 * src_stride_y)); <span class="comment">// Row0</span></div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  float4 src10 = vload4(0, (__global <span class="keywordtype">float</span> *)(src_addr + 1 * src_stride_y)); <span class="comment">// Row1</span></div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  float4 src20 = vload4(0, (__global <span class="keywordtype">float</span> *)(src_addr + 2 * src_stride_y)); <span class="comment">// Row2</span></div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  float4 src30 = vload4(0, (__global <span class="keywordtype">float</span> *)(src_addr + 3 * src_stride_y)); <span class="comment">// Row3</span></div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  float4 src40 = vload4(0, (__global <span class="keywordtype">float</span> *)(src_addr + 4 * src_stride_y)); <span class="comment">// Row3</span></div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  float4 src50 = vload4(0, (__global <span class="keywordtype">float</span> *)(src_addr + 5 * src_stride_y)); <span class="comment">// Row3</span></div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span> </div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(pixels0, src00, weights_row0);</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(pixels0, src10, weights_row1);</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(pixels0, src20, weights_row2);</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(pixels1, src10, weights_row0);</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(pixels1, src20, weights_row1);</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(pixels1, src30, weights_row2);</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(pixels2, src20, weights_row0);</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(pixels2, src30, weights_row1);</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(pixels2, src40, weights_row2);</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(pixels3, src30, weights_row0);</div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(pixels3, src40, weights_row1);</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a>(pixels3, src50, weights_row2);</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span> </div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span> <span class="preprocessor">#ifdef HAS_BIAS</span></div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  <a class="code" href="struct_vector.xhtml">Vector</a> biases = <a class="code" href="helpers_8h.xhtml#a64d779f80eeb923e0ab2313433f7b40b">CONVERT_TO_VECTOR_STRUCT_NO_STEP</a>(biases);</div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span> </div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  <span class="keywordtype">float</span> bias = *((__global <span class="keywordtype">float</span> *)(<a class="code" href="helpers_8h.xhtml#a7e4940407322d6f0ccb8b6b86b856019">vector_offset</a>(&biases, get_global_id(2))));</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span> </div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  pixels0 += (float2)bias;</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  pixels1 += (float2)bias;</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  pixels2 += (float2)bias;</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  pixels3 += (float2)bias;</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span> <span class="preprocessor">#endif </span><span class="comment">/* defined(HAS_BIAS) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span> </div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  vstore2(pixels0, 0, (__global <span class="keywordtype">float</span> *)(dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> + 0 * dst_stride_y));</div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  vstore2(pixels1, 0, (__global <span class="keywordtype">float</span> *)(dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> + 1 * dst_stride_y));</div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  vstore2(pixels2, 0, (__global <span class="keywordtype">float</span> *)(dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> + 2 * dst_stride_y));</div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  vstore2(pixels3, 0, (__global <span class="keywordtype">float</span> *)(dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> + 3 * dst_stride_y));</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</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#l00132">helpers.h:132</a></div></div>
442 <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#l00117">helpers.h:117</a></div></div>
443 <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#l00149">helpers.h:149</a></div></div>
444 <div class="ttc" id="helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00301">helpers.h:301</a></div></div>
445 <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_adbf67dcee294e673cf796f1ed8aeb6a4"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#adbf67dcee294e673cf796f1ed8aeb6a4">arm_compute::test::validation::dst</a></div><div class="ttdeci">CLTensor dst</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_convolution_8cpp_source.xhtml#l00137">Convolution.cpp:137</a></div></div>
446 <div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00140">helpers.h:140</a></div></div>
447 <div class="ttc" id="depthwise__convolution_8cl_xhtml_aa5ab4cf85fe56de3821727cfcef327d9"><div class="ttname"><a href="depthwise__convolution_8cl.xhtml#aa5ab4cf85fe56de3821727cfcef327d9">CONVOLUTION1x3_BIFROST2X1_STRIDE1</a></div><div class="ttdeci">#define CONVOLUTION1x3_BIFROST2X1_STRIDE1(acc, src0, weights_row0)</div><div class="ttdef"><b>Definition:</b> <a href="depthwise__convolution_8cl_source.xhtml#l00211">depthwise_convolution.cl:211</a></div></div>
448 <div class="ttc" id="struct_image_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">Image::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#l00142">helpers.h:142</a></div></div>
449 <div class="ttc" id="helpers_8h_xhtml_a64d779f80eeb923e0ab2313433f7b40b"><div class="ttname"><a href="helpers_8h.xhtml#a64d779f80eeb923e0ab2313433f7b40b">CONVERT_TO_VECTOR_STRUCT_NO_STEP</a></div><div class="ttdeci">#define CONVERT_TO_VECTOR_STRUCT_NO_STEP(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00099">helpers.h:99</a></div></div>
450 <div class="ttc" id="helpers_8h_xhtml_a7e4940407322d6f0ccb8b6b86b856019"><div class="ttname"><a href="helpers_8h.xhtml#a7e4940407322d6f0ccb8b6b86b856019">vector_offset</a></div><div class="ttdeci">__global const uchar * vector_offset(const Vector *vec, int x)</div><div class="ttdoc">Get the pointer position of a Vector. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00290">helpers.h:290</a></div></div>
451 <div class="ttc" id="helpers_8h_xhtml_a541f8db866a0fa93ee67d58ea31a7d0c"><div class="ttname"><a href="helpers_8h.xhtml#a541f8db866a0fa93ee67d58ea31a7d0c">CONVERT_TENSOR3D_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TENSOR3D_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00114">helpers.h:114</a></div></div>
452 <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#l00151">helpers.h:151</a></div></div>
453 <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a6743f0a130e8311e6f5b1a23df102472"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">arm_compute::test::validation::src</a></div><div class="ttdeci">convolution configure & src</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_convolution_8cpp_source.xhtml#l00147">Convolution.cpp:147</a></div></div>
454 </div><!-- fragment -->
457 <a class="anchor" id="a328ab548c536089e8238fb33de617bec"></a>
458 <div class="memitem">
459 <div class="memproto">
460 <table class="memname">
462 <td class="memname">__kernel void depthwise_convolution_3x3_stridex2_stridey2_bifrost </td>
464 <td class="paramtype">__global uchar * </td>
465 <td class="paramname"><em>src_ptr</em>, </td>
468 <td class="paramkey"></td>
470 <td class="paramtype">uint </td>
471 <td class="paramname"><em>src_stride_x</em>, </td>
474 <td class="paramkey"></td>
476 <td class="paramtype">uint </td>
477 <td class="paramname"><em>src_step_x</em>, </td>
480 <td class="paramkey"></td>
482 <td class="paramtype">uint </td>
483 <td class="paramname"><em>src_stride_y</em>, </td>
486 <td class="paramkey"></td>
488 <td class="paramtype">uint </td>
489 <td class="paramname"><em>src_step_y</em>, </td>
492 <td class="paramkey"></td>
494 <td class="paramtype">uint </td>
495 <td class="paramname"><em>src_stride_z</em>, </td>
498 <td class="paramkey"></td>
500 <td class="paramtype">uint </td>
501 <td class="paramname"><em>src_step_z</em>, </td>
504 <td class="paramkey"></td>
506 <td class="paramtype">uint </td>
507 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
510 <td class="paramkey"></td>
512 <td class="paramtype">__global uchar * </td>
513 <td class="paramname"><em>dst_ptr</em>, </td>
516 <td class="paramkey"></td>
518 <td class="paramtype">uint </td>
519 <td class="paramname"><em>dst_stride_x</em>, </td>
522 <td class="paramkey"></td>
524 <td class="paramtype">uint </td>
525 <td class="paramname"><em>dst_step_x</em>, </td>
528 <td class="paramkey"></td>
530 <td class="paramtype">uint </td>
531 <td class="paramname"><em>dst_stride_y</em>, </td>
534 <td class="paramkey"></td>
536 <td class="paramtype">uint </td>
537 <td class="paramname"><em>dst_step_y</em>, </td>
540 <td class="paramkey"></td>
542 <td class="paramtype">uint </td>
543 <td class="paramname"><em>dst_stride_z</em>, </td>
546 <td class="paramkey"></td>
548 <td class="paramtype">uint </td>
549 <td class="paramname"><em>dst_step_z</em>, </td>
552 <td class="paramkey"></td>
554 <td class="paramtype">uint </td>
555 <td class="paramname"><em>dst_offset_first_element_in_bytes</em>, </td>
558 <td class="paramkey"></td>
560 <td class="paramtype">__global uchar * </td>
561 <td class="paramname"><em>weights_ptr</em>, </td>
564 <td class="paramkey"></td>
566 <td class="paramtype">uint </td>
567 <td class="paramname"><em>weights_stride_x</em>, </td>
570 <td class="paramkey"></td>
572 <td class="paramtype">uint </td>
573 <td class="paramname"><em>weights_step_x</em>, </td>
576 <td class="paramkey"></td>
578 <td class="paramtype">uint </td>
579 <td class="paramname"><em>weights_stride_y</em>, </td>
582 <td class="paramkey"></td>
584 <td class="paramtype">uint </td>
585 <td class="paramname"><em>weights_step_y</em>, </td>
588 <td class="paramkey"></td>
590 <td class="paramtype">uint </td>
591 <td class="paramname"><em>weights_stride_z</em>, </td>
594 <td class="paramkey"></td>
596 <td class="paramtype">uint </td>
597 <td class="paramname"><em>weights_step_z</em>, </td>
600 <td class="paramkey"></td>
602 <td class="paramtype">uint </td>
603 <td class="paramname"><em>weights_offset_first_element_in_bytes</em>, </td>
606 <td class="paramkey"></td>
608 <td class="paramtype">__global uchar * </td>
609 <td class="paramname"><em>biases_ptr</em>, </td>
612 <td class="paramkey"></td>
614 <td class="paramtype">uint </td>
615 <td class="paramname"><em>biases_stride_x</em>, </td>
618 <td class="paramkey"></td>
620 <td class="paramtype">uint </td>
621 <td class="paramname"><em>biases_step_x</em>, </td>
624 <td class="paramkey"></td>
626 <td class="paramtype">uint </td>
627 <td class="paramname"><em>biases_offset_first_element_in_bytes</em> </td>
635 </div><div class="memdoc">
637 <p>This OpenCL kernel is optimized for Bifrost architectures and computes the depthwise convolution 3x3 when both stride_x and stride_y are equal to 2. </p>
638 <dl class="params"><dt>Parameters</dt><dd>
639 <table class="params">
640 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source image. Supported data types: F32 </td></tr>
641 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr>
642 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_x</td><td>src_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
643 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr>
644 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_y</td><td>src_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
645 <tr><td class="paramdir">[in]</td><td class="paramname">src_offset_first_element_in_bytes</td><td>The offset of the first element in the source image </td></tr>
646 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_z</td><td>Stride of the source tensor in Z dimension (in bytes) </td></tr>
647 <tr><td class="paramdir">[in]</td><td class="paramname">src_step_z</td><td>src_stride_z * number of elements along Y processed per workitem(in bytes) </td></tr>
648 <tr><td class="paramdir">[in]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination tensor. Supported data types: F32 </td></tr>
649 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_x</td><td>Stride of the destination tensor in X dimension (in bytes) </td></tr>
650 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_x</td><td>dst_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
651 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_y</td><td>Stride of the destination tensor in Y dimension (in bytes) </td></tr>
652 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_y</td><td>dst_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
653 <tr><td class="paramdir">[in]</td><td class="paramname">dst_stride_z</td><td>Stride of the destination tensor in Z dimension (in bytes) </td></tr>
654 <tr><td class="paramdir">[in]</td><td class="paramname">dst_step_z</td><td>dst_stride_z * number of elements along Y processed per workitem(in bytes) </td></tr>
655 <tr><td class="paramdir">[in]</td><td class="paramname">dst_offset_first_element_in_bytes</td><td>The offset of the first element in the destination tensor </td></tr>
656 <tr><td class="paramdir">[in]</td><td class="paramname">weights_ptr</td><td>Pointer to the weights tensor. Supported data types: F32 </td></tr>
657 <tr><td class="paramdir">[in]</td><td class="paramname">weights_stride_x</td><td>Stride of the weights tensor in X dimension (in bytes) </td></tr>
658 <tr><td class="paramdir">[in]</td><td class="paramname">weights_step_x</td><td>weights_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
659 <tr><td class="paramdir">[in]</td><td class="paramname">weights_stride_y</td><td>Stride of the weights tensor in Y dimension (in bytes) </td></tr>
660 <tr><td class="paramdir">[in]</td><td class="paramname">weights_step_y</td><td>weights_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
661 <tr><td class="paramdir">[in]</td><td class="paramname">weights_stride_z</td><td>Stride of the weights tensor in Z dimension (in bytes) </td></tr>
662 <tr><td class="paramdir">[in]</td><td class="paramname">weights_step_z</td><td>weights_stride_z * number of elements along Y processed per workitem(in bytes) </td></tr>
663 <tr><td class="paramdir">[in]</td><td class="paramname">weights_offset_first_element_in_bytes</td><td>The offset of the first element in the biases vector </td></tr>
664 <tr><td class="paramdir">[in]</td><td class="paramname">biases_ptr</td><td>(Optional) Pointer to the biases vector. Supported data types: F32 </td></tr>
665 <tr><td class="paramdir">[in]</td><td class="paramname">biases_stride_x</td><td>(Optional) Stride of the biases vector in X dimension (in bytes) </td></tr>
666 <tr><td class="paramdir">[in]</td><td class="paramname">biases_step_x</td><td>(Optional) biases_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
667 <tr><td class="paramdir">[in]</td><td class="paramname">biases_offset_first_element_in_bytes</td><td>(Optional) The offset of the first element in the biases vector </td></tr>
672 <p>Definition at line <a class="el" href="depthwise__convolution_8cl_source.xhtml#l00360">360</a> of file <a class="el" href="depthwise__convolution_8cl_source.xhtml">depthwise_convolution.cl</a>.</p>
674 <p>References <a class="el" href="fixed__point_8h_source.xhtml#l00098">CONVERT</a>, <a class="el" href="helpers_8h_source.xhtml#l00114">CONVERT_TENSOR3D_TO_IMAGE_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00117">CONVERT_TO_TENSOR3D_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00096">CONVERT_TO_VECTOR_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00099">CONVERT_TO_VECTOR_STRUCT_NO_STEP</a>, <a class="el" href="depthwise__convolution_8cl_source.xhtml#l00221">CONVOLUTION1x3_BIFROST2X1_STRIDE2</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, <a class="el" href="helpers_8h_source.xhtml#l00066">IMAGE_DECLARATION</a>, <a class="el" href="helpers_8h_source.xhtml#l00301">offset()</a>, <a class="el" href="helpers_8h_source.xhtml#l00134">Vector::ptr</a>, <a class="el" href="helpers_8h_source.xhtml#l00142">Image::ptr</a>, <a class="el" href="helpers_8h_source.xhtml#l00151">Tensor3D::ptr</a>, <a class="el" href="helpers_8h_source.xhtml#l00074">TENSOR3D_DECLARATION</a>, <a class="el" href="helpers_8h_source.xhtml#l00060">VECTOR_DECLARATION</a>, and <a class="el" href="helpers_8h_source.xhtml#l00290">vector_offset()</a>.</p>
675 <div class="fragment"><div class="line"><a name="l00369"></a><span class="lineno"> 369</span> {</div><div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  <a class="code" href="struct_image.xhtml">Image</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">src</a> = <a class="code" href="helpers_8h.xhtml#a541f8db866a0fa93ee67d58ea31a7d0c">CONVERT_TENSOR3D_TO_IMAGE_STRUCT</a>(src);</div><div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  <a class="code" href="struct_image.xhtml">Image</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#adbf67dcee294e673cf796f1ed8aeb6a4">dst</a> = <a class="code" href="helpers_8h.xhtml#a541f8db866a0fa93ee67d58ea31a7d0c">CONVERT_TENSOR3D_TO_IMAGE_STRUCT</a>(dst);</div><div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> weights = <a class="code" href="helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(weights);</div><div class="line"><a name="l00373"></a><span class="lineno"> 373</span> </div><div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  float2 pixels0 = 0.0f;</div><div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  float2 pixels1 = 0.0f;</div><div class="line"><a name="l00376"></a><span class="lineno"> 376</span> </div><div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  __global uchar *weights_addr = (__global uchar *)weights.<a class="code" href="struct_tensor3_d.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>;</div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  __global uchar *src_addr = (__global uchar *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, 0, 0);</div><div class="line"><a name="l00379"></a><span class="lineno"> 379</span> </div><div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  <span class="comment">// Load the weights</span></div><div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  float3 weights_row0 = vload3(0, (__global <span class="keywordtype">float</span> *)(weights_addr + 0 * weights_stride_y));</div><div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  float3 weights_row1 = vload3(0, (__global <span class="keywordtype">float</span> *)(weights_addr + 1 * weights_stride_y));</div><div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  float3 weights_row2 = vload3(0, (__global <span class="keywordtype">float</span> *)(weights_addr + 2 * weights_stride_y));</div><div class="line"><a name="l00384"></a><span class="lineno"> 384</span> </div><div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  <span class="comment">// Note: Since each work-item computes 4x2 elements, we need to load 5 rows from the input tensor</span></div><div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  float4 src00 = vload4(0, (__global <span class="keywordtype">float</span> *)(src_addr + 0 * src_stride_y)); <span class="comment">// Row0</span></div><div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  float2 src01 = vload2(2, (__global <span class="keywordtype">float</span> *)(src_addr + 0 * src_stride_y)); <span class="comment">// Row0</span></div><div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  float4 src10 = vload4(0, (__global <span class="keywordtype">float</span> *)(src_addr + 1 * src_stride_y)); <span class="comment">// Row1</span></div><div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  float2 src11 = vload2(2, (__global <span class="keywordtype">float</span> *)(src_addr + 1 * src_stride_y)); <span class="comment">// Row1</span></div><div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  float4 src20 = vload4(0, (__global <span class="keywordtype">float</span> *)(src_addr + 2 * src_stride_y)); <span class="comment">// Row2</span></div><div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  float2 src21 = vload2(2, (__global <span class="keywordtype">float</span> *)(src_addr + 2 * src_stride_y)); <span class="comment">// Row2</span></div><div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  float4 src30 = vload4(0, (__global <span class="keywordtype">float</span> *)(src_addr + 3 * src_stride_y)); <span class="comment">// Row3</span></div><div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  float2 src31 = vload2(2, (__global <span class="keywordtype">float</span> *)(src_addr + 3 * src_stride_y)); <span class="comment">// Row3</span></div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  float4 src40 = vload4(0, (__global <span class="keywordtype">float</span> *)(src_addr + 4 * src_stride_y)); <span class="comment">// Row4</span></div><div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  float2 src41 = vload2(2, (__global <span class="keywordtype">float</span> *)(src_addr + 4 * src_stride_y)); <span class="comment">// Row4</span></div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span> </div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#a31cbdd6b28ee6331839432f69d87fdcb">CONVOLUTION1x3_BIFROST2X1_STRIDE2</a>(pixels0, src00, src01, weights_row0);</div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#a31cbdd6b28ee6331839432f69d87fdcb">CONVOLUTION1x3_BIFROST2X1_STRIDE2</a>(pixels0, src10, src11, weights_row1);</div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#a31cbdd6b28ee6331839432f69d87fdcb">CONVOLUTION1x3_BIFROST2X1_STRIDE2</a>(pixels0, src20, src21, weights_row2);</div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#a31cbdd6b28ee6331839432f69d87fdcb">CONVOLUTION1x3_BIFROST2X1_STRIDE2</a>(pixels1, src20, src21, weights_row0);</div><div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#a31cbdd6b28ee6331839432f69d87fdcb">CONVOLUTION1x3_BIFROST2X1_STRIDE2</a>(pixels1, src30, src31, weights_row1);</div><div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  <a class="code" href="depthwise__convolution_8cl.xhtml#a31cbdd6b28ee6331839432f69d87fdcb">CONVOLUTION1x3_BIFROST2X1_STRIDE2</a>(pixels1, src40, src41, weights_row2);</div><div class="line"><a name="l00403"></a><span class="lineno"> 403</span> </div><div class="line"><a name="l00404"></a><span class="lineno"> 404</span> <span class="preprocessor">#ifdef HAS_BIAS</span></div><div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  <a class="code" href="struct_vector.xhtml">Vector</a> biases = <a class="code" href="helpers_8h.xhtml#a64d779f80eeb923e0ab2313433f7b40b">CONVERT_TO_VECTOR_STRUCT_NO_STEP</a>(biases);</div><div class="line"><a name="l00406"></a><span class="lineno"> 406</span> </div><div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  <span class="keywordtype">float</span> bias = *((__global <span class="keywordtype">float</span> *)(<a class="code" href="helpers_8h.xhtml#a7e4940407322d6f0ccb8b6b86b856019">vector_offset</a>(&biases, get_global_id(2))));</div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span> </div><div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  pixels0 += (float2)bias;</div><div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  pixels1 += (float2)bias;</div><div class="line"><a name="l00411"></a><span class="lineno"> 411</span> <span class="preprocessor">#endif </span><span class="comment">/* defined(HAS_BIAS) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span> </div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  vstore2(pixels0, 0, (__global <span class="keywordtype">float</span> *)(dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> + 0 * dst_stride_y));</div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  vstore2(pixels1, 0, (__global <span class="keywordtype">float</span> *)(dst.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a> + 1 * dst_stride_y));</div><div class="line"><a name="l00415"></a><span class="lineno"> 415</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#l00132">helpers.h:132</a></div></div>
676 <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#l00117">helpers.h:117</a></div></div>
677 <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#l00149">helpers.h:149</a></div></div>
678 <div class="ttc" id="depthwise__convolution_8cl_xhtml_a31cbdd6b28ee6331839432f69d87fdcb"><div class="ttname"><a href="depthwise__convolution_8cl.xhtml#a31cbdd6b28ee6331839432f69d87fdcb">CONVOLUTION1x3_BIFROST2X1_STRIDE2</a></div><div class="ttdeci">#define CONVOLUTION1x3_BIFROST2X1_STRIDE2(acc, src0, src1, weights_row0)</div><div class="ttdef"><b>Definition:</b> <a href="depthwise__convolution_8cl_source.xhtml#l00221">depthwise_convolution.cl:221</a></div></div>
679 <div class="ttc" id="helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00301">helpers.h:301</a></div></div>
680 <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_adbf67dcee294e673cf796f1ed8aeb6a4"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#adbf67dcee294e673cf796f1ed8aeb6a4">arm_compute::test::validation::dst</a></div><div class="ttdeci">CLTensor dst</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_convolution_8cpp_source.xhtml#l00137">Convolution.cpp:137</a></div></div>
681 <div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00140">helpers.h:140</a></div></div>
682 <div class="ttc" id="struct_image_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">Image::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#l00142">helpers.h:142</a></div></div>
683 <div class="ttc" id="helpers_8h_xhtml_a64d779f80eeb923e0ab2313433f7b40b"><div class="ttname"><a href="helpers_8h.xhtml#a64d779f80eeb923e0ab2313433f7b40b">CONVERT_TO_VECTOR_STRUCT_NO_STEP</a></div><div class="ttdeci">#define CONVERT_TO_VECTOR_STRUCT_NO_STEP(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00099">helpers.h:99</a></div></div>
684 <div class="ttc" id="helpers_8h_xhtml_a7e4940407322d6f0ccb8b6b86b856019"><div class="ttname"><a href="helpers_8h.xhtml#a7e4940407322d6f0ccb8b6b86b856019">vector_offset</a></div><div class="ttdeci">__global const uchar * vector_offset(const Vector *vec, int x)</div><div class="ttdoc">Get the pointer position of a Vector. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00290">helpers.h:290</a></div></div>
685 <div class="ttc" id="helpers_8h_xhtml_a541f8db866a0fa93ee67d58ea31a7d0c"><div class="ttname"><a href="helpers_8h.xhtml#a541f8db866a0fa93ee67d58ea31a7d0c">CONVERT_TENSOR3D_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TENSOR3D_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00114">helpers.h:114</a></div></div>
686 <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#l00151">helpers.h:151</a></div></div>
687 <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a6743f0a130e8311e6f5b1a23df102472"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">arm_compute::test::validation::src</a></div><div class="ttdeci">convolution configure & src</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_convolution_8cpp_source.xhtml#l00147">Convolution.cpp:147</a></div></div>
688 </div><!-- fragment -->
691 </div><!-- contents -->
692 </div><!-- doc-content -->
693 <!-- start footer part -->
694 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
696 <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="depthwise__convolution_8cl.xhtml">depthwise_convolution.cl</a></li>
697 <li class="footer">Generated on Thu Feb 22 2018 15:45:22 for Compute Library by
698 <a href="http://www.doxygen.org/index.html">
699 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>