blob: 5e41bf85e834f93bc63f6b7698bce9ccfa0cd4fa [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/accumulate.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
Jenkins52ba29e2018-08-29 15:32:11 +000043 &#160;<span id="projectnumber">18.08</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('accumulate_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">accumulate.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="accumulate_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>
128<tr class="memitem:a00e540076dd545ad59ac7482f8cdf514"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="accumulate_8cl.xhtml#a00e540076dd545ad59ac7482f8cdf514">accumulate</a> (__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_offset_first_element_in_bytes, __global uchar *accu_ptr, uint accu_stride_x, uint accu_step_x, uint accu_stride_y, uint accu_step_y, uint accu_offset_first_element_in_bytes)</td></tr>
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000129<tr class="memdesc:a00e540076dd545ad59ac7482f8cdf514"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function accumulates an input image into output image. <a href="#a00e540076dd545ad59ac7482f8cdf514">More...</a><br /></td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000130<tr class="separator:a00e540076dd545ad59ac7482f8cdf514"><td class="memSeparator" colspan="2">&#160;</td></tr>
131<tr class="memitem:ab64020e40663a4356d6037079d7292fb"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="accumulate_8cl.xhtml#ab64020e40663a4356d6037079d7292fb">accumulate_weighted</a> (__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_offset_first_element_in_bytes, __global uchar *accu_ptr, uint accu_stride_x, uint accu_step_x, uint accu_stride_y, uint accu_step_y, uint accu_offset_first_element_in_bytes, const float alpha)</td></tr>
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000132<tr class="memdesc:ab64020e40663a4356d6037079d7292fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function accumulates a weighted value from an input image to an output image. <a href="#ab64020e40663a4356d6037079d7292fb">More...</a><br /></td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000133<tr class="separator:ab64020e40663a4356d6037079d7292fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
134<tr class="memitem:aa6efbf07a1932e211879a0df54e9f50f"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="accumulate_8cl.xhtml#aa6efbf07a1932e211879a0df54e9f50f">accumulate_squared</a> (__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_offset_first_element_in_bytes, __global uchar *accu_ptr, uint accu_stride_x, uint accu_step_x, uint accu_stride_y, uint accu_step_y, uint accu_offset_first_element_in_bytes, const uint shift)</td></tr>
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000135<tr class="memdesc:aa6efbf07a1932e211879a0df54e9f50f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function accumulates a squared value from an input image to an output image. <a href="#aa6efbf07a1932e211879a0df54e9f50f">More...</a><br /></td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000136<tr class="separator:aa6efbf07a1932e211879a0df54e9f50f"><td class="memSeparator" colspan="2">&#160;</td></tr>
137</table>
138<h2 class="groupheader">Function Documentation</h2>
139<a class="anchor" id="a00e540076dd545ad59ac7482f8cdf514"></a>
140<div class="memitem">
141<div class="memproto">
142 <table class="memname">
143 <tr>
144 <td class="memname">__kernel void accumulate </td>
145 <td>(</td>
146 <td class="paramtype">__global uchar *&#160;</td>
147 <td class="paramname"><em>input_ptr</em>, </td>
148 </tr>
149 <tr>
150 <td class="paramkey"></td>
151 <td></td>
152 <td class="paramtype">uint&#160;</td>
153 <td class="paramname"><em>input_stride_x</em>, </td>
154 </tr>
155 <tr>
156 <td class="paramkey"></td>
157 <td></td>
158 <td class="paramtype">uint&#160;</td>
159 <td class="paramname"><em>input_step_x</em>, </td>
160 </tr>
161 <tr>
162 <td class="paramkey"></td>
163 <td></td>
164 <td class="paramtype">uint&#160;</td>
165 <td class="paramname"><em>input_stride_y</em>, </td>
166 </tr>
167 <tr>
168 <td class="paramkey"></td>
169 <td></td>
170 <td class="paramtype">uint&#160;</td>
171 <td class="paramname"><em>input_step_y</em>, </td>
172 </tr>
173 <tr>
174 <td class="paramkey"></td>
175 <td></td>
176 <td class="paramtype">uint&#160;</td>
177 <td class="paramname"><em>input_offset_first_element_in_bytes</em>, </td>
178 </tr>
179 <tr>
180 <td class="paramkey"></td>
181 <td></td>
182 <td class="paramtype">__global uchar *&#160;</td>
183 <td class="paramname"><em>accu_ptr</em>, </td>
184 </tr>
185 <tr>
186 <td class="paramkey"></td>
187 <td></td>
188 <td class="paramtype">uint&#160;</td>
189 <td class="paramname"><em>accu_stride_x</em>, </td>
190 </tr>
191 <tr>
192 <td class="paramkey"></td>
193 <td></td>
194 <td class="paramtype">uint&#160;</td>
195 <td class="paramname"><em>accu_step_x</em>, </td>
196 </tr>
197 <tr>
198 <td class="paramkey"></td>
199 <td></td>
200 <td class="paramtype">uint&#160;</td>
201 <td class="paramname"><em>accu_stride_y</em>, </td>
202 </tr>
203 <tr>
204 <td class="paramkey"></td>
205 <td></td>
206 <td class="paramtype">uint&#160;</td>
207 <td class="paramname"><em>accu_step_y</em>, </td>
208 </tr>
209 <tr>
210 <td class="paramkey"></td>
211 <td></td>
212 <td class="paramtype">uint&#160;</td>
213 <td class="paramname"><em>accu_offset_first_element_in_bytes</em>&#160;</td>
214 </tr>
215 <tr>
216 <td></td>
217 <td>)</td>
218 <td></td><td></td>
219 </tr>
220 </table>
221</div><div class="memdoc">
222
223<p>This function accumulates an input image into output image. </p>
224<dl class="params"><dt>Parameters</dt><dd>
225 <table class="params">
226 <tr><td class="paramdir">[in]</td><td class="paramname">input_ptr</td><td>Pointer to the source image. Supported data types: U8 </td></tr>
227 <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr>
228 <tr><td class="paramdir">[in]</td><td class="paramname">input_step_x</td><td>input_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
229 <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr>
230 <tr><td class="paramdir">[in]</td><td class="paramname">input_step_y</td><td>input_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
231 <tr><td class="paramdir">[in]</td><td class="paramname">input_offset_first_element_in_bytes</td><td>The offset of the first element in the source image </td></tr>
232 <tr><td class="paramdir">[out]</td><td class="paramname">accu_ptr</td><td>Pointer to the destination image. Supported data types: S16 </td></tr>
233 <tr><td class="paramdir">[in]</td><td class="paramname">accu_stride_x</td><td>Stride of the destination image in X dimension (in bytes) </td></tr>
234 <tr><td class="paramdir">[in]</td><td class="paramname">accu_step_x</td><td>accu_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
235 <tr><td class="paramdir">[in]</td><td class="paramname">accu_stride_y</td><td>Stride of the destination image in Y dimension (in bytes) </td></tr>
236 <tr><td class="paramdir">[in]</td><td class="paramname">accu_step_y</td><td>accu_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
237 <tr><td class="paramdir">[in]</td><td class="paramname">accu_offset_first_element_in_bytes</td><td>The offset of the first element in the destination image </td></tr>
238 </table>
239 </dd>
240</dl>
241
242<p>Definition at line <a class="el" href="accumulate_8cl_source.xhtml#l00041">41</a> of file <a class="el" href="accumulate_8cl_source.xhtml">accumulate.cl</a>.</p>
243
Jenkins52ba29e2018-08-29 15:32:11 +0000244<p>References <a class="el" href="helpers_8h_source.xhtml#l00112">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00152">Image::ptr</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000245
Jenkins52ba29e2018-08-29 15:32:11 +0000246<p>Referenced by <a class="el" href="arm__compute_2core_2_utils_8h_source.xhtml#l00626">arm_compute::calculate_matrix_scale()</a>, <a class="el" href="_helpers_8cpp_source.xhtml#l00101">arm_compute::test::validation::calculate_width_concatenate_shape()</a>, <a class="el" href="_dimensions_8h_source.xhtml#l00138">Dimensions&lt; size_t &gt;::collapse()</a>, <a class="el" href="arm__compute_2core_2_utils_8h_source.xhtml#l00705">arm_compute::data_type_for_convolution()</a>, <a class="el" href="arm__compute_2core_2_utils_8h_source.xhtml#l00761">arm_compute::data_type_for_convolution_matrix()</a>, <a class="el" href="_instruments_stats_8cpp_source.xhtml#l00033">InstrumentsStats::InstrumentsStats()</a>, <a class="el" href="tests_2framework_2_utils_8h_source.xhtml#l00093">arm_compute::test::join()</a>, <a class="el" href="validation_2reference_2_mean_std_dev_8cpp_source.xhtml#l00035">arm_compute::test::validation::reference::mean_and_standard_deviation()</a>, <a class="el" href="_helpers_8inl_source.xhtml#l00032">arm_compute::pixel_area_c1u8_clamp()</a>, <a class="el" href="_simple_tensor_8h_source.xhtml#l00300">SimpleTensor&lt; T &gt;::size()</a>, <a class="el" href="_open_c_l_memory_usage_8cpp_source.xhtml#l00185">OpenCLMemoryUsage::test_measurements()</a>, <a class="el" href="_tensor_shape_8h_source.xhtml#l00171">TensorShape::total_size()</a>, <a class="el" href="_tensor_shape_8h_source.xhtml#l00193">TensorShape::total_size_lower()</a>, and <a class="el" href="_tensor_shape_8h_source.xhtml#l00181">TensorShape::total_size_upper()</a>.</p>
247<div class="fragment"><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;{</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="comment">// Get pixels pointer</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> input = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(input);</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> accu = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(accu);</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="comment">// Load data</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; uchar16 in_data = vload16(0, input.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; short16 accu_data = vload16(0, (__global <span class="keywordtype">short</span> *)accu.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="comment">// Perform accumulation</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; short16 res = add_sat(convert_short16(in_data), accu_data);</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="comment">// Store result</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; vstore16(res, 0, (__global <span class="keywordtype">short</span> *)accu.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;}</div><div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00112">helpers.h:112</a></div></div>
248<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#l00150">helpers.h:150</a></div></div>
249<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#l00152">helpers.h:152</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000250</div><!-- fragment -->
251</div>
252</div>
253<a class="anchor" id="aa6efbf07a1932e211879a0df54e9f50f"></a>
254<div class="memitem">
255<div class="memproto">
256 <table class="memname">
257 <tr>
258 <td class="memname">__kernel void accumulate_squared </td>
259 <td>(</td>
260 <td class="paramtype">__global uchar *&#160;</td>
261 <td class="paramname"><em>input_ptr</em>, </td>
262 </tr>
263 <tr>
264 <td class="paramkey"></td>
265 <td></td>
266 <td class="paramtype">uint&#160;</td>
267 <td class="paramname"><em>input_stride_x</em>, </td>
268 </tr>
269 <tr>
270 <td class="paramkey"></td>
271 <td></td>
272 <td class="paramtype">uint&#160;</td>
273 <td class="paramname"><em>input_step_x</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>input_stride_y</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>input_step_y</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>input_offset_first_element_in_bytes</em>, </td>
292 </tr>
293 <tr>
294 <td class="paramkey"></td>
295 <td></td>
296 <td class="paramtype">__global uchar *&#160;</td>
297 <td class="paramname"><em>accu_ptr</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>accu_stride_x</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>accu_step_x</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>accu_stride_y</em>, </td>
316 </tr>
317 <tr>
318 <td class="paramkey"></td>
319 <td></td>
320 <td class="paramtype">uint&#160;</td>
321 <td class="paramname"><em>accu_step_y</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>accu_offset_first_element_in_bytes</em>, </td>
328 </tr>
329 <tr>
330 <td class="paramkey"></td>
331 <td></td>
332 <td class="paramtype">const uint&#160;</td>
333 <td class="paramname"><em>shift</em>&#160;</td>
334 </tr>
335 <tr>
336 <td></td>
337 <td>)</td>
338 <td></td><td></td>
339 </tr>
340 </table>
341</div><div class="memdoc">
342
343<p>This function accumulates a squared value from an input image to an output image. </p>
344<dl class="params"><dt>Parameters</dt><dd>
345 <table class="params">
346 <tr><td class="paramdir">[in]</td><td class="paramname">input_ptr</td><td>Pointer to the source image. Supported data types: U8 </td></tr>
347 <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr>
348 <tr><td class="paramdir">[in]</td><td class="paramname">input_step_x</td><td>input_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
349 <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr>
350 <tr><td class="paramdir">[in]</td><td class="paramname">input_step_y</td><td>input_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
351 <tr><td class="paramdir">[in]</td><td class="paramname">input_offset_first_element_in_bytes</td><td>The offset of the first element in the source image </td></tr>
352 <tr><td class="paramdir">[out]</td><td class="paramname">accu_ptr</td><td>Pointer to the destination image. Supported data types: S16 </td></tr>
353 <tr><td class="paramdir">[in]</td><td class="paramname">accu_stride_x</td><td>Stride of the destination image in X dimension (in bytes) </td></tr>
354 <tr><td class="paramdir">[in]</td><td class="paramname">accu_step_x</td><td>accu_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
355 <tr><td class="paramdir">[in]</td><td class="paramname">accu_stride_y</td><td>Stride of the destination image in Y dimension (in bytes) </td></tr>
356 <tr><td class="paramdir">[in]</td><td class="paramname">accu_step_y</td><td>accu_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
357 <tr><td class="paramdir">[in]</td><td class="paramname">accu_offset_first_element_in_bytes</td><td>The offset of the first element in the destination image </td></tr>
358 <tr><td class="paramdir">[in]</td><td class="paramname">shift</td><td>The U32 scalar value with a value in the range of 0 to 15 </td></tr>
359 </table>
360 </dd>
361</dl>
362
363<p>Definition at line <a class="el" href="accumulate_8cl_source.xhtml#l00112">112</a> of file <a class="el" href="accumulate_8cl_source.xhtml">accumulate.cl</a>.</p>
364
Jenkins52ba29e2018-08-29 15:32:11 +0000365<p>References <a class="el" href="helpers_8h_source.xhtml#l00112">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00152">Image::ptr</a>.</p>
366<div class="fragment"><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;{</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="comment">// Get pixels pointer</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> input = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(input);</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> accu = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(accu);</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="comment">// Load data</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; ushort16 in_data = convert_ushort16(vload16(0, input.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>));</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; uint16 accu_data = convert_uint16(vload16(0, (__global <span class="keywordtype">short</span> *)accu.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>));</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="comment">// Calculate squared accumulation</span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; short16 res = convert_short16_sat(accu_data + convert_uint16((in_data * in_data) &gt;&gt; shift));</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="comment">// Store result</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; vstore16(res, 0, (__global <span class="keywordtype">short</span> *)accu.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;}</div><div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00112">helpers.h:112</a></div></div>
367<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#l00150">helpers.h:150</a></div></div>
368<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#l00152">helpers.h:152</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000369</div><!-- fragment -->
370</div>
371</div>
372<a class="anchor" id="ab64020e40663a4356d6037079d7292fb"></a>
373<div class="memitem">
374<div class="memproto">
375 <table class="memname">
376 <tr>
377 <td class="memname">__kernel void accumulate_weighted </td>
378 <td>(</td>
379 <td class="paramtype">__global uchar *&#160;</td>
380 <td class="paramname"><em>input_ptr</em>, </td>
381 </tr>
382 <tr>
383 <td class="paramkey"></td>
384 <td></td>
385 <td class="paramtype">uint&#160;</td>
386 <td class="paramname"><em>input_stride_x</em>, </td>
387 </tr>
388 <tr>
389 <td class="paramkey"></td>
390 <td></td>
391 <td class="paramtype">uint&#160;</td>
392 <td class="paramname"><em>input_step_x</em>, </td>
393 </tr>
394 <tr>
395 <td class="paramkey"></td>
396 <td></td>
397 <td class="paramtype">uint&#160;</td>
398 <td class="paramname"><em>input_stride_y</em>, </td>
399 </tr>
400 <tr>
401 <td class="paramkey"></td>
402 <td></td>
403 <td class="paramtype">uint&#160;</td>
404 <td class="paramname"><em>input_step_y</em>, </td>
405 </tr>
406 <tr>
407 <td class="paramkey"></td>
408 <td></td>
409 <td class="paramtype">uint&#160;</td>
410 <td class="paramname"><em>input_offset_first_element_in_bytes</em>, </td>
411 </tr>
412 <tr>
413 <td class="paramkey"></td>
414 <td></td>
415 <td class="paramtype">__global uchar *&#160;</td>
416 <td class="paramname"><em>accu_ptr</em>, </td>
417 </tr>
418 <tr>
419 <td class="paramkey"></td>
420 <td></td>
421 <td class="paramtype">uint&#160;</td>
422 <td class="paramname"><em>accu_stride_x</em>, </td>
423 </tr>
424 <tr>
425 <td class="paramkey"></td>
426 <td></td>
427 <td class="paramtype">uint&#160;</td>
428 <td class="paramname"><em>accu_step_x</em>, </td>
429 </tr>
430 <tr>
431 <td class="paramkey"></td>
432 <td></td>
433 <td class="paramtype">uint&#160;</td>
434 <td class="paramname"><em>accu_stride_y</em>, </td>
435 </tr>
436 <tr>
437 <td class="paramkey"></td>
438 <td></td>
439 <td class="paramtype">uint&#160;</td>
440 <td class="paramname"><em>accu_step_y</em>, </td>
441 </tr>
442 <tr>
443 <td class="paramkey"></td>
444 <td></td>
445 <td class="paramtype">uint&#160;</td>
446 <td class="paramname"><em>accu_offset_first_element_in_bytes</em>, </td>
447 </tr>
448 <tr>
449 <td class="paramkey"></td>
450 <td></td>
451 <td class="paramtype">const float&#160;</td>
452 <td class="paramname"><em>alpha</em>&#160;</td>
453 </tr>
454 <tr>
455 <td></td>
456 <td>)</td>
457 <td></td><td></td>
458 </tr>
459 </table>
460</div><div class="memdoc">
461
462<p>This function accumulates a weighted value from an input image to an output image. </p>
463<dl class="params"><dt>Parameters</dt><dd>
464 <table class="params">
465 <tr><td class="paramdir">[in]</td><td class="paramname">input_ptr</td><td>Pointer to the source image. Supported data types: U8 </td></tr>
466 <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr>
467 <tr><td class="paramdir">[in]</td><td class="paramname">input_step_x</td><td>input_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
468 <tr><td class="paramdir">[in]</td><td class="paramname">input_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr>
469 <tr><td class="paramdir">[in]</td><td class="paramname">input_step_y</td><td>input_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
470 <tr><td class="paramdir">[in]</td><td class="paramname">input_offset_first_element_in_bytes</td><td>The offset of the first element in the source image </td></tr>
471 <tr><td class="paramdir">[out]</td><td class="paramname">accu_ptr</td><td>Pointer to the destination image. Supported data types: S16 </td></tr>
472 <tr><td class="paramdir">[in]</td><td class="paramname">accu_stride_x</td><td>Stride of the destination image in X dimension (in bytes) </td></tr>
473 <tr><td class="paramdir">[in]</td><td class="paramname">accu_step_x</td><td>accu_stride_x * number of elements along X processed per workitem(in bytes) </td></tr>
474 <tr><td class="paramdir">[in]</td><td class="paramname">accu_stride_y</td><td>Stride of the destination image in Y dimension (in bytes) </td></tr>
475 <tr><td class="paramdir">[in]</td><td class="paramname">accu_step_y</td><td>accu_stride_y * number of elements along Y processed per workitem(in bytes) </td></tr>
476 <tr><td class="paramdir">[in]</td><td class="paramname">accu_offset_first_element_in_bytes</td><td>The offset of the first element in the destination image </td></tr>
477 <tr><td class="paramdir">[in]</td><td class="paramname">alpha</td><td>The float scalar value with a value in the range of 0 to 1 </td></tr>
478 </table>
479 </dd>
480</dl>
481
482<p>Definition at line <a class="el" href="accumulate_8cl_source.xhtml#l00076">76</a> of file <a class="el" href="accumulate_8cl_source.xhtml">accumulate.cl</a>.</p>
483
Jenkins52ba29e2018-08-29 15:32:11 +0000484<p>References <a class="el" href="helpers_8h_source.xhtml#l00112">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00152">Image::ptr</a>.</p>
485<div class="fragment"><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="comment">// Get pixels pointer</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> input = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(input);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> accu = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(accu);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="comment">// Load data</span></div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keyword">const</span> float16 in_data = convert_float16(vload16(0, input.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>));</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keyword">const</span> float16 accu_data = convert_float16(vload16(0, accu.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>));</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="comment">// Calculate weighted accumulation</span></div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keyword">const</span> uchar16 res = convert_uchar16((1.0f - <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a62197192f0fbf4e0675eb37be1c4c175">alpha</a>) * accu_data + <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a62197192f0fbf4e0675eb37be1c4c175">alpha</a> * in_data);</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="comment">// Store result</span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; vstore16(res, 0, accu.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;}</div><div class="ttc" id="helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT(name)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00112">helpers.h:112</a></div></div>
486<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#l00150">helpers.h:150</a></div></div>
487<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#l00152">helpers.h:152</a></div></div>
488<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a62197192f0fbf4e0675eb37be1c4c175"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a62197192f0fbf4e0675eb37be1c4c175">arm_compute::test::validation::alpha</a></div><div class="ttdeci">alpha</div><div class="ttdef"><b>Definition:</b> <a href="validation_2_c_l_2_g_e_m_m_8cpp_source.xhtml#l00087">GEMM.cpp:87</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000489</div><!-- fragment -->
490</div>
491</div>
492</div><!-- contents -->
493</div><!-- doc-content -->
494<!-- start footer part -->
495<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
496 <ul>
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000497 <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="accumulate_8cl.xhtml">accumulate.cl</a></li>
Jenkins52ba29e2018-08-29 15:32:11 +0000498 <li class="footer">Generated on Wed Aug 29 2018 15:31:37 for Compute Library by
Anthony Barbier871448e2017-03-24 14:54:29 +0000499 <a href="http://www.doxygen.org/index.html">
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000500 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000501 </ul>
502</div>
503</body>
504</html>