Anthony Barbier | 8140e1e | 2017-12-14 23:48:46 +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>Compute Library: src/core/CL/cl_kernels/helpers_asymm.h 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">Compute Library |
| 43 |  <span id="projectnumber">17.12</span> |
| 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="pages.xhtml"><span>Related Pages</span></a></li> |
| 59 | <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li> |
| 60 | <li><a href="annotated.xhtml"><span>Data 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 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('helpers__asymm_8h.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)"> |
| 106 | </div> |
| 107 | |
| 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="#define-members">Macros</a> | |
| 118 | <a href="#func-members">Functions</a> </div> |
| 119 | <div class="headertitle"> |
| 120 | <div class="title">helpers_asymm.h 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 | </div> |
| 125 | <p><a href="helpers__asymm_8h_source.xhtml">Go to the source code of this file.</a></p> |
| 126 | <table class="memberdecls"> |
| 127 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> |
| 128 | Macros</h2></td></tr> |
| 129 | <tr class="memitem:abf75e242631b23007e4046682aa57ec5"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="helpers__asymm_8h.xhtml#abf75e242631b23007e4046682aa57ec5">ASYMM_ROUNDING_DIVIDE_BY_POW2_IMPL</a>(<a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>)</td></tr> |
| 130 | <tr class="memdesc:abf75e242631b23007e4046682aa57ec5"><td class="mdescLeft"> </td><td class="mdescRight">Correctly-rounded-to-nearest division by a power-of-two. <a href="#abf75e242631b23007e4046682aa57ec5">More...</a><br /></td></tr> |
| 131 | <tr class="separator:abf75e242631b23007e4046682aa57ec5"><td class="memSeparator" colspan="2"> </td></tr> |
| 132 | <tr class="memitem:aa43fc359dea64362f3016384f4269845"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="helpers__asymm_8h.xhtml#aa43fc359dea64362f3016384f4269845">ASYMM_ROUNDING_DIVIDE_BY_POW2</a>(x, exponent, <a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>)   asymm_rounding_divide_by_POW2_##<a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>(x, exponent)</td></tr> |
| 133 | <tr class="separator:aa43fc359dea64362f3016384f4269845"><td class="memSeparator" colspan="2"> </td></tr> |
| 134 | <tr class="memitem:a1e972a3d0cf4cf65b01c079b5e4ab0be"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="helpers__asymm_8h.xhtml#a1e972a3d0cf4cf65b01c079b5e4ab0be">ASYMM_MULT_IMP</a>(<a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>)</td></tr> |
| 135 | <tr class="memdesc:a1e972a3d0cf4cf65b01c079b5e4ab0be"><td class="mdescLeft"> </td><td class="mdescRight">Product of two numbers, interpreting them as fixed-point values in the interval [-1, 1), rounding to the nearest value, and saturating -1 * -1 to the maximum value. <a href="#a1e972a3d0cf4cf65b01c079b5e4ab0be">More...</a><br /></td></tr> |
| 136 | <tr class="separator:a1e972a3d0cf4cf65b01c079b5e4ab0be"><td class="memSeparator" colspan="2"> </td></tr> |
| 137 | <tr class="memitem:a5483aefd5e07244661178bfd3f434448"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="helpers__asymm_8h.xhtml#a5483aefd5e07244661178bfd3f434448">ASYMM_MULT</a>(a, b, <a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>)   <a class="el" href="asymm__helper_8h.xhtml#ab98c50e16a18dd439b2b7ecdd1ecd81c">asymm_mult</a>##<a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>(a, b)</td></tr> |
| 138 | <tr class="separator:a5483aefd5e07244661178bfd3f434448"><td class="memSeparator" colspan="2"> </td></tr> |
| 139 | <tr class="memitem:a86de0ffca367bfcf27a8ae5dd1fdef2d"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="helpers__asymm_8h.xhtml#a86de0ffca367bfcf27a8ae5dd1fdef2d">ASYMM_MULT_BY_QUANT_MULTIPLIER_LESS_THAN_ONE</a>(x, quantized_multiplier, right_shift, <a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>)   <a class="el" href="helpers__asymm_8h.xhtml#aa43fc359dea64362f3016384f4269845">ASYMM_ROUNDING_DIVIDE_BY_POW2</a>(<a class="el" href="helpers__asymm_8h.xhtml#a5483aefd5e07244661178bfd3f434448">ASYMM_MULT</a>(x, quantized_multiplier, <a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>), right_shift, <a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>)</td></tr> |
| 140 | <tr class="separator:a86de0ffca367bfcf27a8ae5dd1fdef2d"><td class="memSeparator" colspan="2"> </td></tr> |
| 141 | </table><table class="memberdecls"> |
| 142 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 143 | Functions</h2></td></tr> |
| 144 | <tr class="memitem:ae62b2416b40ca28724c065e95e18a25b"><td class="memItemLeft" align="right" valign="top">int2 </td><td class="memItemRight" valign="bottom"><a class="el" href="helpers__asymm_8h.xhtml#ae62b2416b40ca28724c065e95e18a25b">asymm_rounding_divide_by_POW2_2</a> (int2 x, int exponent)</td></tr> |
| 145 | <tr class="separator:ae62b2416b40ca28724c065e95e18a25b"><td class="memSeparator" colspan="2"> </td></tr> |
| 146 | <tr class="memitem:a38afb1b30447264fd62ca7ad86e7ea19"><td class="memItemLeft" align="right" valign="top">int8 </td><td class="memItemRight" valign="bottom"><a class="el" href="helpers__asymm_8h.xhtml#a38afb1b30447264fd62ca7ad86e7ea19">asymm_rounding_divide_by_POW2_8</a> (int8 x, int exponent)</td></tr> |
| 147 | <tr class="separator:a38afb1b30447264fd62ca7ad86e7ea19"><td class="memSeparator" colspan="2"> </td></tr> |
| 148 | <tr class="memitem:a21d65cd6ac14696d58509b82789db845"><td class="memItemLeft" align="right" valign="top">int16 </td><td class="memItemRight" valign="bottom"><a class="el" href="helpers__asymm_8h.xhtml#a21d65cd6ac14696d58509b82789db845">asymm_rounding_divide_by_POW2_16</a> (int16 x, int exponent)</td></tr> |
| 149 | <tr class="separator:a21d65cd6ac14696d58509b82789db845"><td class="memSeparator" colspan="2"> </td></tr> |
| 150 | <tr class="memitem:a5038b78913b76d782cc0aa0d841bd7ed"><td class="memItemLeft" align="right" valign="top">int2 </td><td class="memItemRight" valign="bottom"><a class="el" href="helpers__asymm_8h.xhtml#a5038b78913b76d782cc0aa0d841bd7ed">asymm_mult2</a> (int2 a, int2 b)</td></tr> |
| 151 | <tr class="separator:a5038b78913b76d782cc0aa0d841bd7ed"><td class="memSeparator" colspan="2"> </td></tr> |
| 152 | <tr class="memitem:a165b0bbab841712ea2c9a17a09bfa166"><td class="memItemLeft" align="right" valign="top">int8 </td><td class="memItemRight" valign="bottom"><a class="el" href="helpers__asymm_8h.xhtml#a165b0bbab841712ea2c9a17a09bfa166">asymm_mult8</a> (int8 a, int8 b)</td></tr> |
| 153 | <tr class="separator:a165b0bbab841712ea2c9a17a09bfa166"><td class="memSeparator" colspan="2"> </td></tr> |
| 154 | <tr class="memitem:aef32e3a9c804f145deb6b88f0a444919"><td class="memItemLeft" align="right" valign="top">int16 </td><td class="memItemRight" valign="bottom"><a class="el" href="helpers__asymm_8h.xhtml#aef32e3a9c804f145deb6b88f0a444919">asymm_mult16</a> (int16 a, int16 b)</td></tr> |
| 155 | <tr class="separator:aef32e3a9c804f145deb6b88f0a444919"><td class="memSeparator" colspan="2"> </td></tr> |
| 156 | </table> |
| 157 | <h2 class="groupheader">Macro Definition Documentation</h2> |
| 158 | <a class="anchor" id="a5483aefd5e07244661178bfd3f434448"></a> |
| 159 | <div class="memitem"> |
| 160 | <div class="memproto"> |
| 161 | <table class="memname"> |
| 162 | <tr> |
| 163 | <td class="memname">#define ASYMM_MULT</td> |
| 164 | <td>(</td> |
| 165 | <td class="paramtype"> </td> |
| 166 | <td class="paramname">a, </td> |
| 167 | </tr> |
| 168 | <tr> |
| 169 | <td class="paramkey"></td> |
| 170 | <td></td> |
| 171 | <td class="paramtype"> </td> |
| 172 | <td class="paramname">b, </td> |
| 173 | </tr> |
| 174 | <tr> |
| 175 | <td class="paramkey"></td> |
| 176 | <td></td> |
| 177 | <td class="paramtype"> </td> |
| 178 | <td class="paramname"><a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a> </td> |
| 179 | </tr> |
| 180 | <tr> |
| 181 | <td></td> |
| 182 | <td>)</td> |
| 183 | <td></td><td>   <a class="el" href="asymm__helper_8h.xhtml#ab98c50e16a18dd439b2b7ecdd1ecd81c">asymm_mult</a>##<a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>(a, b)</td> |
| 184 | </tr> |
| 185 | </table> |
| 186 | </div><div class="memdoc"> |
| 187 | |
| 188 | <p>Definition at line <a class="el" href="helpers__asymm_8h_source.xhtml#l00088">88</a> of file <a class="el" href="helpers__asymm_8h_source.xhtml">helpers_asymm.h</a>.</p> |
| 189 | |
| 190 | </div> |
| 191 | </div> |
| 192 | <a class="anchor" id="a86de0ffca367bfcf27a8ae5dd1fdef2d"></a> |
| 193 | <div class="memitem"> |
| 194 | <div class="memproto"> |
| 195 | <table class="memname"> |
| 196 | <tr> |
| 197 | <td class="memname">#define ASYMM_MULT_BY_QUANT_MULTIPLIER_LESS_THAN_ONE</td> |
| 198 | <td>(</td> |
| 199 | <td class="paramtype"> </td> |
| 200 | <td class="paramname">x, </td> |
| 201 | </tr> |
| 202 | <tr> |
| 203 | <td class="paramkey"></td> |
| 204 | <td></td> |
| 205 | <td class="paramtype"> </td> |
| 206 | <td class="paramname">quantized_multiplier, </td> |
| 207 | </tr> |
| 208 | <tr> |
| 209 | <td class="paramkey"></td> |
| 210 | <td></td> |
| 211 | <td class="paramtype"> </td> |
| 212 | <td class="paramname">right_shift, </td> |
| 213 | </tr> |
| 214 | <tr> |
| 215 | <td class="paramkey"></td> |
| 216 | <td></td> |
| 217 | <td class="paramtype"> </td> |
| 218 | <td class="paramname"><a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a> </td> |
| 219 | </tr> |
| 220 | <tr> |
| 221 | <td></td> |
| 222 | <td>)</td> |
| 223 | <td></td><td>   <a class="el" href="helpers__asymm_8h.xhtml#aa43fc359dea64362f3016384f4269845">ASYMM_ROUNDING_DIVIDE_BY_POW2</a>(<a class="el" href="helpers__asymm_8h.xhtml#a5483aefd5e07244661178bfd3f434448">ASYMM_MULT</a>(x, quantized_multiplier, <a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>), right_shift, <a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>)</td> |
| 224 | </tr> |
| 225 | </table> |
| 226 | </div><div class="memdoc"> |
| 227 | |
| 228 | <p>Definition at line <a class="el" href="helpers__asymm_8h_source.xhtml#l00090">90</a> of file <a class="el" href="helpers__asymm_8h_source.xhtml">helpers_asymm.h</a>.</p> |
| 229 | |
| 230 | </div> |
| 231 | </div> |
| 232 | <a class="anchor" id="a1e972a3d0cf4cf65b01c079b5e4ab0be"></a> |
| 233 | <div class="memitem"> |
| 234 | <div class="memproto"> |
| 235 | <table class="memname"> |
| 236 | <tr> |
| 237 | <td class="memname">#define ASYMM_MULT_IMP</td> |
| 238 | <td>(</td> |
| 239 | <td class="paramtype"> </td> |
| 240 | <td class="paramname"><a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a></td><td>)</td> |
| 241 | <td></td> |
| 242 | </tr> |
| 243 | </table> |
| 244 | </div><div class="memdoc"> |
| 245 | <b>Value:</b><div class="fragment"><div class="line"><span class="keyword">inline</span> <a class="code" href="fixed__point_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<span class="keywordtype">int</span>, <a class="code" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>) <a class="code" href="asymm__helper_8h.xhtml#ab98c50e16a18dd439b2b7ecdd1ecd81c">asymm_mult</a><span class="preprocessor">##size(VEC_DATA_TYPE(int, size) a, VEC_DATA_TYPE(int, size) b) \</span></div><div class="line"><span class="preprocessor"> { \</span></div><div class="line"><span class="preprocessor"> VEC_DATA_TYPE(int, size) \</span></div><div class="line"><span class="preprocessor"> overflow = a == b && a == INT_MIN; \</span></div><div class="line"><span class="preprocessor"> VEC_DATA_TYPE(long, size) \</span></div><div class="line"><span class="preprocessor"> a_64 = convert_long##size(a); \</span></div><div class="line"><span class="preprocessor"> VEC_DATA_TYPE(long, size) \</span></div><div class="line"><span class="preprocessor"> b_64 = convert_long##size(b); \</span></div><div class="line"><span class="preprocessor"> VEC_DATA_TYPE(long, size) \</span></div><div class="line"><span class="preprocessor"> ab_64 = a_64 * b_64; \</span></div><div class="line"><span class="preprocessor"> VEC_DATA_TYPE(long, size) \</span></div><div class="line"><span class="preprocessor"> mask1 = 1 << 30; \</span></div><div class="line"><span class="preprocessor"> VEC_DATA_TYPE(long, size) \</span></div><div class="line"><span class="preprocessor"> mask2 = 1 - (1 << 30); \</span></div><div class="line"><span class="preprocessor"> VEC_DATA_TYPE(long, size) \</span></div><div class="line"><span class="preprocessor"> nudge = select(mask2, mask1, ab_64 >= 0); \</span></div><div class="line"><span class="preprocessor"> VEC_DATA_TYPE(long, size) \</span></div><div class="line"><span class="preprocessor"> mask = 1ll << 31; \</span></div><div class="line"><span class="preprocessor"> VEC_DATA_TYPE(int, size) \</span></div><div class="line"><span class="preprocessor"> ab_x2_high32 = convert_int##size((ab_64 + nudge) / mask); \</span></div><div class="line"><span class="preprocessor"> return select(ab_x2_high32, INT_MAX, overflow); \</span></div><div class="line"><span class="preprocessor"> }</span></div><div class="ttc" id="asymm__helper_8h_xhtml_ab98c50e16a18dd439b2b7ecdd1ecd81c"><div class="ttname"><a href="asymm__helper_8h.xhtml#ab98c50e16a18dd439b2b7ecdd1ecd81c">asymm_mult</a></div><div class="ttdeci">int16 asymm_mult(int16 a, int16 b)</div><div class="ttdoc">Fixed-point multiplication. </div><div class="ttdef"><b>Definition:</b> <a href="asymm__helper_8h_source.xhtml#l00167">asymm_helper.h:167</a></div></div> |
| 246 | <div class="ttc" id="hwc_8hpp_xhtml_ab2c6b258f02add8fdf4cfc7c371dd772"><div class="ttname"><a href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a></div><div class="ttdeci">uint32_t size</div><div class="ttdef"><b>Definition:</b> <a href="hwc_8hpp_source.xhtml#l00276">hwc.hpp:276</a></div></div> |
| 247 | <div class="ttc" id="fixed__point_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="fixed__point_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="fixed__point_8h_source.xhtml#l00093">fixed_point.h:93</a></div></div> |
| 248 | </div><!-- fragment --> |
| 249 | <p>Product of two numbers, interpreting them as fixed-point values in the interval [-1, 1), rounding to the nearest value, and saturating -1 * -1 to the maximum value. </p> |
| 250 | <dl class="params"><dt>Parameters</dt><dd> |
| 251 | <table class="params"> |
| 252 | <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size of vector.</td></tr> |
| 253 | </table> |
| 254 | </dd> |
| 255 | </dl> |
| 256 | <dl class="section return"><dt>Returns</dt><dd>Product of two fixed-point numbers. </dd></dl> |
| 257 | |
| 258 | <p>Definition at line <a class="el" href="helpers__asymm_8h_source.xhtml#l00060">60</a> of file <a class="el" href="helpers__asymm_8h_source.xhtml">helpers_asymm.h</a>.</p> |
| 259 | |
| 260 | </div> |
| 261 | </div> |
| 262 | <a class="anchor" id="aa43fc359dea64362f3016384f4269845"></a> |
| 263 | <div class="memitem"> |
| 264 | <div class="memproto"> |
| 265 | <table class="memname"> |
| 266 | <tr> |
| 267 | <td class="memname">#define ASYMM_ROUNDING_DIVIDE_BY_POW2</td> |
| 268 | <td>(</td> |
| 269 | <td class="paramtype"> </td> |
| 270 | <td class="paramname">x, </td> |
| 271 | </tr> |
| 272 | <tr> |
| 273 | <td class="paramkey"></td> |
| 274 | <td></td> |
| 275 | <td class="paramtype"> </td> |
| 276 | <td class="paramname">exponent, </td> |
| 277 | </tr> |
| 278 | <tr> |
| 279 | <td class="paramkey"></td> |
| 280 | <td></td> |
| 281 | <td class="paramtype"> </td> |
| 282 | <td class="paramname"><a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a> </td> |
| 283 | </tr> |
| 284 | <tr> |
| 285 | <td></td> |
| 286 | <td>)</td> |
| 287 | <td></td><td>   asymm_rounding_divide_by_POW2_##<a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>(x, exponent)</td> |
| 288 | </tr> |
| 289 | </table> |
| 290 | </div><div class="memdoc"> |
| 291 | |
| 292 | <p>Definition at line <a class="el" href="helpers__asymm_8h_source.xhtml#l00051">51</a> of file <a class="el" href="helpers__asymm_8h_source.xhtml">helpers_asymm.h</a>.</p> |
| 293 | |
| 294 | </div> |
| 295 | </div> |
| 296 | <a class="anchor" id="abf75e242631b23007e4046682aa57ec5"></a> |
| 297 | <div class="memitem"> |
| 298 | <div class="memproto"> |
| 299 | <table class="memname"> |
| 300 | <tr> |
| 301 | <td class="memname">#define ASYMM_ROUNDING_DIVIDE_BY_POW2_IMPL</td> |
| 302 | <td>(</td> |
| 303 | <td class="paramtype"> </td> |
| 304 | <td class="paramname"><a class="el" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a></td><td>)</td> |
| 305 | <td></td> |
| 306 | </tr> |
| 307 | </table> |
| 308 | </div><div class="memdoc"> |
| 309 | <b>Value:</b><div class="fragment"><div class="line"><span class="keyword">inline</span> <a class="code" href="fixed__point_8h.xhtml#a36f754c05b6fddf6df0d8d0a74f8159f">VEC_DATA_TYPE</a>(<span class="keywordtype">int</span>, <a class="code" href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a>) asymm_rounding_divide_by_POW2_<span class="preprocessor">##size(VEC_DATA_TYPE(int, size) x, int exponent) \</span></div><div class="line"><span class="preprocessor"> { \</span></div><div class="line"><span class="preprocessor"> VEC_DATA_TYPE(int, size) \</span></div><div class="line"><span class="preprocessor"> mask = (1 << exponent) - 1; \</span></div><div class="line"><span class="preprocessor"> const VEC_DATA_TYPE(int, size) zero = 0; \</span></div><div class="line"><span class="preprocessor"> const VEC_DATA_TYPE(int, size) one = 1; \</span></div><div class="line"><span class="preprocessor"> VEC_DATA_TYPE(int, size) \</span></div><div class="line"><span class="preprocessor"> threshold = (mask >> 1) + select(zero, one, x < 0); \</span></div><div class="line"><span class="preprocessor"> return (x >> exponent) + select(zero, one, (x & mask) > threshold); \</span></div><div class="line"><span class="preprocessor"> }</span></div><div class="ttc" id="hwc_8hpp_xhtml_ab2c6b258f02add8fdf4cfc7c371dd772"><div class="ttname"><a href="hwc_8hpp.xhtml#ab2c6b258f02add8fdf4cfc7c371dd772">size</a></div><div class="ttdeci">uint32_t size</div><div class="ttdef"><b>Definition:</b> <a href="hwc_8hpp_source.xhtml#l00276">hwc.hpp:276</a></div></div> |
| 310 | <div class="ttc" id="fixed__point_8h_xhtml_a36f754c05b6fddf6df0d8d0a74f8159f"><div class="ttname"><a href="fixed__point_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="fixed__point_8h_source.xhtml#l00093">fixed_point.h:93</a></div></div> |
| 311 | </div><!-- fragment --> |
| 312 | <p>Correctly-rounded-to-nearest division by a power-of-two. </p> |
| 313 | <dl class="params"><dt>Parameters</dt><dd> |
| 314 | <table class="params"> |
| 315 | <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size of vector.</td></tr> |
| 316 | </table> |
| 317 | </dd> |
| 318 | </dl> |
| 319 | <dl class="section return"><dt>Returns</dt><dd>Correctly-rounded-to-nearest division by a power-of-two. </dd></dl> |
| 320 | |
| 321 | <p>Definition at line <a class="el" href="helpers__asymm_8h_source.xhtml#l00035">35</a> of file <a class="el" href="helpers__asymm_8h_source.xhtml">helpers_asymm.h</a>.</p> |
| 322 | |
| 323 | </div> |
| 324 | </div> |
| 325 | <h2 class="groupheader">Function Documentation</h2> |
| 326 | <a class="anchor" id="aef32e3a9c804f145deb6b88f0a444919"></a> |
| 327 | <div class="memitem"> |
| 328 | <div class="memproto"> |
| 329 | <table class="mlabels"> |
| 330 | <tr> |
| 331 | <td class="mlabels-left"> |
| 332 | <table class="memname"> |
| 333 | <tr> |
| 334 | <td class="memname">int16 asymm_mult16 </td> |
| 335 | <td>(</td> |
| 336 | <td class="paramtype">int16 </td> |
| 337 | <td class="paramname"><em>a</em>, </td> |
| 338 | </tr> |
| 339 | <tr> |
| 340 | <td class="paramkey"></td> |
| 341 | <td></td> |
| 342 | <td class="paramtype">int16 </td> |
| 343 | <td class="paramname"><em>b</em> </td> |
| 344 | </tr> |
| 345 | <tr> |
| 346 | <td></td> |
| 347 | <td>)</td> |
| 348 | <td></td><td></td> |
| 349 | </tr> |
| 350 | </table> |
| 351 | </td> |
| 352 | <td class="mlabels-right"> |
| 353 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 354 | </tr> |
| 355 | </table> |
| 356 | </div><div class="memdoc"> |
| 357 | |
| 358 | <p>Definition at line <a class="el" href="helpers__asymm_8h_source.xhtml#l00086">86</a> of file <a class="el" href="helpers__asymm_8h_source.xhtml">helpers_asymm.h</a>.</p> |
| 359 | |
| 360 | </div> |
| 361 | </div> |
| 362 | <a class="anchor" id="a5038b78913b76d782cc0aa0d841bd7ed"></a> |
| 363 | <div class="memitem"> |
| 364 | <div class="memproto"> |
| 365 | <table class="mlabels"> |
| 366 | <tr> |
| 367 | <td class="mlabels-left"> |
| 368 | <table class="memname"> |
| 369 | <tr> |
| 370 | <td class="memname">int2 asymm_mult2 </td> |
| 371 | <td>(</td> |
| 372 | <td class="paramtype">int2 </td> |
| 373 | <td class="paramname"><em>a</em>, </td> |
| 374 | </tr> |
| 375 | <tr> |
| 376 | <td class="paramkey"></td> |
| 377 | <td></td> |
| 378 | <td class="paramtype">int2 </td> |
| 379 | <td class="paramname"><em>b</em> </td> |
| 380 | </tr> |
| 381 | <tr> |
| 382 | <td></td> |
| 383 | <td>)</td> |
| 384 | <td></td><td></td> |
| 385 | </tr> |
| 386 | </table> |
| 387 | </td> |
| 388 | <td class="mlabels-right"> |
| 389 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 390 | </tr> |
| 391 | </table> |
| 392 | </div><div class="memdoc"> |
| 393 | |
| 394 | <p>Definition at line <a class="el" href="helpers__asymm_8h_source.xhtml#l00084">84</a> of file <a class="el" href="helpers__asymm_8h_source.xhtml">helpers_asymm.h</a>.</p> |
| 395 | |
| 396 | </div> |
| 397 | </div> |
| 398 | <a class="anchor" id="a165b0bbab841712ea2c9a17a09bfa166"></a> |
| 399 | <div class="memitem"> |
| 400 | <div class="memproto"> |
| 401 | <table class="mlabels"> |
| 402 | <tr> |
| 403 | <td class="mlabels-left"> |
| 404 | <table class="memname"> |
| 405 | <tr> |
| 406 | <td class="memname">int8 asymm_mult8 </td> |
| 407 | <td>(</td> |
| 408 | <td class="paramtype">int8 </td> |
| 409 | <td class="paramname"><em>a</em>, </td> |
| 410 | </tr> |
| 411 | <tr> |
| 412 | <td class="paramkey"></td> |
| 413 | <td></td> |
| 414 | <td class="paramtype">int8 </td> |
| 415 | <td class="paramname"><em>b</em> </td> |
| 416 | </tr> |
| 417 | <tr> |
| 418 | <td></td> |
| 419 | <td>)</td> |
| 420 | <td></td><td></td> |
| 421 | </tr> |
| 422 | </table> |
| 423 | </td> |
| 424 | <td class="mlabels-right"> |
| 425 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 426 | </tr> |
| 427 | </table> |
| 428 | </div><div class="memdoc"> |
| 429 | |
| 430 | <p>Definition at line <a class="el" href="helpers__asymm_8h_source.xhtml#l00085">85</a> of file <a class="el" href="helpers__asymm_8h_source.xhtml">helpers_asymm.h</a>.</p> |
| 431 | |
| 432 | </div> |
| 433 | </div> |
| 434 | <a class="anchor" id="a21d65cd6ac14696d58509b82789db845"></a> |
| 435 | <div class="memitem"> |
| 436 | <div class="memproto"> |
| 437 | <table class="mlabels"> |
| 438 | <tr> |
| 439 | <td class="mlabels-left"> |
| 440 | <table class="memname"> |
| 441 | <tr> |
| 442 | <td class="memname">int16 asymm_rounding_divide_by_POW2_16 </td> |
| 443 | <td>(</td> |
| 444 | <td class="paramtype">int16 </td> |
| 445 | <td class="paramname"><em>x</em>, </td> |
| 446 | </tr> |
| 447 | <tr> |
| 448 | <td class="paramkey"></td> |
| 449 | <td></td> |
| 450 | <td class="paramtype">int </td> |
| 451 | <td class="paramname"><em>exponent</em> </td> |
| 452 | </tr> |
| 453 | <tr> |
| 454 | <td></td> |
| 455 | <td>)</td> |
| 456 | <td></td><td></td> |
| 457 | </tr> |
| 458 | </table> |
| 459 | </td> |
| 460 | <td class="mlabels-right"> |
| 461 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 462 | </tr> |
| 463 | </table> |
| 464 | </div><div class="memdoc"> |
| 465 | |
| 466 | <p>Definition at line <a class="el" href="helpers__asymm_8h_source.xhtml#l00049">49</a> of file <a class="el" href="helpers__asymm_8h_source.xhtml">helpers_asymm.h</a>.</p> |
| 467 | <div class="fragment"><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> { \</div></div><!-- fragment --> |
| 468 | </div> |
| 469 | </div> |
| 470 | <a class="anchor" id="ae62b2416b40ca28724c065e95e18a25b"></a> |
| 471 | <div class="memitem"> |
| 472 | <div class="memproto"> |
| 473 | <table class="mlabels"> |
| 474 | <tr> |
| 475 | <td class="mlabels-left"> |
| 476 | <table class="memname"> |
| 477 | <tr> |
| 478 | <td class="memname">int2 asymm_rounding_divide_by_POW2_2 </td> |
| 479 | <td>(</td> |
| 480 | <td class="paramtype">int2 </td> |
| 481 | <td class="paramname"><em>x</em>, </td> |
| 482 | </tr> |
| 483 | <tr> |
| 484 | <td class="paramkey"></td> |
| 485 | <td></td> |
| 486 | <td class="paramtype">int </td> |
| 487 | <td class="paramname"><em>exponent</em> </td> |
| 488 | </tr> |
| 489 | <tr> |
| 490 | <td></td> |
| 491 | <td>)</td> |
| 492 | <td></td><td></td> |
| 493 | </tr> |
| 494 | </table> |
| 495 | </td> |
| 496 | <td class="mlabels-right"> |
| 497 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 498 | </tr> |
| 499 | </table> |
| 500 | </div><div class="memdoc"> |
| 501 | |
| 502 | <p>Definition at line <a class="el" href="helpers__asymm_8h_source.xhtml#l00047">47</a> of file <a class="el" href="helpers__asymm_8h_source.xhtml">helpers_asymm.h</a>.</p> |
| 503 | <div class="fragment"><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> { \</div></div><!-- fragment --> |
| 504 | </div> |
| 505 | </div> |
| 506 | <a class="anchor" id="a38afb1b30447264fd62ca7ad86e7ea19"></a> |
| 507 | <div class="memitem"> |
| 508 | <div class="memproto"> |
| 509 | <table class="mlabels"> |
| 510 | <tr> |
| 511 | <td class="mlabels-left"> |
| 512 | <table class="memname"> |
| 513 | <tr> |
| 514 | <td class="memname">int8 asymm_rounding_divide_by_POW2_8 </td> |
| 515 | <td>(</td> |
| 516 | <td class="paramtype">int8 </td> |
| 517 | <td class="paramname"><em>x</em>, </td> |
| 518 | </tr> |
| 519 | <tr> |
| 520 | <td class="paramkey"></td> |
| 521 | <td></td> |
| 522 | <td class="paramtype">int </td> |
| 523 | <td class="paramname"><em>exponent</em> </td> |
| 524 | </tr> |
| 525 | <tr> |
| 526 | <td></td> |
| 527 | <td>)</td> |
| 528 | <td></td><td></td> |
| 529 | </tr> |
| 530 | </table> |
| 531 | </td> |
| 532 | <td class="mlabels-right"> |
| 533 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 534 | </tr> |
| 535 | </table> |
| 536 | </div><div class="memdoc"> |
| 537 | |
| 538 | <p>Definition at line <a class="el" href="helpers__asymm_8h_source.xhtml#l00048">48</a> of file <a class="el" href="helpers__asymm_8h_source.xhtml">helpers_asymm.h</a>.</p> |
| 539 | <div class="fragment"><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> { \</div></div><!-- fragment --> |
| 540 | </div> |
| 541 | </div> |
| 542 | </div><!-- contents --> |
| 543 | </div><!-- doc-content --> |
| 544 | <!-- start footer part --> |
| 545 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 546 | <ul> |
| 547 | <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="helpers__asymm_8h.xhtml">helpers_asymm.h</a></li> |
| 548 | <li class="footer">Generated on Thu Dec 14 2017 23:48:34 for Compute Library by |
| 549 | <a href="http://www.doxygen.org/index.html"> |
| 550 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li> |
| 551 | </ul> |
| 552 | </div> |
| 553 | </body> |
| 554 | </html> |