blob: df48aef8b29342b34dd9ed01d16c5ae5c4bd9dfe [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/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 Barbier8140e1e2017-12-14 23:48:46 +000015<script type="text/javascript" src="navtreedata.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000016<script type="text/javascript" src="navtree.js"></script>
17<script type="text/javascript">
18 $(document).ready(initResizable);
19 $(window).load(resizeHeight);
20</script>
21<link href="search/search.css" rel="stylesheet" type="text/css"/>
Anthony Barbier8140e1e2017-12-14 23:48:46 +000022<script type="text/javascript" src="search/searchdata.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000023<script type="text/javascript" src="search/search.js"></script>
24<script type="text/javascript">
Anthony Barbier8140e1e2017-12-14 23:48:46 +000025 $(document).ready(function() { init_search(); });
Anthony Barbier871448e2017-03-24 14:54:29 +000026</script>
27<script type="text/x-mathjax-config">
28 MathJax.Hub.Config({
29 extensions: ["tex2jax.js"],
30 jax: ["input/TeX","output/HTML-CSS"],
31});
Anthony Barbier8140e1e2017-12-14 23:48:46 +000032</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
Anthony Barbier871448e2017-03-24 14:54:29 +000033<link href="doxygen.css" rel="stylesheet" type="text/css" />
34</head>
35<body>
36<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
37<div id="titlearea">
38<table cellspacing="0" cellpadding="0">
39 <tbody>
40 <tr style="height: 56px;">
41 <td style="padding-left: 0.5em;">
Anthony Barbierdbdab852017-06-23 15:42:00 +010042 <div id="projectname">Compute Library
Anthony Barbier8140e1e2017-12-14 23:48:46 +000043 &#160;<span id="projectnumber">17.12</span>
Anthony Barbier871448e2017-03-24 14:54:29 +000044 </div>
45 </td>
46 </tr>
47 </tbody>
48</table>
49</div>
50<!-- end header part -->
Anthony Barbier8140e1e2017-12-14 23:48:46 +000051<!-- Generated by Doxygen 1.8.11 -->
Anthony Barbier871448e2017-03-24 14:54:29 +000052<script type="text/javascript">
53var searchBox = new SearchBox("searchBox", "search",false,'Search');
54</script>
55 <div id="navrow1" class="tabs">
56 <ul class="tablist">
57 <li><a href="index.xhtml"><span>Main&#160;Page</span></a></li>
Anthony Barbierdbdab852017-06-23 15:42:00 +010058 <li><a href="pages.xhtml"><span>Related&#160;Pages</span></a></li>
Anthony Barbier871448e2017-03-24 14:54:29 +000059 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
60 <li><a href="annotated.xhtml"><span>Data&#160;Structures</span></a></li>
61 <li class="current"><a href="files.xhtml"><span>Files</span></a></li>
62 <li>
63 <div id="MSearchBox" class="MSearchBoxInactive">
64 <span class="left">
65 <img id="MSearchSelect" src="search/mag_sel.png"
66 onmouseover="return searchBox.OnSearchSelectShow()"
67 onmouseout="return searchBox.OnSearchSelectHide()"
68 alt=""/>
69 <input type="text" id="MSearchField" value="Search" accesskey="S"
70 onfocus="searchBox.OnSearchFieldFocus(true)"
71 onblur="searchBox.OnSearchFieldFocus(false)"
72 onkeyup="searchBox.OnSearchFieldChange(event)"/>
73 </span><span class="right">
74 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
75 </span>
76 </div>
77 </li>
78 </ul>
79 </div>
80 <div id="navrow2" class="tabs2">
81 <ul class="tablist">
82 <li><a href="files.xhtml"><span>File&#160;List</span></a></li>
83 <li><a href="globals.xhtml"><span>Globals</span></a></li>
84 </ul>
85 </div>
86</div><!-- top -->
87<div id="side-nav" class="ui-resizable side-nav-resizable">
88 <div id="nav-tree">
89 <div id="nav-tree-contents">
90 <div id="nav-sync" class="sync"></div>
91 </div>
92 </div>
93 <div id="splitbar" style="-moz-user-select:none;"
94 class="ui-resizable-handle">
95 </div>
96</div>
97<script type="text/javascript">
98$(document).ready(function(){initNavTree('mean__stddev_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">mean_stddev.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="mean__stddev_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: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>
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000129<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 +0000130<tr class="separator:a35eedf10476f85a87aa70a4292dd380a"><td class="memSeparator" colspan="2">&#160;</td></tr>
131</table>
132<h2 class="groupheader">Function Documentation</h2>
133<a class="anchor" id="a35eedf10476f85a87aa70a4292dd380a"></a>
134<div class="memitem">
135<div class="memproto">
136 <table class="memname">
137 <tr>
138 <td class="memname">__kernel void mean_stddev_accumulate </td>
139 <td>(</td>
140 <td class="paramtype">__global uchar *&#160;</td>
141 <td class="paramname"><em>src_ptr</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>src_stride_x</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>src_step_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>src_stride_y</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>src_step_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>src_offset_first_element_in_bytes</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>height</em>, </td>
178 </tr>
179 <tr>
180 <td class="paramkey"></td>
181 <td></td>
182 <td class="paramtype">__global ulong *&#160;</td>
183 <td class="paramname"><em>global_sum</em>, </td>
184 </tr>
185 <tr>
186 <td class="paramkey"></td>
187 <td></td>
188 <td class="paramtype">__global ulong *&#160;</td>
189 <td class="paramname"><em>global_sum_sq</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 calculates the sum and sum of squares of a given input image. </p>
200<dl class="section note"><dt>Note</dt><dd>To enable calculation sum of squares -DSTDDEV should be passed as a preprocessor argument.</dd></dl>
201<dl class="params"><dt>Parameters</dt><dd>
202 <table class="params">
203 <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source image. Supported data types: U8 </td></tr>
204 <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>
205 <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>
206 <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>
207 <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>
208 <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>
209 <tr><td class="paramdir">[in]</td><td class="paramname">height</td><td>Height of the input image </td></tr>
210 <tr><td class="paramdir">[out]</td><td class="paramname">global_sum</td><td>Global sum of all elements </td></tr>
211 <tr><td class="paramdir">[out]</td><td class="paramname">global_sum_sq</td><td>Global sum of squares of all elements </td></tr>
212 </table>
213 </dd>
214</dl>
215
216<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>
217
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000218<p>References <a class="el" href="helpers_8h_source.xhtml#l00102">CONVERT_TO_IMAGE_STRUCT</a>, and <a class="el" href="helpers_8h_source.xhtml#l00301">offset()</a>.</p>
219<div class="fragment"><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">// Get pixels pointer</span></div><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><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; uint8 tmp_sum = 0;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="preprocessor">#ifdef STDDEV</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; uint8 tmp_sum_sq = 0;</div><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><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="comment">// Calculate partial sum</span></div><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><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; {</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="comment">// Load data</span></div><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><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; tmp_sum += data;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="preprocessor">#ifdef STDDEV</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; tmp_sum_sq += data * data;</div><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><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; }</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="comment">// Perform reduction</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; tmp_sum.s0123 += tmp_sum.s4567;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; tmp_sum.s01 += tmp_sum.s23;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; atom_add(global_sum, tmp_sum.s0 + tmp_sum.s1);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="preprocessor">#ifdef STDDEV</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; tmp_sum_sq.s0123 += tmp_sum_sq.s4567;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; tmp_sum_sq.s01 += tmp_sum_sq.s23;</div><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><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><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;}</div><div class="ttc" id="helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00301">helpers.h:301</a></div></div>
220<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#l00102">helpers.h:102</a></div></div>
221<div class="ttc" id="struct_image_xhtml"><div class="ttname"><a href="struct_image.xhtml">Image</a></div><div class="ttdoc">Structure to hold Image information. </div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00140">helpers.h:140</a></div></div>
Anthony Barbier871448e2017-03-24 14:54:29 +0000222</div><!-- fragment -->
223</div>
224</div>
225</div><!-- contents -->
226</div><!-- doc-content -->
227<!-- start footer part -->
228<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
229 <ul>
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000230 <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="mean__stddev_8cl.xhtml">mean_stddev.cl</a></li>
231 <li class="footer">Generated on Thu Dec 14 2017 23:48:34 for Compute Library by
Anthony Barbier871448e2017-03-24 14:54:29 +0000232 <a href="http://www.doxygen.org/index.html">
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000233 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
Anthony Barbier871448e2017-03-24 14:54:29 +0000234 </ul>
235</div>
236</body>
237</html>