blob: bf663c4fcc0bb5c9cb81f64aa8b55021ea043ada [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"/>
Kaizen8938bd32017-09-28 14:38:23 +01007<meta name="generator" content="Doxygen 1.8.6"/>
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/mean_stddev.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 Barbier871448e2017-03-24 14:54:29 +000015<script type="text/javascript" src="navtree.js"></script>
16<script type="text/javascript">
17 $(document).ready(initResizable);
18 $(window).load(resizeHeight);
19</script>
20<link href="search/search.css" rel="stylesheet" type="text/css"/>
Anthony Barbier871448e2017-03-24 14:54:29 +000021<script type="text/javascript" src="search/search.js"></script>
22<script type="text/javascript">
Kaizen8938bd32017-09-28 14:38:23 +010023 $(document).ready(function() { searchBox.OnSelectItem(0); });
Anthony Barbier871448e2017-03-24 14:54:29 +000024</script>
25<script type="text/x-mathjax-config">
26 MathJax.Hub.Config({
27 extensions: ["tex2jax.js"],
28 jax: ["input/TeX","output/HTML-CSS"],
29});
Kaizen8938bd32017-09-28 14:38:23 +010030</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000031<link href="doxygen.css" rel="stylesheet" type="text/css" />
32</head>
33<body>
34<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
35<div id="titlearea">
36<table cellspacing="0" cellpadding="0">
37 <tbody>
38 <tr style="height: 56px;">
39 <td style="padding-left: 0.5em;">
Anthony Barbierdbdab852017-06-23 15:42:00 +010040 <div id="projectname">Compute Library
Kaizen8938bd32017-09-28 14:38:23 +010041 &#160;<span id="projectnumber">17.09</span>
Anthony Barbier871448e2017-03-24 14:54:29 +000042 </div>
43 </td>
44 </tr>
45 </tbody>
46</table>
47</div>
48<!-- end header part -->
Kaizen8938bd32017-09-28 14:38:23 +010049<!-- Generated by Doxygen 1.8.6 -->
Anthony Barbier871448e2017-03-24 14:54:29 +000050<script type="text/javascript">
51var searchBox = new SearchBox("searchBox", "search",false,'Search');
52</script>
53 <div id="navrow1" class="tabs">
54 <ul class="tablist">
55 <li><a href="index.xhtml"><span>Main&#160;Page</span></a></li>
Anthony Barbierdbdab852017-06-23 15:42:00 +010056 <li><a href="pages.xhtml"><span>Related&#160;Pages</span></a></li>
Anthony Barbier871448e2017-03-24 14:54:29 +000057 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
58 <li><a href="annotated.xhtml"><span>Data&#160;Structures</span></a></li>
59 <li class="current"><a href="files.xhtml"><span>Files</span></a></li>
60 <li>
61 <div id="MSearchBox" class="MSearchBoxInactive">
62 <span class="left">
63 <img id="MSearchSelect" src="search/mag_sel.png"
64 onmouseover="return searchBox.OnSearchSelectShow()"
65 onmouseout="return searchBox.OnSearchSelectHide()"
66 alt=""/>
67 <input type="text" id="MSearchField" value="Search" accesskey="S"
68 onfocus="searchBox.OnSearchFieldFocus(true)"
69 onblur="searchBox.OnSearchFieldFocus(false)"
70 onkeyup="searchBox.OnSearchFieldChange(event)"/>
71 </span><span class="right">
72 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
73 </span>
74 </div>
75 </li>
76 </ul>
77 </div>
78 <div id="navrow2" class="tabs2">
79 <ul class="tablist">
80 <li><a href="files.xhtml"><span>File&#160;List</span></a></li>
81 <li><a href="globals.xhtml"><span>Globals</span></a></li>
82 </ul>
83 </div>
84</div><!-- top -->
85<div id="side-nav" class="ui-resizable side-nav-resizable">
86 <div id="nav-tree">
87 <div id="nav-tree-contents">
88 <div id="nav-sync" class="sync"></div>
89 </div>
90 </div>
91 <div id="splitbar" style="-moz-user-select:none;"
92 class="ui-resizable-handle">
93 </div>
94</div>
95<script type="text/javascript">
96$(document).ready(function(){initNavTree('mean__stddev_8cl.xhtml','');});
97</script>
98<div id="doc-content">
99<!-- window showing the filter options -->
100<div id="MSearchSelectWindow"
101 onmouseover="return searchBox.OnSearchSelectShow()"
102 onmouseout="return searchBox.OnSearchSelectHide()"
103 onkeydown="return searchBox.OnSearchSelectKey(event)">
Kaizen8938bd32017-09-28 14:38:23 +0100104<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark">&#160;</span>Pages</a></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000105
106<!-- iframe showing the search results (closed by default) -->
107<div id="MSearchResultsWindow">
108<iframe src="javascript:void(0)" frameborder="0"
109 name="MSearchResults" id="MSearchResults">
110</iframe>
111</div>
112
113<div class="header">
114 <div class="summary">
115<a href="#func-members">Functions</a> </div>
116 <div class="headertitle">
117<div class="title">mean_stddev.cl File Reference</div> </div>
118</div><!--header-->
119<div class="contents">
Kaizen8938bd32017-09-28 14:38:23 +0100120<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 +0000121</div>
122<p><a href="mean__stddev_8cl_source.xhtml">Go to the source code of this file.</a></p>
123<table class="memberdecls">
124<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
125Functions</h2></td></tr>
126<tr class="memitem:a35eedf10476f85a87aa70a4292dd380a"><td class="memItemLeft" align="right" valign="top">__kernel void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mean__stddev_8cl.xhtml#a35eedf10476f85a87aa70a4292dd380a">mean_stddev_accumulate</a> (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, uint height, __global ulong *global_sum, __global ulong *global_sum_sq)</td></tr>
Kaizen8938bd32017-09-28 14:38:23 +0100127<tr class="memdesc:a35eedf10476f85a87aa70a4292dd380a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function calculates the sum and sum of squares of a given input image. <a href="#a35eedf10476f85a87aa70a4292dd380a">More...</a><br/></td></tr>
Anthony Barbier871448e2017-03-24 14:54:29 +0000128<tr class="separator:a35eedf10476f85a87aa70a4292dd380a"><td class="memSeparator" colspan="2">&#160;</td></tr>
129</table>
130<h2 class="groupheader">Function Documentation</h2>
131<a class="anchor" id="a35eedf10476f85a87aa70a4292dd380a"></a>
132<div class="memitem">
133<div class="memproto">
134 <table class="memname">
135 <tr>
136 <td class="memname">__kernel void mean_stddev_accumulate </td>
137 <td>(</td>
138 <td class="paramtype">__global uchar *&#160;</td>
139 <td class="paramname"><em>src_ptr</em>, </td>
140 </tr>
141 <tr>
142 <td class="paramkey"></td>
143 <td></td>
144 <td class="paramtype">uint&#160;</td>
145 <td class="paramname"><em>src_stride_x</em>, </td>
146 </tr>
147 <tr>
148 <td class="paramkey"></td>
149 <td></td>
150 <td class="paramtype">uint&#160;</td>
151 <td class="paramname"><em>src_step_x</em>, </td>
152 </tr>
153 <tr>
154 <td class="paramkey"></td>
155 <td></td>
156 <td class="paramtype">uint&#160;</td>
157 <td class="paramname"><em>src_stride_y</em>, </td>
158 </tr>
159 <tr>
160 <td class="paramkey"></td>
161 <td></td>
162 <td class="paramtype">uint&#160;</td>
163 <td class="paramname"><em>src_step_y</em>, </td>
164 </tr>
165 <tr>
166 <td class="paramkey"></td>
167 <td></td>
168 <td class="paramtype">uint&#160;</td>
169 <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td>
170 </tr>
171 <tr>
172 <td class="paramkey"></td>
173 <td></td>
174 <td class="paramtype">uint&#160;</td>
175 <td class="paramname"><em>height</em>, </td>
176 </tr>
177 <tr>
178 <td class="paramkey"></td>
179 <td></td>
180 <td class="paramtype">__global ulong *&#160;</td>
181 <td class="paramname"><em>global_sum</em>, </td>
182 </tr>
183 <tr>
184 <td class="paramkey"></td>
185 <td></td>
186 <td class="paramtype">__global ulong *&#160;</td>
187 <td class="paramname"><em>global_sum_sq</em>&#160;</td>
188 </tr>
189 <tr>
190 <td></td>
191 <td>)</td>
192 <td></td><td></td>
193 </tr>
194 </table>
195</div><div class="memdoc">
196
197<p>This function calculates the sum and sum of squares of a given input image. </p>
198<dl class="section note"><dt>Note</dt><dd>To enable calculation sum of squares -DSTDDEV should be passed as a preprocessor argument.</dd></dl>
199<dl class="params"><dt>Parameters</dt><dd>
200 <table class="params">
201 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source image. Supported data types: U8 </td></tr>
202 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_x</td><td>Stride of the source image in X dimension (in bytes) </td></tr>
203 <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>
204 <tr><td class="paramdir">[in]</td><td class="paramname">src_stride_y</td><td>Stride of the source image in Y dimension (in bytes) </td></tr>
205 <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>
206 <tr><td class="paramdir">[in]</td><td class="paramname">src_offset_first_element_in_bytes</td><td>The offset of the first element in the source image </td></tr>
207 <tr><td class="paramdir">[in]</td><td class="paramname">height</td><td>Height of the input image </td></tr>
208 <tr><td class="paramdir">[out]</td><td class="paramname">global_sum</td><td>Global sum of all elements </td></tr>
209 <tr><td class="paramdir">[out]</td><td class="paramname">global_sum_sq</td><td>Global sum of squares of all elements </td></tr>
210 </table>
211 </dd>
212</dl>
213
214<p>Definition at line <a class="el" href="mean__stddev_8cl_source.xhtml#l00043">43</a> of file <a class="el" href="mean__stddev_8cl_source.xhtml">mean_stddev.cl</a>.</p>
215
Kaizen8938bd32017-09-28 14:38:23 +0100216<p>References <a class="el" href="helpers_8h_source.xhtml#l00093">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00292">offset()</a>.</p>
217<div class="fragment"><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;{</div>
218<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="comment">// Get pixels pointer</span></div>
219<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> src = <a class="code" href="helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(src);</div>
220<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;</div>
221<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; uint8 tmp_sum = 0;</div>
222<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="preprocessor">#ifdef STDDEV</span></div>
223<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="preprocessor"></span> uint8 tmp_sum_sq = 0;</div>
224<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* STDDEV */</span><span class="preprocessor"></span></div>
225<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="preprocessor"></span> <span class="comment">// Calculate partial sum</span></div>
226<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; height; i++)</div>
227<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; {</div>
228<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="comment">// Load data</span></div>
229<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; uint8 data = convert_uint8(vload8(0, <a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&amp;src, 0, i)));</div>
230<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div>
231<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; tmp_sum += data;</div>
232<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="preprocessor">#ifdef STDDEV</span></div>
233<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="preprocessor"></span> tmp_sum_sq += data * data;</div>
234<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* STDDEV */</span><span class="preprocessor"></span></div>
235<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="preprocessor"></span> }</div>
236<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="comment">// Perform reduction</span></div>
237<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; tmp_sum.s0123 += tmp_sum.s4567;</div>
238<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; tmp_sum.s01 += tmp_sum.s23;</div>
239<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; atom_add(global_sum, tmp_sum.s0 + tmp_sum.s1);</div>
240<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;</div>
241<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="preprocessor">#ifdef STDDEV</span></div>
242<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="preprocessor"></span> tmp_sum_sq.s0123 += tmp_sum_sq.s4567;</div>
243<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; tmp_sum_sq.s01 += tmp_sum_sq.s23;</div>
244<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; atom_add(global_sum_sq, tmp_sum_sq.s0 + tmp_sum_sq.s1);</div>
245<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* STDDEV */</span><span class="preprocessor"></span></div>
246<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="preprocessor"></span>}</div>
247<div class="ttc" id="helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00292">helpers.h:292</a></div></div>
248<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#l00093">helpers.h:93</a></div></div>
249<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#l00131">helpers.h:131</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000250</div><!-- fragment -->
251</div>
252</div>
253</div><!-- contents -->
254</div><!-- doc-content -->
255<!-- start footer part -->
256<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
257 <ul>
Kaizen8938bd32017-09-28 14:38:23 +0100258 <li class="navelem"><a class="el" href="dir_55b5a5006e943fb664ff8cff3cfe7768.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_f6c3ae42d7e27145d0a3c3e38ca1c000.xhtml">core</a></li><li class="navelem"><a class="el" href="dir_1b7ae9123c88e650426d50d95c19d414.xhtml">CL</a></li><li class="navelem"><a class="el" href="dir_b7c3d80b0dadb2139bc73b7161751c12.xhtml">cl_kernels</a></li><li class="navelem"><a class="el" href="mean__stddev_8cl.xhtml">mean_stddev.cl</a></li>
259 <li class="footer">Generated on Thu Sep 28 2017 14:37:53 for Compute Library by
Anthony Barbier871448e2017-03-24 14:54:29 +0000260 <a href="http://www.doxygen.org/index.html">
Kaizen8938bd32017-09-28 14:38:23 +0100261 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000262 </ul>
263</div>
264</body>
265</html>