blob: a4785105d8c4958445f16aec78dab592bcdc608a [file] [log] [blame]
Anthony Barbier871448e2017-03-24 14:54:29 +00001<!-- 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"/>
Anthony Barbier8140e1e2017-12-14 23:48:46 +00007<meta name="generator" content="Doxygen 1.8.11"/>
Anthony Barbier871448e2017-03-24 14:54:29 +00008<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
Anthony Barbierdbdab852017-06-23 15:42:00 +01009<title>Compute Library: src/core/CL/cl_kernels/convolution_layer.cl File Reference</title>
Anthony Barbier871448e2017-03-24 14:54:29 +000010<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>
Anthony Barbier8140e1e2017-12-14 23:48:46 +000015<script type="text/javascript" src="navtreedata.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000016<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"/>
Anthony Barbier8140e1e2017-12-14 23:48:46 +000022<script type="text/javascript" src="search/searchdata.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000023<script type="text/javascript" src="search/search.js"></script>
24<script type="text/javascript">
Anthony Barbier8140e1e2017-12-14 23:48:46 +000025 $(document).ready(function() { init_search(); });
Anthony Barbier871448e2017-03-24 14:54:29 +000026</script>
27<script type="text/x-mathjax-config">
28 MathJax.Hub.Config({
29 extensions: ["tex2jax.js"],
30 jax: ["input/TeX","output/HTML-CSS"],
31});
Anthony Barbier8140e1e2017-12-14 23:48:46 +000032</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000033<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 Barbierdbdab852017-06-23 15:42:00 +010042 <div id="projectname">Compute Library
Anthony Barbier8140e1e2017-12-14 23:48:46 +000043 &#160;<span id="projectnumber">17.12</span>
Anthony Barbier871448e2017-03-24 14:54:29 +000044 </div>
45 </td>
46 </tr>
47 </tbody>
48</table>
49</div>
50<!-- end header part -->
Anthony Barbier8140e1e2017-12-14 23:48:46 +000051<!-- Generated by Doxygen 1.8.11 -->
Anthony Barbier871448e2017-03-24 14:54:29 +000052<script type="text/javascript">
53var 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&#160;Page</span></a></li>
Anthony Barbierdbdab852017-06-23 15:42:00 +010058 <li><a href="pages.xhtml"><span>Related&#160;Pages</span></a></li>
Anthony Barbier871448e2017-03-24 14:54:29 +000059 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
60 <li><a href="annotated.xhtml"><span>Data&#160;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&#160;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('convolution__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)">
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000106</div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000107
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">convolution_layer.cl File Reference</div> </div>
120</div><!--header-->
121<div class="contents">
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000122<div class="textblock"><code>#include &quot;<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>&quot;</code><br />
Anthony Barbier871448e2017-03-24 14:54:29 +0000123</div>
124<p><a href="convolution__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>
127Functions</h2></td></tr>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100128<tr class="memitem:ab6358b28d1e7bc946950075d94412013"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="convolution__layer_8cl.xhtml#ab6358b28d1e7bc946950075d94412013">reshape_to_columns</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_offset_first_element_in_bytes, __global uchar *bias_ptr, uint bias_stride_x, uint bias_step_x, uint bias_offset_first_element_in_bytes, uint width, uint height, uint depth, uint total_filters)</td></tr>
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000129<tr class="memdesc:ab6358b28d1e7bc946950075d94412013"><td class="mdescLeft">&#160;</td><td class="mdescRight">This kernel reshapes the tensor's low three dimensions to single column. <a href="#ab6358b28d1e7bc946950075d94412013">More...</a><br /></td></tr>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100130<tr class="separator:ab6358b28d1e7bc946950075d94412013"><td class="memSeparator" colspan="2">&#160;</td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000131<tr class="memitem:a6f31f2c8d606e1b57d9bdfacd416024c"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="convolution__layer_8cl.xhtml#a6f31f2c8d606e1b57d9bdfacd416024c">im2col_reduced</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_offset_first_element_in_bytes, uint width, uint height)</td></tr>
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000132<tr class="memdesc:a6f31f2c8d606e1b57d9bdfacd416024c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This kernel reshapes the tensor's low three dimensions to single row for GEMM operation. <a href="#a6f31f2c8d606e1b57d9bdfacd416024c">More...</a><br /></td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000133<tr class="separator:a6f31f2c8d606e1b57d9bdfacd416024c"><td class="memSeparator" colspan="2">&#160;</td></tr>
134</table>
135<h2 class="groupheader">Function Documentation</h2>
Anthony Barbier871448e2017-03-24 14:54:29 +0000136<a class="anchor" id="a6f31f2c8d606e1b57d9bdfacd416024c"></a>
137<div class="memitem">
138<div class="memproto">
139 <table class="memname">
140 <tr>
141 <td class="memname">__kernel void im2col_reduced </td>
142 <td>(</td>
143 <td class="paramtype">__global uchar *&#160;</td>
144 <td class="paramname"><em>src_ptr</em>, </td>
145 </tr>
146 <tr>
147 <td class="paramkey"></td>
148 <td></td>
149 <td class="paramtype">uint&#160;</td>
150 <td class="paramname"><em>src_stride_x</em>, </td>
151 </tr>
152 <tr>
153 <td class="paramkey"></td>
154 <td></td>
155 <td class="paramtype">uint&#160;</td>
156 <td class="paramname"><em>src_step_x</em>, </td>
157 </tr>
158 <tr>
159 <td class="paramkey"></td>
160 <td></td>
161 <td class="paramtype">uint&#160;</td>
162 <td class="paramname"><em>src_stride_y</em>, </td>
163 </tr>
164 <tr>
165 <td class="paramkey"></td>
166 <td></td>
167 <td class="paramtype">uint&#160;</td>
168 <td class="paramname"><em>src_step_y</em>, </td>
169 </tr>
170 <tr>
171 <td class="paramkey"></td>
172 <td></td>
173 <td class="paramtype">uint&#160;</td>
174 <td class="paramname"><em>src_stride_z</em>, </td>
175 </tr>
176 <tr>
177 <td class="paramkey"></td>
178 <td></td>
179 <td class="paramtype">uint&#160;</td>
180 <td class="paramname"><em>src_step_z</em>, </td>
181 </tr>
182 <tr>
183 <td class="paramkey"></td>
184 <td></td>
185 <td class="paramtype">uint&#160;</td>
186 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
187 </tr>
188 <tr>
189 <td class="paramkey"></td>
190 <td></td>
191 <td class="paramtype">__global uchar *&#160;</td>
192 <td class="paramname"><em>dst_ptr</em>, </td>
193 </tr>
194 <tr>
195 <td class="paramkey"></td>
196 <td></td>
197 <td class="paramtype">uint&#160;</td>
198 <td class="paramname"><em>dst_stride_x</em>, </td>
199 </tr>
200 <tr>
201 <td class="paramkey"></td>
202 <td></td>
203 <td class="paramtype">uint&#160;</td>
204 <td class="paramname"><em>dst_step_x</em>, </td>
205 </tr>
206 <tr>
207 <td class="paramkey"></td>
208 <td></td>
209 <td class="paramtype">uint&#160;</td>
210 <td class="paramname"><em>dst_offset_first_element_in_bytes</em>, </td>
211 </tr>
212 <tr>
213 <td class="paramkey"></td>
214 <td></td>
215 <td class="paramtype">uint&#160;</td>
216 <td class="paramname"><em>width</em>, </td>
217 </tr>
218 <tr>
219 <td class="paramkey"></td>
220 <td></td>
221 <td class="paramtype">uint&#160;</td>
222 <td class="paramname"><em>height</em>&#160;</td>
223 </tr>
224 <tr>
225 <td></td>
226 <td>)</td>
227 <td></td><td></td>
228 </tr>
229 </table>
230</div><div class="memdoc">
231
232<p>This kernel reshapes the tensor's low three dimensions to single row for GEMM operation. </p>
233<dl class="section note"><dt>Note</dt><dd>Datatype should be given as a preprocessor argument using -DDATA_TYPE=type. e.g. -DDATA_TYPE=float </dd>
234<dd>
235In case biases will be added in late stage, -DHAS_BIAS has to be passed to append the final matrix with 1 in each row.</dd></dl>
236<dl class="params"><dt>Parameters</dt><dd>
237 <table class="params">
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000238 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source tensor. Supported data types: QS8/QASYMM8/QS16/F16/F32 </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000239 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_x</td><td>Stride of the source tensor in X dimension (in bytes) </td></tr>
240 <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>
241 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_y</td><td>Stride of the source tensor in Y dimension (in bytes) </td></tr>
242 <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>
243 <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>
244 <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>
245 <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 tensor </td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100246 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination tensor. Same as <code>src_ptr</code> </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000247 <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>
248 <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>
249 <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>
250 <tr><td class="paramdir">[in]</td><td class="paramname">width</td><td>The width of the input tensor </td></tr>
251 <tr><td class="paramdir">[in]</td><td class="paramname">height</td><td>The height of the input tensor </td></tr>
252 </table>
253 </dd>
254</dl>
255
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000256<p>Definition at line <a class="el" href="convolution__layer_8cl_source.xhtml#l00306">306</a> of file <a class="el" href="convolution__layer_8cl_source.xhtml">convolution_layer.cl</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000257
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000258<p>References <a class="el" href="helpers_8h_source.xhtml#l00117">CONVERT_TO_TENSOR3D_STRUCT</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, <a class="el" href="validation_2_n_e_o_n_2_g_e_m_m_8cpp_source.xhtml#l00118">arm_compute::test::validation::dst</a>, <a class="el" href="helpers_8h_source.xhtml#l00066">IMAGE_DECLARATION</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="fixed__point_8h_source.xhtml#l00093">VEC_DATA_TYPE</a>, <a class="el" href="softmax__layer_8cl_source.xhtml#l00079">VECTOR_SIZE</a>, <a class="el" href="helpers_8h_source.xhtml#l00040">VLOAD</a>, and <a class="el" href="helpers_8h_source.xhtml#l00043">VSTORE</a>.</p>
259<div class="fragment"><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160;{</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> src = <a class="code" href="helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(src);</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160;</div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; <span class="keyword">const</span> uint image_size = width * height;</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160;</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; __global uchar *tmp_out_ptr = dst_ptr + dst_offset_first_element_in_bytes + (get_global_id(0) + get_global_id(1) * width + get_global_id(2) * image_size) * dst_stride_x;</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160;</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)tmp_out_ptr) = *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)src.ptr);</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160;</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160;<span class="preprocessor">#ifdef HAS_BIAS</span></div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; <span class="comment">// If it is the last thread in the 3 dimensional workgroup</span></div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; <span class="keywordflow">if</span>(get_global_id(0) == (get_global_size(0) - 1) &amp;&amp; get_global_id(1) == (get_global_size(1) - 1) &amp;&amp; get_global_id(2) == (get_global_size(2) - 1))</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; {</div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; tmp_out_ptr += dst_stride_x;</div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160;<span class="preprocessor">#ifdef FIXED_POINT_POSITION</span></div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)tmp_out_ptr) = (<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>)(1 &lt;&lt; FIXED_POINT_POSITION);</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;<span class="preprocessor">#else // FIXED_POINT_POSITION</span></div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)tmp_out_ptr) = (<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>)1;</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160;<span class="preprocessor">#endif // FIXED_POINT_POSITION</span></div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; }</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160;<span class="preprocessor">#endif // HAS_BIAS</span></div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160;}</div><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>
Anthony Barbier871448e2017-03-24 14:54:29 +0000260<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 Barbier8140e1e2017-12-14 23:48:46 +0000261<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>
Anthony Barbier871448e2017-03-24 14:54:29 +0000262</div><!-- fragment -->
263</div>
264</div>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100265<a class="anchor" id="ab6358b28d1e7bc946950075d94412013"></a>
Anthony Barbier871448e2017-03-24 14:54:29 +0000266<div class="memitem">
267<div class="memproto">
268 <table class="memname">
269 <tr>
270 <td class="memname">__kernel void reshape_to_columns </td>
271 <td>(</td>
272 <td class="paramtype">__global uchar *&#160;</td>
273 <td class="paramname"><em>src_ptr</em>, </td>
274 </tr>
275 <tr>
276 <td class="paramkey"></td>
277 <td></td>
278 <td class="paramtype">uint&#160;</td>
279 <td class="paramname"><em>src_stride_x</em>, </td>
280 </tr>
281 <tr>
282 <td class="paramkey"></td>
283 <td></td>
284 <td class="paramtype">uint&#160;</td>
285 <td class="paramname"><em>src_step_x</em>, </td>
286 </tr>
287 <tr>
288 <td class="paramkey"></td>
289 <td></td>
290 <td class="paramtype">uint&#160;</td>
291 <td class="paramname"><em>src_stride_y</em>, </td>
292 </tr>
293 <tr>
294 <td class="paramkey"></td>
295 <td></td>
296 <td class="paramtype">uint&#160;</td>
297 <td class="paramname"><em>src_step_y</em>, </td>
298 </tr>
299 <tr>
300 <td class="paramkey"></td>
301 <td></td>
302 <td class="paramtype">uint&#160;</td>
303 <td class="paramname"><em>src_stride_z</em>, </td>
304 </tr>
305 <tr>
306 <td class="paramkey"></td>
307 <td></td>
308 <td class="paramtype">uint&#160;</td>
309 <td class="paramname"><em>src_step_z</em>, </td>
310 </tr>
311 <tr>
312 <td class="paramkey"></td>
313 <td></td>
314 <td class="paramtype">uint&#160;</td>
315 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
316 </tr>
317 <tr>
318 <td class="paramkey"></td>
319 <td></td>
320 <td class="paramtype">__global uchar *&#160;</td>
321 <td class="paramname"><em>dst_ptr</em>, </td>
322 </tr>
323 <tr>
324 <td class="paramkey"></td>
325 <td></td>
326 <td class="paramtype">uint&#160;</td>
327 <td class="paramname"><em>dst_stride_x</em>, </td>
328 </tr>
329 <tr>
330 <td class="paramkey"></td>
331 <td></td>
332 <td class="paramtype">uint&#160;</td>
333 <td class="paramname"><em>dst_step_x</em>, </td>
334 </tr>
335 <tr>
336 <td class="paramkey"></td>
337 <td></td>
338 <td class="paramtype">uint&#160;</td>
339 <td class="paramname"><em>dst_stride_y</em>, </td>
340 </tr>
341 <tr>
342 <td class="paramkey"></td>
343 <td></td>
344 <td class="paramtype">uint&#160;</td>
345 <td class="paramname"><em>dst_step_y</em>, </td>
346 </tr>
347 <tr>
348 <td class="paramkey"></td>
349 <td></td>
350 <td class="paramtype">uint&#160;</td>
351 <td class="paramname"><em>dst_offset_first_element_in_bytes</em>, </td>
352 </tr>
353 <tr>
354 <td class="paramkey"></td>
355 <td></td>
356 <td class="paramtype">__global uchar *&#160;</td>
357 <td class="paramname"><em>bias_ptr</em>, </td>
358 </tr>
359 <tr>
360 <td class="paramkey"></td>
361 <td></td>
362 <td class="paramtype">uint&#160;</td>
363 <td class="paramname"><em>bias_stride_x</em>, </td>
364 </tr>
365 <tr>
366 <td class="paramkey"></td>
367 <td></td>
368 <td class="paramtype">uint&#160;</td>
369 <td class="paramname"><em>bias_step_x</em>, </td>
370 </tr>
371 <tr>
372 <td class="paramkey"></td>
373 <td></td>
374 <td class="paramtype">uint&#160;</td>
Anthony Barbier871448e2017-03-24 14:54:29 +0000375 <td class="paramname"><em>bias_offset_first_element_in_bytes</em>, </td>
376 </tr>
377 <tr>
378 <td class="paramkey"></td>
379 <td></td>
380 <td class="paramtype">uint&#160;</td>
381 <td class="paramname"><em>width</em>, </td>
382 </tr>
383 <tr>
384 <td class="paramkey"></td>
385 <td></td>
386 <td class="paramtype">uint&#160;</td>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100387 <td class="paramname"><em>height</em>, </td>
388 </tr>
389 <tr>
390 <td class="paramkey"></td>
391 <td></td>
392 <td class="paramtype">uint&#160;</td>
393 <td class="paramname"><em>depth</em>, </td>
394 </tr>
395 <tr>
396 <td class="paramkey"></td>
397 <td></td>
398 <td class="paramtype">uint&#160;</td>
399 <td class="paramname"><em>total_filters</em>&#160;</td>
Anthony Barbier871448e2017-03-24 14:54:29 +0000400 </tr>
401 <tr>
402 <td></td>
403 <td>)</td>
404 <td></td><td></td>
405 </tr>
406 </table>
407</div><div class="memdoc">
408
409<p>This kernel reshapes the tensor's low three dimensions to single column. </p>
410<dl class="section note"><dt>Note</dt><dd>Datatype should be given as a preprocessor argument using -DDATA_TYPE=type. e.g. -DDATA_TYPE=short</dd></dl>
411<dl class="params"><dt>Parameters</dt><dd>
412 <table class="params">
Kaizen8938bd32017-09-28 14:38:23 +0100413 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source tensor. Supported data types: F16/F32 </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000414 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_x</td><td>Stride of the source tensor in X dimension (in bytes) </td></tr>
415 <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>
416 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_y</td><td>Stride of the source tensor in Y dimension (in bytes) </td></tr>
417 <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>
418 <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>
419 <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>
420 <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 tensor </td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100421 <tr><td class="paramdir">[out]</td><td class="paramname">dst_ptr</td><td>Pointer to the destination tensor. Same as <code>src_ptr</code> </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000422 <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>
423 <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>
424 <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>
425 <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>
426 <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>
Kaizen8938bd32017-09-28 14:38:23 +0100427 <tr><td class="paramdir">[in]</td><td class="paramname">bias_ptr</td><td>Pointer to the bias tensor. Same as <code>src_ptr</code> </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000428 <tr><td class="paramdir">[in]</td><td class="paramname">bias_stride_x</td><td>Stride of the bias tensor in X dimension (in bytes) </td></tr>
429 <tr><td class="paramdir">[in]</td><td class="paramname">bias_step_x</td><td>bias_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000430 <tr><td class="paramdir">[in]</td><td class="paramname">bias_offset_first_element_in_bytes</td><td>The offset of the first element in the source tensor </td></tr>
431 <tr><td class="paramdir">[in]</td><td class="paramname">width</td><td>The width of the input tensor </td></tr>
432 <tr><td class="paramdir">[in]</td><td class="paramname">height</td><td>The height of the input tensor </td></tr>
Anthony Barbierdbdab852017-06-23 15:42:00 +0100433 <tr><td class="paramdir">[in]</td><td class="paramname">depth</td><td>The depth of the input tensor </td></tr>
434 <tr><td class="paramdir">[in]</td><td class="paramname">total_filters</td><td>Total number of filters. 4th dimension of the weights matrix </td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000435 </table>
436 </dd>
437</dl>
438
Kaizen8938bd32017-09-28 14:38:23 +0100439<p>Definition at line <a class="el" href="convolution__layer_8cl_source.xhtml#l00057">57</a> of file <a class="el" href="convolution__layer_8cl_source.xhtml">convolution_layer.cl</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000440
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000441<p>References <a class="el" href="helpers_8h_source.xhtml#l00117">CONVERT_TO_TENSOR3D_STRUCT</a>, <a class="el" href="helpers_8h_source.xhtml#l00121">CONVERT_TO_TENSOR3D_STRUCT_NO_STEP</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, <a class="el" href="validation_2_n_e_o_n_2_g_e_m_m_8cpp_source.xhtml#l00118">arm_compute::test::validation::dst</a>, <a class="el" href="helpers_8h_source.xhtml#l00066">IMAGE_DECLARATION</a>, <a class="el" href="helpers_8h_source.xhtml#l00151">Tensor3D::ptr</a>, <a class="el" href="helpers_8h_source.xhtml#l00155">Tensor3D::stride_z</a>, <a class="el" href="helpers_8h_source.xhtml#l00074">TENSOR3D_DECLARATION</a>, and <a class="el" href="fixed__point_8h_source.xhtml#l00093">VEC_DATA_TYPE</a>.</p>
442<div class="fragment"><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;{</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <a class="code" href="struct_tensor3_d.xhtml">Tensor3D</a> src = <a class="code" href="helpers_8h.xhtml#a31c8c760f08fb1a331b16b7c204321dc">CONVERT_TO_TENSOR3D_STRUCT</a>(src);</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordtype">bool</span> is_last_thread = (get_global_id(0) == (get_global_size(0) - 1) &amp;&amp; get_global_id(1) == (get_global_size(1) - 1) &amp;&amp; get_global_id(2) == (get_global_size(2) - 1));</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; __global uchar *tmp_src_ptr = src.<a class="code" href="struct_tensor3_d.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>;</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; __global uchar *tmp_dst_ptr = dst_ptr + dst_offset_first_element_in_bytes + get_global_id(0) * dst_stride_y + get_global_id(1) * width * dst_stride_y + get_global_id(</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; 2) * width * height * dst_stride_y;</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="preprocessor">#ifdef HAS_BIAS</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; __global uchar *tmp_bias_ptr = bias_ptr + bias_offset_first_element_in_bytes;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* HAS_BIAS */</span><span class="preprocessor"></span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordflow">if</span>(is_last_thread)</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; {</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordflow">for</span>(uint i = 0; i &lt; total_filters; ++i)</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; {</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)tmp_dst_ptr) = *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)tmp_src_ptr);</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="preprocessor">#ifdef HAS_BIAS</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)(tmp_dst_ptr + dst_stride_y)) = *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)(tmp_bias_ptr));</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; tmp_bias_ptr += bias_stride_x;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* HAS_BIAS */</span><span class="preprocessor"></span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; tmp_src_ptr += depth * src_stride_z;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; tmp_dst_ptr += dst_stride_x;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; }</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; }</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; {</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">for</span>(uint i = 0; i &lt; total_filters; ++i)</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; {</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)tmp_dst_ptr) = *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)tmp_src_ptr);</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; tmp_src_ptr += depth * src_stride_z;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; tmp_dst_ptr += dst_stride_x;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; }</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; }</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;}</div><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>
Anthony Barbier871448e2017-03-24 14:54:29 +0000443<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 Barbier8140e1e2017-12-14 23:48:46 +0000444<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>
445<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>
Anthony Barbier871448e2017-03-24 14:54:29 +0000446</div><!-- fragment -->
447</div>
448</div>
449</div><!-- contents -->
450</div><!-- doc-content -->
451<!-- start footer part -->
452<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
453 <ul>
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000454 <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="convolution__layer_8cl.xhtml">convolution_layer.cl</a></li>
455 <li class="footer">Generated on Thu Dec 14 2017 23:48:34 for Compute Library by
Anthony Barbier871448e2017-03-24 14:54:29 +0000456 <a href="http://www.doxygen.org/index.html">
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000457 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000458 </ul>
459</div>
460</body>
461</html>