Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 1 | <!-- 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"/> |
| 7 | <meta name="generator" content="Doxygen 1.8.11"/> |
| 8 | <meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines --> |
| 9 | <title>ARM Compute Library: src/core/CL/cl_kernels/minmaxloc.cl File Reference</title> |
| 10 | <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> |
| 15 | <script type="text/javascript" src="navtreedata.js"></script> |
| 16 | <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"/> |
| 22 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 23 | <script type="text/javascript" src="search/search.js"></script> |
| 24 | <script type="text/javascript"> |
| 25 | $(document).ready(function() { init_search(); }); |
| 26 | </script> |
| 27 | <script type="text/x-mathjax-config"> |
| 28 | MathJax.Hub.Config({ |
| 29 | extensions: ["tex2jax.js"], |
| 30 | jax: ["input/TeX","output/HTML-CSS"], |
| 31 | }); |
| 32 | </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> |
| 33 | <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;"> |
| 42 | <div id="projectname">ARM Compute Library |
Anthony Barbier | 46d5927 | 2017-05-04 09:15:15 +0100 | [diff] [blame] | 43 |  <span id="projectnumber">17.05</span> |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 44 | </div> |
| 45 | </td> |
| 46 | </tr> |
| 47 | </tbody> |
| 48 | </table> |
| 49 | </div> |
| 50 | <!-- end header part --> |
| 51 | <!-- Generated by Doxygen 1.8.11 --> |
| 52 | <script type="text/javascript"> |
| 53 | var 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 Page</span></a></li> |
| 58 | <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li> |
| 59 | <li><a href="annotated.xhtml"><span>Data Structures</span></a></li> |
| 60 | <li class="current"><a href="files.xhtml"><span>Files</span></a></li> |
| 61 | <li> |
| 62 | <div id="MSearchBox" class="MSearchBoxInactive"> |
| 63 | <span class="left"> |
| 64 | <img id="MSearchSelect" src="search/mag_sel.png" |
| 65 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 66 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 67 | alt=""/> |
| 68 | <input type="text" id="MSearchField" value="Search" accesskey="S" |
| 69 | onfocus="searchBox.OnSearchFieldFocus(true)" |
| 70 | onblur="searchBox.OnSearchFieldFocus(false)" |
| 71 | onkeyup="searchBox.OnSearchFieldChange(event)"/> |
| 72 | </span><span class="right"> |
| 73 | <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> |
| 74 | </span> |
| 75 | </div> |
| 76 | </li> |
| 77 | </ul> |
| 78 | </div> |
| 79 | <div id="navrow2" class="tabs2"> |
| 80 | <ul class="tablist"> |
| 81 | <li><a href="files.xhtml"><span>File List</span></a></li> |
| 82 | <li><a href="globals.xhtml"><span>Globals</span></a></li> |
| 83 | </ul> |
| 84 | </div> |
| 85 | </div><!-- top --> |
| 86 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 87 | <div id="nav-tree"> |
| 88 | <div id="nav-tree-contents"> |
| 89 | <div id="nav-sync" class="sync"></div> |
| 90 | </div> |
| 91 | </div> |
| 92 | <div id="splitbar" style="-moz-user-select:none;" |
| 93 | class="ui-resizable-handle"> |
| 94 | </div> |
| 95 | </div> |
| 96 | <script type="text/javascript"> |
| 97 | $(document).ready(function(){initNavTree('minmaxloc_8cl.xhtml','');}); |
| 98 | </script> |
| 99 | <div id="doc-content"> |
| 100 | <!-- window showing the filter options --> |
| 101 | <div id="MSearchSelectWindow" |
| 102 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 103 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 104 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 105 | </div> |
| 106 | |
| 107 | <!-- iframe showing the search results (closed by default) --> |
| 108 | <div id="MSearchResultsWindow"> |
| 109 | <iframe src="javascript:void(0)" frameborder="0" |
| 110 | name="MSearchResults" id="MSearchResults"> |
| 111 | </iframe> |
| 112 | </div> |
| 113 | |
| 114 | <div class="header"> |
| 115 | <div class="summary"> |
| 116 | <a href="#define-members">Macros</a> | |
| 117 | <a href="#func-members">Functions</a> | |
| 118 | <a href="#var-members">Variables</a> </div> |
| 119 | <div class="headertitle"> |
| 120 | <div class="title">minmaxloc.cl File Reference</div> </div> |
| 121 | </div><!--header--> |
| 122 | <div class="contents"> |
| 123 | <div class="textblock"><code>#include "<a class="el" href="helpers_8h_source.xhtml">helpers.h</a>"</code><br /> |
| 124 | <code>#include "<a class="el" href="types_8h_source.xhtml">types.h</a>"</code><br /> |
| 125 | </div> |
| 126 | <p><a href="minmaxloc_8cl_source.xhtml">Go to the source code of this file.</a></p> |
| 127 | <table class="memberdecls"> |
| 128 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> |
| 129 | Macros</h2></td></tr> |
| 130 | <tr class="memitem:a17decce255d6f94a60379a61a54e3bac"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="minmaxloc_8cl.xhtml#a17decce255d6f94a60379a61a54e3bac">DATA_TYPE_MIN</a>   0x0</td></tr> |
| 131 | <tr class="separator:a17decce255d6f94a60379a61a54e3bac"><td class="memSeparator" colspan="2"> </td></tr> |
| 132 | <tr class="memitem:afa6b114aa46a23bb226c5c9547f9f623"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="minmaxloc_8cl.xhtml#afa6b114aa46a23bb226c5c9547f9f623">DATA_TYPE_MAX</a>   0xFF</td></tr> |
| 133 | <tr class="separator:afa6b114aa46a23bb226c5c9547f9f623"><td class="memSeparator" colspan="2"> </td></tr> |
| 134 | </table><table class="memberdecls"> |
| 135 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 136 | Functions</h2></td></tr> |
| 137 | <tr class="memitem:a57351025b140b0b9ef881714d32d84d3"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="minmaxloc_8cl.xhtml#a57351025b140b0b9ef881714d32d84d3">minmax</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, __global int *min_max, uint width)</td></tr> |
| 138 | <tr class="memdesc:a57351025b140b0b9ef881714d32d84d3"><td class="mdescLeft"> </td><td class="mdescRight">This function identifies the min and maximum value of an input image. <a href="#a57351025b140b0b9ef881714d32d84d3">More...</a><br /></td></tr> |
| 139 | <tr class="separator:a57351025b140b0b9ef881714d32d84d3"><td class="memSeparator" colspan="2"> </td></tr> |
| 140 | <tr class="memitem:a31ce1a75df24b2037dc76f1748236579"><td class="memItemLeft" align="right" valign="top">__kernel void </td><td class="memItemRight" valign="bottom"><a class="el" href="minmaxloc_8cl.xhtml#a31ce1a75df24b2037dc76f1748236579">minmaxloc</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, __global int *min_max, __global uint *min_max_count, __global <a class="el" href="struct_coordinates2_d.xhtml">Coordinates2D</a> *min_loc, uint max_min_loc_count, __global <a class="el" href="struct_coordinates2_d.xhtml">Coordinates2D</a> *max_loc, uint max_max_loc_count)</td></tr> |
| 141 | <tr class="memdesc:a31ce1a75df24b2037dc76f1748236579"><td class="mdescLeft"> </td><td class="mdescRight">This function counts the min and max occurrences in an image and tags their position. <a href="#a31ce1a75df24b2037dc76f1748236579">More...</a><br /></td></tr> |
| 142 | <tr class="separator:a31ce1a75df24b2037dc76f1748236579"><td class="memSeparator" colspan="2"> </td></tr> |
| 143 | </table><table class="memberdecls"> |
| 144 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a> |
| 145 | Variables</h2></td></tr> |
| 146 | <tr class="memitem:a538b4b63f40e7b12891774e03a4f0dec"><td class="memItemLeft" align="right" valign="top">__constant DATA_TYPE16 </td><td class="memItemRight" valign="bottom"><a class="el" href="minmaxloc_8cl.xhtml#a538b4b63f40e7b12891774e03a4f0dec">type_min</a> = ( DATA_TYPE16 )( 0x0 )</td></tr> |
| 147 | <tr class="separator:a538b4b63f40e7b12891774e03a4f0dec"><td class="memSeparator" colspan="2"> </td></tr> |
| 148 | <tr class="memitem:a4464d6f922ea17b4a9ca6a2cec7ddb75"><td class="memItemLeft" align="right" valign="top">__constant DATA_TYPE16 </td><td class="memItemRight" valign="bottom"><a class="el" href="minmaxloc_8cl.xhtml#a4464d6f922ea17b4a9ca6a2cec7ddb75">type_max</a> = ( DATA_TYPE16 )( 0xFF )</td></tr> |
| 149 | <tr class="separator:a4464d6f922ea17b4a9ca6a2cec7ddb75"><td class="memSeparator" colspan="2"> </td></tr> |
| 150 | <tr class="memitem:a0712735973f172ac9efc7d48a31e47ad"><td class="memItemLeft" align="right" valign="top">__constant uint16 </td><td class="memItemRight" valign="bottom"><a class="el" href="minmaxloc_8cl.xhtml#a0712735973f172ac9efc7d48a31e47ad">idx16</a> = (uint16)(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)</td></tr> |
| 151 | <tr class="separator:a0712735973f172ac9efc7d48a31e47ad"><td class="memSeparator" colspan="2"> </td></tr> |
| 152 | </table> |
| 153 | <h2 class="groupheader">Macro Definition Documentation</h2> |
| 154 | <a class="anchor" id="afa6b114aa46a23bb226c5c9547f9f623"></a> |
| 155 | <div class="memitem"> |
| 156 | <div class="memproto"> |
| 157 | <table class="memname"> |
| 158 | <tr> |
| 159 | <td class="memname">#define DATA_TYPE_MAX   0xFF</td> |
| 160 | </tr> |
| 161 | </table> |
| 162 | </div><div class="memdoc"> |
| 163 | |
| 164 | <p>Definition at line <a class="el" href="minmaxloc_8cl_source.xhtml#l00032">32</a> of file <a class="el" href="minmaxloc_8cl_source.xhtml">minmaxloc.cl</a>.</p> |
| 165 | |
| 166 | </div> |
| 167 | </div> |
| 168 | <a class="anchor" id="a17decce255d6f94a60379a61a54e3bac"></a> |
| 169 | <div class="memitem"> |
| 170 | <div class="memproto"> |
| 171 | <table class="memname"> |
| 172 | <tr> |
| 173 | <td class="memname">#define DATA_TYPE_MIN   0x0</td> |
| 174 | </tr> |
| 175 | </table> |
| 176 | </div><div class="memdoc"> |
| 177 | |
| 178 | <p>Definition at line <a class="el" href="minmaxloc_8cl_source.xhtml#l00028">28</a> of file <a class="el" href="minmaxloc_8cl_source.xhtml">minmaxloc.cl</a>.</p> |
| 179 | |
| 180 | </div> |
| 181 | </div> |
| 182 | <h2 class="groupheader">Function Documentation</h2> |
| 183 | <a class="anchor" id="a57351025b140b0b9ef881714d32d84d3"></a> |
| 184 | <div class="memitem"> |
| 185 | <div class="memproto"> |
| 186 | <table class="memname"> |
| 187 | <tr> |
| 188 | <td class="memname">__kernel void minmax </td> |
| 189 | <td>(</td> |
| 190 | <td class="paramtype">__global uchar * </td> |
| 191 | <td class="paramname"><em>src_ptr</em>, </td> |
| 192 | </tr> |
| 193 | <tr> |
| 194 | <td class="paramkey"></td> |
| 195 | <td></td> |
| 196 | <td class="paramtype">uint </td> |
| 197 | <td class="paramname"><em>src_stride_x</em>, </td> |
| 198 | </tr> |
| 199 | <tr> |
| 200 | <td class="paramkey"></td> |
| 201 | <td></td> |
| 202 | <td class="paramtype">uint </td> |
| 203 | <td class="paramname"><em>src_step_x</em>, </td> |
| 204 | </tr> |
| 205 | <tr> |
| 206 | <td class="paramkey"></td> |
| 207 | <td></td> |
| 208 | <td class="paramtype">uint </td> |
| 209 | <td class="paramname"><em>src_stride_y</em>, </td> |
| 210 | </tr> |
| 211 | <tr> |
| 212 | <td class="paramkey"></td> |
| 213 | <td></td> |
| 214 | <td class="paramtype">uint </td> |
| 215 | <td class="paramname"><em>src_step_y</em>, </td> |
| 216 | </tr> |
| 217 | <tr> |
| 218 | <td class="paramkey"></td> |
| 219 | <td></td> |
| 220 | <td class="paramtype">uint </td> |
| 221 | <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td> |
| 222 | </tr> |
| 223 | <tr> |
| 224 | <td class="paramkey"></td> |
| 225 | <td></td> |
| 226 | <td class="paramtype">__global int * </td> |
| 227 | <td class="paramname"><em>min_max</em>, </td> |
| 228 | </tr> |
| 229 | <tr> |
| 230 | <td class="paramkey"></td> |
| 231 | <td></td> |
| 232 | <td class="paramtype">uint </td> |
| 233 | <td class="paramname"><em>width</em> </td> |
| 234 | </tr> |
| 235 | <tr> |
| 236 | <td></td> |
| 237 | <td>)</td> |
| 238 | <td></td><td></td> |
| 239 | </tr> |
| 240 | </table> |
| 241 | </div><div class="memdoc"> |
| 242 | |
| 243 | <p>This function identifies the min and maximum value of an input image. </p> |
| 244 | <dl class="section note"><dt>Note</dt><dd>Input image data type must be passed as a preprocessor argument using -DDATA_TYPE. Moreover, the minimum and maximum value of the given data type must be provided using -DDATA_TYPE_MIN and -DDATA_TYPE_MAX respectively. </dd> |
| 245 | <dd> |
| 246 | In case image width is not a multiple of 16 then -DNON_MULTIPLE_OF_16 must be passed.</dd></dl> |
| 247 | <dl class="params"><dt>Parameters</dt><dd> |
| 248 | <table class="params"> |
| 249 | <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source image. Supported data types: U8 </td></tr> |
| 250 | <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> |
| 251 | <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> |
| 252 | <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> |
| 253 | <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> |
| 254 | <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> |
| 255 | <tr><td class="paramdir">[out]</td><td class="paramname">min_max</td><td>Pointer to buffer with minimum value in position 0 and maximum value in position 1 </td></tr> |
| 256 | <tr><td class="paramdir">[in]</td><td class="paramname">width</td><td>Input image width </td></tr> |
| 257 | </table> |
| 258 | </dd> |
| 259 | </dl> |
| 260 | |
| 261 | <p>Definition at line <a class="el" href="minmaxloc_8cl_source.xhtml#l00054">54</a> of file <a class="el" href="minmaxloc_8cl_source.xhtml">minmaxloc.cl</a>.</p> |
| 262 | |
| 263 | <p>References <a class="el" href="helpers_8h_source.xhtml#l00035">CONVERT</a>, <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="minmaxloc_8cl_source.xhtml#l00037">idx16</a>, <a class="el" href="helpers_8h_source.xhtml#l00201">offset()</a>, <a class="el" href="minmaxloc_8cl_source.xhtml#l00036">type_max</a>, <a class="el" href="minmaxloc_8cl_source.xhtml#l00035">type_min</a>, and <a class="el" href="helpers_8h_source.xhtml#l00032">VEC_DATA_TYPE</a>.</p> |
| 264 | <div class="fragment"><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> {</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <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="l00060"></a><span class="lineno"> 60</span> </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="comment">// Initialize local minimum and local maximum</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 16)</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  local_min = <a class="code" href="minmaxloc_8cl.xhtml#a4464d6f922ea17b4a9ca6a2cec7ddb75">type_max</a>;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a>, 16)</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  local_max = <a class="code" href="minmaxloc_8cl.xhtml#a538b4b63f40e7b12891774e03a4f0dec">type_min</a>;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> </div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="comment">// Calculate min/max of row</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  uint width4 = width >> 4;</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  for(uint i = 0; i < width4; i++)</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  {</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(DATA_TYPE, 16)</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  data = vload16(0, (__global DATA_TYPE *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, i << 4, 0));</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  local_min = min(data, local_min);</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  local_max = max(data, local_max);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  }</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="preprocessor">#ifdef NON_MULTIPLE_OF_16</span></div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="comment">// Handle non multiple of 16</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(DATA_TYPE, 16)</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  data = vload16(0, (__global DATA_TYPE *)<a class="code" href="helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>(&src, width4 << 4, 0));</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(DATA_TYPE, 16)</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  widx = <a class="code" href="helpers_8h.xhtml#aa8d95ba04fc73845abc6045952cae5be">CONVERT</a>(((uint16)(width4 << 4) + <a class="code" href="minmaxloc_8cl.xhtml#a0712735973f172ac9efc7d48a31e47ad">idx16</a>) < width, <a class="code" href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(DATA_TYPE, 16));</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  local_max = max(local_max, select(type_min, data, widx));</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  local_min = min(local_min, select(type_max, data, widx));</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="comment">// Perform min/max reduction</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  local_min.s01234567 = min(local_min.s01234567, local_min.s89ABCDEF);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  local_max.s01234567 = max(local_max.s01234567, local_max.s89ABCDEF);</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  local_min.s0123 = min(local_min.s0123, local_min.s4567);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  local_max.s0123 = max(local_max.s0123, local_max.s4567);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  local_min.s01 = min(local_min.s01, local_min.s23);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  local_max.s01 = max(local_max.s01, local_max.s23);</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> </div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  local_min.s0 = min(local_min.s0, local_min.s1);</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  local_max.s0 = max(local_max.s0, local_max.s1);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> </div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="comment">// Update global min/max</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  atomic_min(&min_max[0], local_min.s0);</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  atomic_max(&min_max[1], local_max.s0);</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> }</div><div class="ttc" id="convolution3x3_8cl_xhtml_afb8c72ce35c4a1f4a2588d6573e54aa1"><div class="ttname"><a href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a></div><div class="ttdeci">#define DATA_TYPE</div><div class="ttdef"><b>Definition:</b> <a href="convolution3x3_8cl_source.xhtml#l00027">convolution3x3.cl:27</a></div></div> |
| 265 | <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#l00201">helpers.h:201</a></div></div> |
| 266 | <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#l00073">helpers.h:73</a></div></div> |
| 267 | <div class="ttc" id="helpers_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="helpers_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a></div><div class="ttdeci">#define VEC_DATA_TYPE(type, size)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00032">helpers.h:32</a></div></div> |
| 268 | <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#l00095">helpers.h:95</a></div></div> |
| 269 | <div class="ttc" id="minmaxloc_8cl_xhtml_a538b4b63f40e7b12891774e03a4f0dec"><div class="ttname"><a href="minmaxloc_8cl.xhtml#a538b4b63f40e7b12891774e03a4f0dec">type_min</a></div><div class="ttdeci">__constant DATA_TYPE16 type_min</div><div class="ttdef"><b>Definition:</b> <a href="minmaxloc_8cl_source.xhtml#l00035">minmaxloc.cl:35</a></div></div> |
| 270 | <div class="ttc" id="minmaxloc_8cl_xhtml_a4464d6f922ea17b4a9ca6a2cec7ddb75"><div class="ttname"><a href="minmaxloc_8cl.xhtml#a4464d6f922ea17b4a9ca6a2cec7ddb75">type_max</a></div><div class="ttdeci">__constant DATA_TYPE16 type_max</div><div class="ttdef"><b>Definition:</b> <a href="minmaxloc_8cl_source.xhtml#l00036">minmaxloc.cl:36</a></div></div> |
| 271 | <div class="ttc" id="minmaxloc_8cl_xhtml_a0712735973f172ac9efc7d48a31e47ad"><div class="ttname"><a href="minmaxloc_8cl.xhtml#a0712735973f172ac9efc7d48a31e47ad">idx16</a></div><div class="ttdeci">__constant uint16 idx16</div><div class="ttdef"><b>Definition:</b> <a href="minmaxloc_8cl_source.xhtml#l00037">minmaxloc.cl:37</a></div></div> |
| 272 | <div class="ttc" id="helpers_8h_xhtml_aa8d95ba04fc73845abc6045952cae5be"><div class="ttname"><a href="helpers_8h.xhtml#aa8d95ba04fc73845abc6045952cae5be">CONVERT</a></div><div class="ttdeci">#define CONVERT(x, type)</div><div class="ttdef"><b>Definition:</b> <a href="helpers_8h_source.xhtml#l00035">helpers.h:35</a></div></div> |
| 273 | </div><!-- fragment --> |
| 274 | </div> |
| 275 | </div> |
| 276 | <a class="anchor" id="a31ce1a75df24b2037dc76f1748236579"></a> |
| 277 | <div class="memitem"> |
| 278 | <div class="memproto"> |
| 279 | <table class="memname"> |
| 280 | <tr> |
| 281 | <td class="memname">__kernel void minmaxloc </td> |
| 282 | <td>(</td> |
| 283 | <td class="paramtype">__global uchar * </td> |
| 284 | <td class="paramname"><em>src_ptr</em>, </td> |
| 285 | </tr> |
| 286 | <tr> |
| 287 | <td class="paramkey"></td> |
| 288 | <td></td> |
| 289 | <td class="paramtype">uint </td> |
| 290 | <td class="paramname"><em>src_stride_x</em>, </td> |
| 291 | </tr> |
| 292 | <tr> |
| 293 | <td class="paramkey"></td> |
| 294 | <td></td> |
| 295 | <td class="paramtype">uint </td> |
| 296 | <td class="paramname"><em>src_step_x</em>, </td> |
| 297 | </tr> |
| 298 | <tr> |
| 299 | <td class="paramkey"></td> |
| 300 | <td></td> |
| 301 | <td class="paramtype">uint </td> |
| 302 | <td class="paramname"><em>src_stride_y</em>, </td> |
| 303 | </tr> |
| 304 | <tr> |
| 305 | <td class="paramkey"></td> |
| 306 | <td></td> |
| 307 | <td class="paramtype">uint </td> |
| 308 | <td class="paramname"><em>src_step_y</em>, </td> |
| 309 | </tr> |
| 310 | <tr> |
| 311 | <td class="paramkey"></td> |
| 312 | <td></td> |
| 313 | <td class="paramtype">uint </td> |
| 314 | <td class="paramname"><em>src_offset_first_element_in_bytes</em>, </td> |
| 315 | </tr> |
| 316 | <tr> |
| 317 | <td class="paramkey"></td> |
| 318 | <td></td> |
| 319 | <td class="paramtype">__global int * </td> |
| 320 | <td class="paramname"><em>min_max</em>, </td> |
| 321 | </tr> |
| 322 | <tr> |
| 323 | <td class="paramkey"></td> |
| 324 | <td></td> |
| 325 | <td class="paramtype">__global uint * </td> |
| 326 | <td class="paramname"><em>min_max_count</em>, </td> |
| 327 | </tr> |
| 328 | <tr> |
| 329 | <td class="paramkey"></td> |
| 330 | <td></td> |
| 331 | <td class="paramtype">__global <a class="el" href="struct_coordinates2_d.xhtml">Coordinates2D</a> * </td> |
| 332 | <td class="paramname"><em>min_loc</em>, </td> |
| 333 | </tr> |
| 334 | <tr> |
| 335 | <td class="paramkey"></td> |
| 336 | <td></td> |
| 337 | <td class="paramtype">uint </td> |
| 338 | <td class="paramname"><em>max_min_loc_count</em>, </td> |
| 339 | </tr> |
| 340 | <tr> |
| 341 | <td class="paramkey"></td> |
| 342 | <td></td> |
| 343 | <td class="paramtype">__global <a class="el" href="struct_coordinates2_d.xhtml">Coordinates2D</a> * </td> |
| 344 | <td class="paramname"><em>max_loc</em>, </td> |
| 345 | </tr> |
| 346 | <tr> |
| 347 | <td class="paramkey"></td> |
| 348 | <td></td> |
| 349 | <td class="paramtype">uint </td> |
| 350 | <td class="paramname"><em>max_max_loc_count</em> </td> |
| 351 | </tr> |
| 352 | <tr> |
| 353 | <td></td> |
| 354 | <td>)</td> |
| 355 | <td></td><td></td> |
| 356 | </tr> |
| 357 | </table> |
| 358 | </div><div class="memdoc"> |
| 359 | |
| 360 | <p>This function counts the min and max occurrences in an image and tags their position. </p> |
| 361 | <dl class="section note"><dt>Note</dt><dd>-DCOUNT_MIN_MAX should be specified if we want to count the occurrences of the minimum and maximum values. </dd> |
| 362 | <dd> |
| 363 | -DLOCATE_MIN and/or -DLOCATE_MAX should be specified if we want to store the position of each occurrence on the given array.</dd></dl> |
| 364 | <dl class="params"><dt>Parameters</dt><dd> |
| 365 | <table class="params"> |
| 366 | <tr><td class="paramdir">[in]</td><td class="paramname">src_ptr</td><td>Pointer to the source image. Supported data types: U8 </td></tr> |
| 367 | <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> |
| 368 | <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> |
| 369 | <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> |
| 370 | <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> |
| 371 | <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> |
| 372 | <tr><td class="paramdir">[in]</td><td class="paramname">min_max</td><td>Pointer to buffer with minimum value in position 0 and maximum value in position 1 </td></tr> |
| 373 | <tr><td class="paramdir">[out]</td><td class="paramname">min_max_count</td><td>Pointer to buffer with minimum value occurrences in position 0 and maximum value occurrences in position 1 </td></tr> |
| 374 | <tr><td class="paramdir">[out]</td><td class="paramname">min_loc</td><td>Array that holds the location of the minimum value occurrences </td></tr> |
| 375 | <tr><td class="paramdir">[in]</td><td class="paramname">max_min_loc_count</td><td>The maximum number of min value occurrences coordinates the array can hold </td></tr> |
| 376 | <tr><td class="paramdir">[out]</td><td class="paramname">max_loc</td><td>Array that holds the location of the maximum value occurrences </td></tr> |
| 377 | <tr><td class="paramdir">[in]</td><td class="paramname">max_max_loc_count</td><td>The maximum number of max value occurrences coordinates the array can hold </td></tr> |
| 378 | </table> |
| 379 | </dd> |
| 380 | </dl> |
| 381 | |
| 382 | <p>Definition at line <a class="el" href="minmaxloc_8cl_source.xhtml#l00123">123</a> of file <a class="el" href="minmaxloc_8cl_source.xhtml">minmaxloc.cl</a>.</p> |
| 383 | |
| 384 | <p>References <a class="el" href="helpers_8h_source.xhtml#l00073">CONVERT_TO_IMAGE_STRUCT</a>, <a class="el" href="convolution3x3_8cl_source.xhtml#l00027">DATA_TYPE</a>, and <a class="el" href="helpers_8h_source.xhtml#l00097">Image::ptr</a>.</p> |
| 385 | <div class="fragment"><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> {</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <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="l00138"></a><span class="lineno"> 138</span> </div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> value = *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)src.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> <span class="preprocessor">#if defined COUNT_MIN_MAX</span></div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keywordflow">if</span>(value == min_max[0])</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  {</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  uint idx = atomic_inc(&min_max_count[0]);</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> <span class="preprocessor">#if defined LOCATE_MIN</span></div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordflow">if</span>(idx < max_min_loc_count)</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  {</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  min_loc[idx].x = get_global_id(0);</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  min_loc[idx].y = get_global_id(1);</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  }</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  }</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keywordflow">if</span>(value == min_max[1])</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  {</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  uint idx = atomic_inc(&min_max_count[1]);</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span> <span class="preprocessor">#if defined LOCATE_MAX</span></div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keywordflow">if</span>(idx < max_max_loc_count)</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  {</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  max_loc[idx].x = get_global_id(0);</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  max_loc[idx].y = get_global_id(1);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  }</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  }</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span> }</div><div class="ttc" id="convolution3x3_8cl_xhtml_afb8c72ce35c4a1f4a2588d6573e54aa1"><div class="ttname"><a href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a></div><div class="ttdeci">#define DATA_TYPE</div><div class="ttdef"><b>Definition:</b> <a href="convolution3x3_8cl_source.xhtml#l00027">convolution3x3.cl:27</a></div></div> |
| 386 | <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#l00073">helpers.h:73</a></div></div> |
| 387 | <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#l00095">helpers.h:95</a></div></div> |
| 388 | <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#l00097">helpers.h:97</a></div></div> |
| 389 | </div><!-- fragment --> |
| 390 | </div> |
| 391 | </div> |
| 392 | <h2 class="groupheader">Variable Documentation</h2> |
| 393 | <a class="anchor" id="a0712735973f172ac9efc7d48a31e47ad"></a> |
| 394 | <div class="memitem"> |
| 395 | <div class="memproto"> |
| 396 | <table class="memname"> |
| 397 | <tr> |
| 398 | <td class="memname">__constant uint16 idx16 = (uint16)(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)</td> |
| 399 | </tr> |
| 400 | </table> |
| 401 | </div><div class="memdoc"> |
| 402 | |
| 403 | <p>Definition at line <a class="el" href="minmaxloc_8cl_source.xhtml#l00037">37</a> of file <a class="el" href="minmaxloc_8cl_source.xhtml">minmaxloc.cl</a>.</p> |
| 404 | |
| 405 | <p>Referenced by <a class="el" href="minmaxloc_8cl_source.xhtml#l00054">minmax()</a>.</p> |
| 406 | |
| 407 | </div> |
| 408 | </div> |
| 409 | <a class="anchor" id="a4464d6f922ea17b4a9ca6a2cec7ddb75"></a> |
| 410 | <div class="memitem"> |
| 411 | <div class="memproto"> |
| 412 | <table class="memname"> |
| 413 | <tr> |
| 414 | <td class="memname">__constant DATA_TYPE16 type_max = ( DATA_TYPE16 )( 0xFF )</td> |
| 415 | </tr> |
| 416 | </table> |
| 417 | </div><div class="memdoc"> |
| 418 | |
| 419 | <p>Definition at line <a class="el" href="minmaxloc_8cl_source.xhtml#l00036">36</a> of file <a class="el" href="minmaxloc_8cl_source.xhtml">minmaxloc.cl</a>.</p> |
| 420 | |
| 421 | <p>Referenced by <a class="el" href="minmaxloc_8cl_source.xhtml#l00054">minmax()</a>.</p> |
| 422 | |
| 423 | </div> |
| 424 | </div> |
| 425 | <a class="anchor" id="a538b4b63f40e7b12891774e03a4f0dec"></a> |
| 426 | <div class="memitem"> |
| 427 | <div class="memproto"> |
| 428 | <table class="memname"> |
| 429 | <tr> |
| 430 | <td class="memname">__constant DATA_TYPE16 type_min = ( DATA_TYPE16 )( 0x0 )</td> |
| 431 | </tr> |
| 432 | </table> |
| 433 | </div><div class="memdoc"> |
| 434 | |
| 435 | <p>Definition at line <a class="el" href="minmaxloc_8cl_source.xhtml#l00035">35</a> of file <a class="el" href="minmaxloc_8cl_source.xhtml">minmaxloc.cl</a>.</p> |
| 436 | |
| 437 | <p>Referenced by <a class="el" href="minmaxloc_8cl_source.xhtml#l00054">minmax()</a>.</p> |
| 438 | |
| 439 | </div> |
| 440 | </div> |
| 441 | </div><!-- contents --> |
| 442 | </div><!-- doc-content --> |
| 443 | <!-- start footer part --> |
| 444 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 445 | <ul> |
| 446 | <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="minmaxloc_8cl.xhtml">minmaxloc.cl</a></li> |
Anthony Barbier | 46d5927 | 2017-05-04 09:15:15 +0100 | [diff] [blame] | 447 | <li class="footer">Generated on Wed May 3 2017 17:20:04 for ARM Compute Library by |
Anthony Barbier | 871448e | 2017-03-24 14:54:29 +0000 | [diff] [blame] | 448 | <a href="http://www.doxygen.org/index.html"> |
| 449 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li> |
| 450 | </ul> |
| 451 | </div> |
| 452 | </body> |
| 453 | </html> |