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">
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: CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint Class 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);
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(); });
27 <script type="text/x-mathjax-config">
29 extensions: ["tex2jax.js"],
30 jax: ["input/TeX","output/HTML-CSS"],
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" />
36 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
38 <table cellspacing="0" cellpadding="0">
40 <tr style="height: 56px;">
41 <td style="padding-left: 0.5em;">
42 <div id="projectname">Compute Library
43  <span id="projectnumber">18.03</span>
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');
55 <div id="navrow1" class="tabs">
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 class="current"><a href="annotated.xhtml"><span>Data Structures</span></a></li>
61 <li><a href="files.xhtml"><span>Files</span></a></li>
63 <div id="MSearchBox" class="MSearchBoxInactive">
65 <img id="MSearchSelect" src="search/mag_sel.png"
66 onmouseover="return searchBox.OnSearchSelectShow()"
67 onmouseout="return searchBox.OnSearchSelectHide()"
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>
80 <div id="navrow2" class="tabs2">
82 <li><a href="annotated.xhtml"><span>Data Structures</span></a></li>
83 <li><a href="classes.xhtml"><span>Data Structure Index</span></a></li>
84 <li><a href="inherits.xhtml"><span>Class Hierarchy</span></a></li>
85 <li><a href="functions.xhtml"><span>Data Fields</span></a></li>
89 <div id="side-nav" class="ui-resizable side-nav-resizable">
91 <div id="nav-tree-contents">
92 <div id="nav-sync" class="sync"></div>
95 <div id="splitbar" style="-moz-user-select:none;"
96 class="ui-resizable-handle">
99 <script type="text/javascript">
100 $(document).ready(function(){initNavTree('classarm__compute_1_1_c_l_g_e_m_m_lowp_quantize_down_int32_to_uint8_scale_by_fixed_point.xhtml','');});
102 <div id="doc-content">
103 <!-- window showing the filter options -->
104 <div id="MSearchSelectWindow"
105 onmouseover="return searchBox.OnSearchSelectShow()"
106 onmouseout="return searchBox.OnSearchSelectHide()"
107 onkeydown="return searchBox.OnSearchSelectKey(event)">
110 <!-- iframe showing the search results (closed by default) -->
111 <div id="MSearchResultsWindow">
112 <iframe src="javascript:void(0)" frameborder="0"
113 name="MSearchResults" id="MSearchResults">
118 <div class="summary">
119 <a href="#pub-methods">Public Member Functions</a> |
120 <a href="#pub-static-methods">Static Public Member Functions</a> </div>
121 <div class="headertitle">
122 <div class="title">CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint Class Reference</div> </div>
124 <div class="contents">
126 <p>Basic function to execute <a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_lowp_quantize_down_int32_to_uint8_scale_by_fixed_point.xhtml" title="Basic function to execute CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint on OpenCL. ">CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint</a> on OpenCL.
127 <a href="classarm__compute_1_1_c_l_g_e_m_m_lowp_quantize_down_int32_to_uint8_scale_by_fixed_point.xhtml#details">More...</a></p>
129 <p><code>#include <<a class="el" href="_c_l_g_e_m_m_lowp_output_stage_8h_source.xhtml">CLGEMMLowpOutputStage.h</a>></code></p>
130 <div class="dynheader">
131 Collaboration diagram for CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint:</div>
132 <div class="dyncontent">
133 <div class="center"><iframe scrolling="no" frameborder="0" src="classarm__compute_1_1_c_l_g_e_m_m_lowp_quantize_down_int32_to_uint8_scale_by_fixed_point__coll__graph.svg" width="246" height="202"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
135 <center><span class="legend">[<a target="top" href="graph_legend.xhtml">legend</a>]</span></center></div>
136 <table class="memberdecls">
137 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
138 Public Member Functions</h2></td></tr>
139 <tr class="memitem:a15da37f661fdcd81c1f25c5d6bdc6abd"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_lowp_quantize_down_int32_to_uint8_scale_by_fixed_point.xhtml#a15da37f661fdcd81c1f25c5d6bdc6abd">configure</a> (const <a class="el" href="classarm__compute_1_1_i_c_l_tensor.xhtml">ICLTensor</a> *input, const <a class="el" href="classarm__compute_1_1_i_c_l_tensor.xhtml">ICLTensor</a> *bias, <a class="el" href="classarm__compute_1_1_i_c_l_tensor.xhtml">ICLTensor</a> *output, int result_fixedpoint_multiplier, int result_shift, int result_offset_after_shift, int min=0, int max=0)</td></tr>
140 <tr class="memdesc:a15da37f661fdcd81c1f25c5d6bdc6abd"><td class="mdescLeft"> </td><td class="mdescRight">Initialise the kernel's inputs, output. <a href="#a15da37f661fdcd81c1f25c5d6bdc6abd">More...</a><br /></td></tr>
141 <tr class="separator:a15da37f661fdcd81c1f25c5d6bdc6abd"><td class="memSeparator" colspan="2"> </td></tr>
142 <tr class="inherit_header pub_methods_classarm__compute_1_1_i_c_l_simple_function"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classarm__compute_1_1_i_c_l_simple_function')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classarm__compute_1_1_i_c_l_simple_function.xhtml">ICLSimpleFunction</a></td></tr>
143 <tr class="memitem:aa8149af857c4bface8ad712e418a63f1 inherit pub_methods_classarm__compute_1_1_i_c_l_simple_function"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_i_c_l_simple_function.xhtml#aa8149af857c4bface8ad712e418a63f1">ICLSimpleFunction</a> ()</td></tr>
144 <tr class="memdesc:aa8149af857c4bface8ad712e418a63f1 inherit pub_methods_classarm__compute_1_1_i_c_l_simple_function"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#aa8149af857c4bface8ad712e418a63f1">More...</a><br /></td></tr>
145 <tr class="separator:aa8149af857c4bface8ad712e418a63f1 inherit pub_methods_classarm__compute_1_1_i_c_l_simple_function"><td class="memSeparator" colspan="2"> </td></tr>
146 <tr class="memitem:ab5fd6e96c07aaaed2747c7e16ed5951e inherit pub_methods_classarm__compute_1_1_i_c_l_simple_function"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_i_c_l_simple_function.xhtml#ab5fd6e96c07aaaed2747c7e16ed5951e">run</a> () overridefinal</td></tr>
147 <tr class="memdesc:ab5fd6e96c07aaaed2747c7e16ed5951e inherit pub_methods_classarm__compute_1_1_i_c_l_simple_function"><td class="mdescLeft"> </td><td class="mdescRight">Run the kernels contained in the function. <a href="#ab5fd6e96c07aaaed2747c7e16ed5951e">More...</a><br /></td></tr>
148 <tr class="separator:ab5fd6e96c07aaaed2747c7e16ed5951e inherit pub_methods_classarm__compute_1_1_i_c_l_simple_function"><td class="memSeparator" colspan="2"> </td></tr>
149 <tr class="inherit_header pub_methods_classarm__compute_1_1_i_function"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classarm__compute_1_1_i_function')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="classarm__compute_1_1_i_function.xhtml">IFunction</a></td></tr>
150 <tr class="memitem:ab921ecc3f3f6ae2b4bd61f3e1998d8c4 inherit pub_methods_classarm__compute_1_1_i_function"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_i_function.xhtml#ab921ecc3f3f6ae2b4bd61f3e1998d8c4">~IFunction</a> ()=default</td></tr>
151 <tr class="memdesc:ab921ecc3f3f6ae2b4bd61f3e1998d8c4 inherit pub_methods_classarm__compute_1_1_i_function"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#ab921ecc3f3f6ae2b4bd61f3e1998d8c4">More...</a><br /></td></tr>
152 <tr class="separator:ab921ecc3f3f6ae2b4bd61f3e1998d8c4 inherit pub_methods_classarm__compute_1_1_i_function"><td class="memSeparator" colspan="2"> </td></tr>
153 </table><table class="memberdecls">
154 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
155 Static Public Member Functions</h2></td></tr>
156 <tr class="memitem:ae91454a1d9774df968cdd3694b366ddf"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classarm__compute_1_1_status.xhtml">Status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_lowp_quantize_down_int32_to_uint8_scale_by_fixed_point.xhtml#ae91454a1d9774df968cdd3694b366ddf">validate</a> (const <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml">ITensorInfo</a> *input, const <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml">ITensorInfo</a> *bias, const <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml">ITensorInfo</a> *output, int min=0, int max=0)</td></tr>
157 <tr class="memdesc:ae91454a1d9774df968cdd3694b366ddf"><td class="mdescLeft"> </td><td class="mdescRight">Static function to check if given info will lead to a valid configuration of <a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_lowp_quantize_down_int32_to_uint8_scale_by_fixed_point.xhtml">CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint</a>. <a href="#ae91454a1d9774df968cdd3694b366ddf">More...</a><br /></td></tr>
158 <tr class="separator:ae91454a1d9774df968cdd3694b366ddf"><td class="memSeparator" colspan="2"> </td></tr>
160 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
161 <div class="textblock"><p>Basic function to execute <a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_lowp_quantize_down_int32_to_uint8_scale_by_fixed_point.xhtml" title="Basic function to execute CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint on OpenCL. ">CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint</a> on OpenCL. </p>
162 <p><a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_lowp_quantize_down_int32_to_uint8_scale_by_fixed_point.xhtml" title="Basic function to execute CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint on OpenCL. ">CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint</a> depends on 3 parameters:</p>
163 <p>result_fixedpoint_multiplier, result_shift, result_offset_after_shift</p>
164 <p>The final result is:</p>
165 <p>(FixedPointMul(input[i][k], result_fixedpoint_multiplier) >> result_shift) + result_offset_after_shift</p>
166 <p>where FixedPointMul(x, y) is the nearest integer to the following mathematical expression, evaluated without overflow or intermediate rounding:</p>
167 <p>(x * y) / 2^31</p>
168 <p>For more information: <a href="https://github.com/google/gemmlowp/blob/master/public/output_stages.h#L68">https://github.com/google/gemmlowp/blob/master/public/output_stages.h#L68</a></p>
169 <p>In case the bias tensor is provided, the final result is:</p>
170 <p>((FixedPointMul(input[i][k] + bias[k], result_fixedpoint_multiplier)) >> result_shift) + result_offset_after_shift</p>
171 <p>This function calls the following OpenCL kernels:</p>
173 <li><a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_lowp_quantize_down_int32_to_uint8_scale_by_fixed_point_kernel.xhtml">CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel</a></li>
175 <dl class="section note"><dt>Note</dt><dd>The function accepts also 2 optional input arguments (min and max) which can be used to implement "rectified linear unit" activation functions after the result is shifted right by result_shift </dd></dl>
177 <p>Definition at line <a class="el" href="_c_l_g_e_m_m_lowp_output_stage_8h_source.xhtml#l00119">119</a> of file <a class="el" href="_c_l_g_e_m_m_lowp_output_stage_8h_source.xhtml">CLGEMMLowpOutputStage.h</a>.</p>
178 </div><h2 class="groupheader">Member Function Documentation</h2>
179 <a class="anchor" id="a15da37f661fdcd81c1f25c5d6bdc6abd"></a>
180 <div class="memitem">
181 <div class="memproto">
182 <table class="memname">
184 <td class="memname">void configure </td>
186 <td class="paramtype">const <a class="el" href="classarm__compute_1_1_i_c_l_tensor.xhtml">ICLTensor</a> * </td>
187 <td class="paramname"><em>input</em>, </td>
190 <td class="paramkey"></td>
192 <td class="paramtype">const <a class="el" href="classarm__compute_1_1_i_c_l_tensor.xhtml">ICLTensor</a> * </td>
193 <td class="paramname"><em>bias</em>, </td>
196 <td class="paramkey"></td>
198 <td class="paramtype"><a class="el" href="classarm__compute_1_1_i_c_l_tensor.xhtml">ICLTensor</a> * </td>
199 <td class="paramname"><em>output</em>, </td>
202 <td class="paramkey"></td>
204 <td class="paramtype">int </td>
205 <td class="paramname"><em>result_fixedpoint_multiplier</em>, </td>
208 <td class="paramkey"></td>
210 <td class="paramtype">int </td>
211 <td class="paramname"><em>result_shift</em>, </td>
214 <td class="paramkey"></td>
216 <td class="paramtype">int </td>
217 <td class="paramname"><em>result_offset_after_shift</em>, </td>
220 <td class="paramkey"></td>
222 <td class="paramtype">int </td>
223 <td class="paramname"><em>min</em> = <code>0</code>, </td>
226 <td class="paramkey"></td>
228 <td class="paramtype">int </td>
229 <td class="paramname"><em>max</em> = <code>0</code> </td>
237 </div><div class="memdoc">
239 <p>Initialise the kernel's inputs, output. </p>
240 <dl class="params"><dt>Parameters</dt><dd>
241 <table class="params">
242 <tr><td class="paramdir">[in]</td><td class="paramname">input</td><td>Input tensor. Data type supported: S32 </td></tr>
243 <tr><td class="paramdir">[in]</td><td class="paramname">bias</td><td>Biases tensor. Only shared biases supported and it can be a nullptr if the biases addition is not required. Biases are 1D tensor with dimensions [OFM]. Data type supported: Same as <code>input</code>. </td></tr>
244 <tr><td class="paramdir">[out]</td><td class="paramname">output</td><td>Output tensor. Data type supported: Data type supported: QASYMM8 </td></tr>
245 <tr><td class="paramdir">[in]</td><td class="paramname">result_fixedpoint_multiplier</td><td>Fixed point value to be multiplied to each element of the input matrix when once the result_offset has been add </td></tr>
246 <tr><td class="paramdir">[in]</td><td class="paramname">result_shift</td><td>Number of bits to shift right the result after the fixed point multiplication </td></tr>
247 <tr><td class="paramdir">[in]</td><td class="paramname">result_offset_after_shift</td><td>Offset to be applied to result before converting it back to QASYMM8 </td></tr>
248 <tr><td class="paramdir">[in]</td><td class="paramname">min</td><td>(Optional) Min value used to saturate down the output result before converting back to QASYMM8 </td></tr>
249 <tr><td class="paramdir">[in]</td><td class="paramname">max</td><td>(Optional) Max value used to saturate up the output result before converting back to QASYMM8, Along with <code>min</code>, this value can be used to implement "rectified linear unit" activation functions </td></tr>
254 <p>Referenced by <a class="el" href="validation_2_c_l_2_g_e_m_m_lowp_8cpp_source.xhtml#l00181">arm_compute::test::validation::DATA_TEST_CASE()</a>.</p>
258 <a class="anchor" id="ae91454a1d9774df968cdd3694b366ddf"></a>
259 <div class="memitem">
260 <div class="memproto">
261 <table class="mlabels">
263 <td class="mlabels-left">
264 <table class="memname">
266 <td class="memname">static <a class="el" href="classarm__compute_1_1_status.xhtml">Status</a> validate </td>
268 <td class="paramtype">const <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml">ITensorInfo</a> * </td>
269 <td class="paramname"><em>input</em>, </td>
272 <td class="paramkey"></td>
274 <td class="paramtype">const <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml">ITensorInfo</a> * </td>
275 <td class="paramname"><em>bias</em>, </td>
278 <td class="paramkey"></td>
280 <td class="paramtype">const <a class="el" href="classarm__compute_1_1_i_tensor_info.xhtml">ITensorInfo</a> * </td>
281 <td class="paramname"><em>output</em>, </td>
284 <td class="paramkey"></td>
286 <td class="paramtype">int </td>
287 <td class="paramname"><em>min</em> = <code>0</code>, </td>
290 <td class="paramkey"></td>
292 <td class="paramtype">int </td>
293 <td class="paramname"><em>max</em> = <code>0</code> </td>
302 <td class="mlabels-right">
303 <span class="mlabels"><span class="mlabel">static</span></span> </td>
306 </div><div class="memdoc">
308 <p>Static function to check if given info will lead to a valid configuration of <a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_lowp_quantize_down_int32_to_uint8_scale_by_fixed_point.xhtml">CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint</a>. </p>
309 <dl class="params"><dt>Parameters</dt><dd>
310 <table class="params">
311 <tr><td class="paramdir">[in]</td><td class="paramname">input</td><td>Input tensor. It is the output of <a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_lowp_matrix_multiply_core.xhtml">CLGEMMLowpMatrixMultiplyCore</a> function. Data type supported: S32 </td></tr>
312 <tr><td class="paramdir">[in]</td><td class="paramname">bias</td><td>Biases tensor. Only shared biases supported and it can be a nullptr if the addition of biases is not required. Biases are 1D tensor with dimensions [OFM]. Data type supported: Same as <code>input</code>. </td></tr>
313 <tr><td class="paramdir">[in]</td><td class="paramname">output</td><td>Output tensor. Data type supported: Data type supported: QASYMM8 </td></tr>
314 <tr><td class="paramdir">[in]</td><td class="paramname">min</td><td>(Optional) Min value used to saturate down the output result before converting back to QASYMM8 </td></tr>
315 <tr><td class="paramdir">[in]</td><td class="paramname">max</td><td>(Optional) Max value used to saturate up the output result before converting back to QASYMM8, Along with <code>min</code>, this value can be used to implement "rectified linear unit" activation functions</td></tr>
319 <dl class="section return"><dt>Returns</dt><dd>a status </dd></dl>
323 <hr/>The documentation for this class was generated from the following file:<ul>
324 <li>arm_compute/runtime/CL/functions/<a class="el" href="_c_l_g_e_m_m_lowp_output_stage_8h_source.xhtml">CLGEMMLowpOutputStage.h</a></li>
326 </div><!-- contents -->
327 </div><!-- doc-content -->
328 <!-- start footer part -->
329 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
331 <li class="navelem"><a class="el" href="namespacearm__compute.xhtml">arm_compute</a></li><li class="navelem"><a class="el" href="classarm__compute_1_1_c_l_g_e_m_m_lowp_quantize_down_int32_to_uint8_scale_by_fixed_point.xhtml">CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint</a></li>
332 <li class="footer">Generated on Fri Mar 2 2018 12:37:57 for Compute Library by
333 <a href="http://www.doxygen.org/index.html">
334 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>