blob: 862adb3fc78c008e6ca3aed88e613c58f9fee426 [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"/>
Jenkinsb9abeae2018-11-22 11:58:08 +00007<meta name="generator" content="Doxygen 1.8.13"/>
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);
Anthony Barbier871448e2017-03-24 14:54:29 +000019</script>
20<link href="search/search.css" rel="stylesheet" type="text/css"/>
Anthony Barbier8140e1e2017-12-14 23:48:46 +000021<script type="text/javascript" src="search/searchdata.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000022<script type="text/javascript" src="search/search.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000023<script type="text/x-mathjax-config">
24 MathJax.Hub.Config({
25 extensions: ["tex2jax.js"],
26 jax: ["input/TeX","output/HTML-CSS"],
27});
Anthony Barbier8140e1e2017-12-14 23:48:46 +000028</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000029<link href="doxygen.css" rel="stylesheet" type="text/css" />
30</head>
31<body>
32<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
33<div id="titlearea">
34<table cellspacing="0" cellpadding="0">
35 <tbody>
36 <tr style="height: 56px;">
37 <td style="padding-left: 0.5em;">
Anthony Barbierdbdab852017-06-23 15:42:00 +010038 <div id="projectname">Compute Library
Jenkinsb9abeae2018-11-22 11:58:08 +000039 &#160;<span id="projectnumber">18.11</span>
Anthony Barbier871448e2017-03-24 14:54:29 +000040 </div>
41 </td>
42 </tr>
43 </tbody>
44</table>
45</div>
46<!-- end header part -->
Jenkinsb9abeae2018-11-22 11:58:08 +000047<!-- Generated by Doxygen 1.8.13 -->
Anthony Barbier871448e2017-03-24 14:54:29 +000048<script type="text/javascript">
49var searchBox = new SearchBox("searchBox", "search",false,'Search');
50</script>
Jenkinsb9abeae2018-11-22 11:58:08 +000051<script type="text/javascript" src="menudata.js"></script>
52<script type="text/javascript" src="menu.js"></script>
53<script type="text/javascript">
54$(function() {
55 initMenu('',true,false,'search.php','Search');
56 $(document).ready(function() { init_search(); });
57});
58</script>
59<div id="main-nav"></div>
Anthony Barbier871448e2017-03-24 14:54:29 +000060</div><!-- top -->
61<div id="side-nav" class="ui-resizable side-nav-resizable">
62 <div id="nav-tree">
63 <div id="nav-tree-contents">
64 <div id="nav-sync" class="sync"></div>
65 </div>
66 </div>
67 <div id="splitbar" style="-moz-user-select:none;"
68 class="ui-resizable-handle">
69 </div>
70</div>
71<script type="text/javascript">
72$(document).ready(function(){initNavTree('accumulate_8cl.xhtml','');});
73</script>
74<div id="doc-content">
75<!-- window showing the filter options -->
76<div id="MSearchSelectWindow"
77 onmouseover="return searchBox.OnSearchSelectShow()"
78 onmouseout="return searchBox.OnSearchSelectHide()"
79 onkeydown="return searchBox.OnSearchSelectKey(event)">
Anthony Barbier8140e1e2017-12-14 23:48:46 +000080</div>
Anthony Barbier871448e2017-03-24 14:54:29 +000081
82<!-- iframe showing the search results (closed by default) -->
83<div id="MSearchResultsWindow">
84<iframe src="javascript:void(0)" frameborder="0"
85 name="MSearchResults" id="MSearchResults">
86</iframe>
87</div>
88
89<div class="header">
90 <div class="summary">
91<a href="#func-members">Functions</a> </div>
92 <div class="headertitle">
93<div class="title">accumulate.cl File Reference</div> </div>
94</div><!--header-->
95<div class="contents">
Jenkinsb9abeae2018-11-22 11:58:08 +000096<div class="textblock"><code>#include &quot;<a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml">helpers.h</a>&quot;</code><br />
Anthony Barbier871448e2017-03-24 14:54:29 +000097</div>
98<p><a href="accumulate_8cl_source.xhtml">Go to the source code of this file.</a></p>
99<table class="memberdecls">
100<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
101Functions</h2></td></tr>
102<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 +0000103<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 +0000104<tr class="separator:a00e540076dd545ad59ac7482f8cdf514"><td class="memSeparator" colspan="2">&#160;</td></tr>
105<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 +0000106<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 +0000107<tr class="separator:ab64020e40663a4356d6037079d7292fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
108<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 +0000109<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 +0000110<tr class="separator:aa6efbf07a1932e211879a0df54e9f50f"><td class="memSeparator" colspan="2">&#160;</td></tr>
111</table>
112<h2 class="groupheader">Function Documentation</h2>
Jenkinsb9abeae2018-11-22 11:58:08 +0000113<a id="a00e540076dd545ad59ac7482f8cdf514"></a>
114<h2 class="memtitle"><span class="permalink"><a href="#a00e540076dd545ad59ac7482f8cdf514">&#9670;&nbsp;</a></span>accumulate()</h2>
115
Anthony Barbier871448e2017-03-24 14:54:29 +0000116<div class="memitem">
117<div class="memproto">
118 <table class="memname">
119 <tr>
120 <td class="memname">__kernel void accumulate </td>
121 <td>(</td>
122 <td class="paramtype">__global uchar *&#160;</td>
123 <td class="paramname"><em>input_ptr</em>, </td>
124 </tr>
125 <tr>
126 <td class="paramkey"></td>
127 <td></td>
128 <td class="paramtype">uint&#160;</td>
129 <td class="paramname"><em>input_stride_x</em>, </td>
130 </tr>
131 <tr>
132 <td class="paramkey"></td>
133 <td></td>
134 <td class="paramtype">uint&#160;</td>
135 <td class="paramname"><em>input_step_x</em>, </td>
136 </tr>
137 <tr>
138 <td class="paramkey"></td>
139 <td></td>
140 <td class="paramtype">uint&#160;</td>
141 <td class="paramname"><em>input_stride_y</em>, </td>
142 </tr>
143 <tr>
144 <td class="paramkey"></td>
145 <td></td>
146 <td class="paramtype">uint&#160;</td>
147 <td class="paramname"><em>input_step_y</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_offset_first_element_in_bytes</em>, </td>
154 </tr>
155 <tr>
156 <td class="paramkey"></td>
157 <td></td>
158 <td class="paramtype">__global uchar *&#160;</td>
159 <td class="paramname"><em>accu_ptr</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>accu_stride_x</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>accu_step_x</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>accu_stride_y</em>, </td>
178 </tr>
179 <tr>
180 <td class="paramkey"></td>
181 <td></td>
182 <td class="paramtype">uint&#160;</td>
183 <td class="paramname"><em>accu_step_y</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_offset_first_element_in_bytes</em>&#160;</td>
190 </tr>
191 <tr>
192 <td></td>
193 <td>)</td>
194 <td></td><td></td>
195 </tr>
196 </table>
197</div><div class="memdoc">
198
199<p>This function accumulates an input image into output image. </p>
200<dl class="params"><dt>Parameters</dt><dd>
201 <table class="params">
202 <tr><td class="paramdir">[in]</td><td class="paramname">input_ptr</td><td>Pointer to the source image. Supported data types: U8 </td></tr>
203 <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>
204 <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>
205 <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>
206 <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>
207 <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>
208 <tr><td class="paramdir">[out]</td><td class="paramname">accu_ptr</td><td>Pointer to the destination image. Supported data types: S16 </td></tr>
209 <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>
210 <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>
211 <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>
212 <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>
213 <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>
214 </table>
215 </dd>
216</dl>
217
Jenkinsb9abeae2018-11-22 11:58:08 +0000218<p class="definition">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>
Anthony Barbier871448e2017-03-24 14:54:29 +0000219
Jenkinsb9abeae2018-11-22 11:58:08 +0000220<p class="reference">References <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00110">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00150">Image::ptr</a>.</p>
Anthony Barbier871448e2017-03-24 14:54:29 +0000221
Jenkinsb9abeae2018-11-22 11:58:08 +0000222<p class="reference">Referenced by <a class="el" href="arm__compute_2core_2_utils_8h_source.xhtml#l00627">arm_compute::calculate_matrix_scale()</a>, <a class="el" href="tests_2validation_2_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#l00706">arm_compute::data_type_for_convolution()</a>, <a class="el" href="arm__compute_2core_2_utils_8h_source.xhtml#l00762">arm_compute::data_type_for_convolution_matrix()</a>, <a class="el" href="tests_2framework_2_utils_8h_source.xhtml#l00093">arm_compute::test::join()</a>, <a class="el" href="_offset_lifetime_manager_8cpp_source.xhtml#l00050">OffsetLifetimeManager::mapping_type()</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#l00339">SimpleTensor&lt; uint8_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>
223<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="src_2core_2_c_l_2cl__kernels_2_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="src_2core_2_c_l_2cl__kernels_2_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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00110">helpers.h:110</a></div></div>
224<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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00148">helpers.h:148</a></div></div>
225<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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00150">helpers.h:150</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000226</div><!-- fragment -->
227</div>
228</div>
Jenkinsb9abeae2018-11-22 11:58:08 +0000229<a id="aa6efbf07a1932e211879a0df54e9f50f"></a>
230<h2 class="memtitle"><span class="permalink"><a href="#aa6efbf07a1932e211879a0df54e9f50f">&#9670;&nbsp;</a></span>accumulate_squared()</h2>
231
Anthony Barbier871448e2017-03-24 14:54:29 +0000232<div class="memitem">
233<div class="memproto">
234 <table class="memname">
235 <tr>
236 <td class="memname">__kernel void accumulate_squared </td>
237 <td>(</td>
238 <td class="paramtype">__global uchar *&#160;</td>
239 <td class="paramname"><em>input_ptr</em>, </td>
240 </tr>
241 <tr>
242 <td class="paramkey"></td>
243 <td></td>
244 <td class="paramtype">uint&#160;</td>
245 <td class="paramname"><em>input_stride_x</em>, </td>
246 </tr>
247 <tr>
248 <td class="paramkey"></td>
249 <td></td>
250 <td class="paramtype">uint&#160;</td>
251 <td class="paramname"><em>input_step_x</em>, </td>
252 </tr>
253 <tr>
254 <td class="paramkey"></td>
255 <td></td>
256 <td class="paramtype">uint&#160;</td>
257 <td class="paramname"><em>input_stride_y</em>, </td>
258 </tr>
259 <tr>
260 <td class="paramkey"></td>
261 <td></td>
262 <td class="paramtype">uint&#160;</td>
263 <td class="paramname"><em>input_step_y</em>, </td>
264 </tr>
265 <tr>
266 <td class="paramkey"></td>
267 <td></td>
268 <td class="paramtype">uint&#160;</td>
269 <td class="paramname"><em>input_offset_first_element_in_bytes</em>, </td>
270 </tr>
271 <tr>
272 <td class="paramkey"></td>
273 <td></td>
274 <td class="paramtype">__global uchar *&#160;</td>
275 <td class="paramname"><em>accu_ptr</em>, </td>
276 </tr>
277 <tr>
278 <td class="paramkey"></td>
279 <td></td>
280 <td class="paramtype">uint&#160;</td>
281 <td class="paramname"><em>accu_stride_x</em>, </td>
282 </tr>
283 <tr>
284 <td class="paramkey"></td>
285 <td></td>
286 <td class="paramtype">uint&#160;</td>
287 <td class="paramname"><em>accu_step_x</em>, </td>
288 </tr>
289 <tr>
290 <td class="paramkey"></td>
291 <td></td>
292 <td class="paramtype">uint&#160;</td>
293 <td class="paramname"><em>accu_stride_y</em>, </td>
294 </tr>
295 <tr>
296 <td class="paramkey"></td>
297 <td></td>
298 <td class="paramtype">uint&#160;</td>
299 <td class="paramname"><em>accu_step_y</em>, </td>
300 </tr>
301 <tr>
302 <td class="paramkey"></td>
303 <td></td>
304 <td class="paramtype">uint&#160;</td>
305 <td class="paramname"><em>accu_offset_first_element_in_bytes</em>, </td>
306 </tr>
307 <tr>
308 <td class="paramkey"></td>
309 <td></td>
310 <td class="paramtype">const uint&#160;</td>
311 <td class="paramname"><em>shift</em>&#160;</td>
312 </tr>
313 <tr>
314 <td></td>
315 <td>)</td>
316 <td></td><td></td>
317 </tr>
318 </table>
319</div><div class="memdoc">
320
321<p>This function accumulates a squared value from an input image to an output image. </p>
322<dl class="params"><dt>Parameters</dt><dd>
323 <table class="params">
324 <tr><td class="paramdir">[in]</td><td class="paramname">input_ptr</td><td>Pointer to the source image. Supported data types: U8 </td></tr>
325 <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>
326 <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>
327 <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>
328 <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>
329 <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>
330 <tr><td class="paramdir">[out]</td><td class="paramname">accu_ptr</td><td>Pointer to the destination image. Supported data types: S16 </td></tr>
331 <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>
332 <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>
333 <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>
334 <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>
335 <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>
336 <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>
337 </table>
338 </dd>
339</dl>
340
Jenkinsb9abeae2018-11-22 11:58:08 +0000341<p class="definition">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>
Anthony Barbier871448e2017-03-24 14:54:29 +0000342
Jenkinsb9abeae2018-11-22 11:58:08 +0000343<p class="reference">References <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00110">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00150">Image::ptr</a>.</p>
344<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="src_2core_2_c_l_2cl__kernels_2_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="src_2core_2_c_l_2cl__kernels_2_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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00110">helpers.h:110</a></div></div>
345<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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00148">helpers.h:148</a></div></div>
346<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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00150">helpers.h:150</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000347</div><!-- fragment -->
348</div>
349</div>
Jenkinsb9abeae2018-11-22 11:58:08 +0000350<a id="ab64020e40663a4356d6037079d7292fb"></a>
351<h2 class="memtitle"><span class="permalink"><a href="#ab64020e40663a4356d6037079d7292fb">&#9670;&nbsp;</a></span>accumulate_weighted()</h2>
352
Anthony Barbier871448e2017-03-24 14:54:29 +0000353<div class="memitem">
354<div class="memproto">
355 <table class="memname">
356 <tr>
357 <td class="memname">__kernel void accumulate_weighted </td>
358 <td>(</td>
359 <td class="paramtype">__global uchar *&#160;</td>
360 <td class="paramname"><em>input_ptr</em>, </td>
361 </tr>
362 <tr>
363 <td class="paramkey"></td>
364 <td></td>
365 <td class="paramtype">uint&#160;</td>
366 <td class="paramname"><em>input_stride_x</em>, </td>
367 </tr>
368 <tr>
369 <td class="paramkey"></td>
370 <td></td>
371 <td class="paramtype">uint&#160;</td>
372 <td class="paramname"><em>input_step_x</em>, </td>
373 </tr>
374 <tr>
375 <td class="paramkey"></td>
376 <td></td>
377 <td class="paramtype">uint&#160;</td>
378 <td class="paramname"><em>input_stride_y</em>, </td>
379 </tr>
380 <tr>
381 <td class="paramkey"></td>
382 <td></td>
383 <td class="paramtype">uint&#160;</td>
384 <td class="paramname"><em>input_step_y</em>, </td>
385 </tr>
386 <tr>
387 <td class="paramkey"></td>
388 <td></td>
389 <td class="paramtype">uint&#160;</td>
390 <td class="paramname"><em>input_offset_first_element_in_bytes</em>, </td>
391 </tr>
392 <tr>
393 <td class="paramkey"></td>
394 <td></td>
395 <td class="paramtype">__global uchar *&#160;</td>
396 <td class="paramname"><em>accu_ptr</em>, </td>
397 </tr>
398 <tr>
399 <td class="paramkey"></td>
400 <td></td>
401 <td class="paramtype">uint&#160;</td>
402 <td class="paramname"><em>accu_stride_x</em>, </td>
403 </tr>
404 <tr>
405 <td class="paramkey"></td>
406 <td></td>
407 <td class="paramtype">uint&#160;</td>
408 <td class="paramname"><em>accu_step_x</em>, </td>
409 </tr>
410 <tr>
411 <td class="paramkey"></td>
412 <td></td>
413 <td class="paramtype">uint&#160;</td>
414 <td class="paramname"><em>accu_stride_y</em>, </td>
415 </tr>
416 <tr>
417 <td class="paramkey"></td>
418 <td></td>
419 <td class="paramtype">uint&#160;</td>
420 <td class="paramname"><em>accu_step_y</em>, </td>
421 </tr>
422 <tr>
423 <td class="paramkey"></td>
424 <td></td>
425 <td class="paramtype">uint&#160;</td>
426 <td class="paramname"><em>accu_offset_first_element_in_bytes</em>, </td>
427 </tr>
428 <tr>
429 <td class="paramkey"></td>
430 <td></td>
431 <td class="paramtype">const float&#160;</td>
432 <td class="paramname"><em>alpha</em>&#160;</td>
433 </tr>
434 <tr>
435 <td></td>
436 <td>)</td>
437 <td></td><td></td>
438 </tr>
439 </table>
440</div><div class="memdoc">
441
442<p>This function accumulates a weighted value from an input image to an output image. </p>
443<dl class="params"><dt>Parameters</dt><dd>
444 <table class="params">
445 <tr><td class="paramdir">[in]</td><td class="paramname">input_ptr</td><td>Pointer to the source image. Supported data types: U8 </td></tr>
446 <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>
447 <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>
448 <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>
449 <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>
450 <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>
451 <tr><td class="paramdir">[out]</td><td class="paramname">accu_ptr</td><td>Pointer to the destination image. Supported data types: S16 </td></tr>
452 <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>
453 <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>
454 <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>
455 <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>
456 <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>
457 <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>
458 </table>
459 </dd>
460</dl>
461
Jenkinsb9abeae2018-11-22 11:58:08 +0000462<p class="definition">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>
Anthony Barbier871448e2017-03-24 14:54:29 +0000463
Jenkinsb9abeae2018-11-22 11:58:08 +0000464<p class="reference">References <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00110">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00150">Image::ptr</a>.</p>
465<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="src_2core_2_c_l_2cl__kernels_2_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="src_2core_2_c_l_2cl__kernels_2_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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00110">helpers.h:110</a></div></div>
466<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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00148">helpers.h:148</a></div></div>
467<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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00150">helpers.h:150</a></div></div>
Jenkins52ba29e2018-08-29 15:32:11 +0000468<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 +0000469</div><!-- fragment -->
470</div>
471</div>
472</div><!-- contents -->
473</div><!-- doc-content -->
474<!-- start footer part -->
475<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
476 <ul>
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000477 <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>
Jenkinsb9abeae2018-11-22 11:58:08 +0000478 <li class="footer">Generated on Thu Nov 22 2018 11:57:43 for Compute Library by
Anthony Barbier871448e2017-03-24 14:54:29 +0000479 <a href="http://www.doxygen.org/index.html">
Jenkinsb9abeae2018-11-22 11:58:08 +0000480 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000481 </ul>
482</div>
483</body>
484</html>