blob: b6b2dc8993c4bae9cfb0700fc3856e66bd8a1c86 [file] [log] [blame]
<!-- HTML header for doxygen 1.8.15-->
<!-- Remember to use version doxygen 1.8.15 +-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
<title>Compute Library: src/core/CL/cl_kernels/scale_quantized.cl Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<img alt="Compute Library" src="https://raw.githubusercontent.com/ARM-software/ComputeLibrary/gh-pages/ACL_logo.png" style="max-width: 100%;margin-top: 15px;margin-left: 10px"/>
<td style="padding-left: 0.5em;">
<div id="projectname">
&#160;<span id="projectnumber">19.08</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('scale__quantized_8cl_source.xhtml','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">scale_quantized.cl</div> </div>
</div><!--header-->
<div class="contents">
<a href="scale__quantized_8cl.xhtml">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Copyright (c) 2018 ARM Limited.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * SPDX-License-Identifier: MIT</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a copy</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * of this software and associated documentation files (the &quot;Software&quot;), to</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> * deal in the Software without restriction, including without limitation the</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * sell copies of the Software, and to permit persons to whom the Software is</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * furnished to do so, subject to the following conditions:</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> * The above copyright notice and this permission notice shall be included in all</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * copies or substantial portions of the Software.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="comment"> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="comment"> * SOFTWARE.</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="helpers__asymm_8h.xhtml">helpers_asymm.h</a>&quot;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="warp__helpers__quantized_8h.xhtml">warp_helpers_quantized.h</a>&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="scale__quantized_8cl.xhtml#acbe073ffe68691758706acfe1dc305ba"> 34</a></span>&#160;<span class="keyword">inline</span> <span class="keyword">const</span> float8 <a class="code" href="scale__quantized_8cl.xhtml#acbe073ffe68691758706acfe1dc305ba">transform_bilinear_quantized</a>(<span class="keyword">const</span> float2 coord, <span class="keyword">const</span> float2 <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a>)</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;{</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keyword">const</span> float4 in_x_coords = (float4)(coord.s0, 1 + coord.s0, 2 + coord.s0, 3 + coord.s0);</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#ifdef SAMPLING_POLICY_TOP_LEFT</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keyword">const</span> float4 new_x = in_x_coords * (float4)(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a>.s0);</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keyword">const</span> float4 new_y = (float4)(coord.s1 * <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a>.s1);</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keywordflow">return</span> (float8)(new_x.s0, new_y.s0, new_x.s1, new_y.s1, new_x.s2, new_y.s2, new_x.s3, new_y.s3);</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="preprocessor">#elif SAMPLING_POLICY_CENTER</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keyword">const</span> float4 new_x = (in_x_coords + ((float4)(0.5f))) * (float4)(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a>.s0) - (float4)(0.5f);</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keyword">const</span> float4 new_y = (float4)((coord.s1 + 0.5f) * <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a>.s1 - 0.5f);</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keywordflow">return</span> (float8)(new_x.s0, new_y.s0, new_x.s1, new_y.s1, new_x.s2, new_y.s2, new_x.s3, new_y.s3);</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="preprocessor">#else </span><span class="comment">/* SAMPLING_POLICY */</span><span class="preprocessor"></span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="preprocessor">#error(&quot;Unsupported sampling policy&quot;);</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* SAMPLING_POLICY */</span><span class="preprocessor"></span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;}</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="scale__quantized_8cl.xhtml#a157d3c35f643dafe1c4bed09594f3bb5"> 73</a></span>&#160;__kernel <span class="keywordtype">void</span> <a class="code" href="scale__quantized_8cl.xhtml#a157d3c35f643dafe1c4bed09594f3bb5">scale_bilinear_quantized_nchw</a>(</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a22f42fcf2077d951271df83b55c1a71a">IMAGE_DECLARATION</a>(in),</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a22f42fcf2077d951271df83b55c1a71a">IMAGE_DECLARATION</a>(out),</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> input_width,</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> input_height,</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> scale_x,</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> scale_y)</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;{</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> in = <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a4334a4a76f8e9628c0fb9e1acf616e2a">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a>(in);</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <a class="code" href="struct_image.xhtml">Image</a> out = <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#aebe814363556c244be043b13e7969197">CONVERT_TO_IMAGE_STRUCT</a>(out);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keyword">const</span> float2 r = (float2)(scale_x, scale_y);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keyword">const</span> float8 tc = <a class="code" href="scale__quantized_8cl.xhtml#acbe073ffe68691758706acfe1dc305ba">transform_bilinear_quantized</a>(<a class="code" href="warp__helpers__quantized_8h.xhtml#aa13de3eff8afd51e8bf4c1904a9b7415">get_current_coords_quantized</a>(), r);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; vstore4(<a class="code" href="warp__helpers__quantized_8h.xhtml#ae8a3d61874f95580e8110f4f206c3b8b">bilinear_interpolate_with_border_quantized</a>(&amp;in, tc, input_width, input_height, BORDER_SIZE, SCALE, OFFSET), 0, (__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)out.<a class="code" href="struct_image.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;}</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="preprocessor">#if defined(DEPTH_OUT)</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;__kernel <span class="keywordtype">void</span> scale_bilinear_quantized_nhwc(</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a481bdc6d61b3df9dcdbdb244f0f97790">TENSOR4D_DECLARATION</a>(in),</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a481bdc6d61b3df9dcdbdb244f0f97790">TENSOR4D_DECLARATION</a>(out),</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> input_width,</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> input_height,</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> scale_x,</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> scale_y)</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;{</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <a class="code" href="struct_tensor4_d.xhtml">Tensor4D</a> in = <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a302e05cc5f90bd76a9d0812c4be8b5eb">CONVERT_TO_TENSOR4D_STRUCT_NO_STEP</a>(in, 0);</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <a class="code" href="struct_tensor4_d.xhtml">Tensor4D</a> out = <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a23b9032d1b9d59547545e457f82ee478">CONVERT_TO_TENSOR4D_STRUCT</a>(out, DEPTH_OUT);</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="preprocessor">#ifdef SAMPLING_POLICY_TOP_LEFT</span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> new_x = get_global_id(1) * scale_x;</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> new_y = (get_global_id(2) % DEPTH_OUT) * scale_y;</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="preprocessor">#elif SAMPLING_POLICY_CENTER</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> new_x = (get_global_id(1) + 0.5f) * scale_x - 0.5f;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> new_y = ((get_global_id(2) % DEPTH_OUT) + 0.5f) * scale_y - 0.5f;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;<span class="preprocessor">#else </span><span class="comment">/* SAMPLING_POLICY */</span><span class="preprocessor"></span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="preprocessor">#error(&quot;Unsupported sampling policy&quot;);</span></div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* SAMPLING_POLICY */</span><span class="preprocessor"></span></div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> new_xf = floor(new_x);</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> new_yf = floor(new_y);</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordtype">float</span> clamped_x = <a class="code" href="namespacearm__compute_1_1utility.xhtml#a96efecf997f13a914609ddf1eb67f624">clamp</a>(new_xf, 0.0f, input_width - 1);</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keywordtype">float</span> clamped_x1 = <a class="code" href="namespacearm__compute_1_1utility.xhtml#a96efecf997f13a914609ddf1eb67f624">clamp</a>(new_xf + 1, 0.0f, input_width - 1);</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordtype">float</span> clamped_x_ = clamped_x;</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keywordtype">float</span> clamped_x1_ = clamped_x1;</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> clamped_y = <a class="code" href="namespacearm__compute_1_1utility.xhtml#a96efecf997f13a914609ddf1eb67f624">clamp</a>(new_yf, 0.0f, input_height - 1);</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> clamped_y1 = <a class="code" href="namespacearm__compute_1_1utility.xhtml#a96efecf997f13a914609ddf1eb67f624">clamp</a>(new_yf + 1, 0.0f, input_height - 1);</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;<span class="preprocessor">#ifndef BORDER_MODE_REPLICATE</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; clamped_x1 = <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#af77145fbdc6b0c8931148f5597d9de53">select</a>(clamped_x1, 0.0f - BORDER_SIZE, new_yf + 1 &lt; 0.f || new_yf + 1 &gt; input_height - 1 || new_xf + 1 &lt; 0.f || new_xf + 1 &gt; input_width - 1);</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; clamped_x_ = <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#af77145fbdc6b0c8931148f5597d9de53">select</a>(clamped_x_, 0.0f - BORDER_SIZE, new_yf + 1 &gt; input_height - 1 || new_xf &lt; 0.f || new_xf &gt; input_width - 1);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; clamped_x = <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#af77145fbdc6b0c8931148f5597d9de53">select</a>(clamped_x, 0.0f - BORDER_SIZE, new_yf &lt; 0.f || new_yf &gt; input_height - 1 || new_xf &lt; 0.f || new_xf &gt; input_width - 1);</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; clamped_x1_ = <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#af77145fbdc6b0c8931148f5597d9de53">select</a>(clamped_x1_, 0.0f - BORDER_SIZE, new_xf + 1 &lt; 0.f || new_xf + 1 &gt; input_width - 1 || new_yf &lt; 0.f || new_yf &gt; input_height - 1);</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* BORDER_MODE_REPLICATE */</span><span class="preprocessor"></span></div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; int4 ins = (int4)(*((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#ad442fb5ec8be1fff97f543150de5d822">tensor4D_offset</a>(&amp;in, get_global_id(0), convert_int(clamped_x), convert_int(clamped_y), (get_global_id(2) / DEPTH_OUT))),</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#ad442fb5ec8be1fff97f543150de5d822">tensor4D_offset</a>(&amp;in, get_global_id(0), convert_int(clamped_x1_), convert_int(clamped_y), (get_global_id(2) / DEPTH_OUT))),</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#ad442fb5ec8be1fff97f543150de5d822">tensor4D_offset</a>(&amp;in, get_global_id(0), convert_int(clamped_x_), convert_int(clamped_y1), (get_global_id(2) / DEPTH_OUT))),</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)<a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#ad442fb5ec8be1fff97f543150de5d822">tensor4D_offset</a>(&amp;in, get_global_id(0), convert_int(clamped_x1), convert_int(clamped_y1), (get_global_id(2) / DEPTH_OUT))));</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> a = new_x - new_xf;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#aa76b4a6e74940dabc5b7fc6b2dab3545">b</a> = 1.f - a;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> a1 = new_y - new_yf;</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> b1 = 1.f - a1;</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="keyword">const</span> float4 insf32 = convert_float4(ins - (int4)OFFSET) * (float4)SCALE;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="keyword">const</span> <span class="keywordtype">float</span> fr = ((insf32.s0 * <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#aa76b4a6e74940dabc5b7fc6b2dab3545">b</a> * b1) + (insf32.s1 * a * b1) + (insf32.s2 * <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#aa76b4a6e74940dabc5b7fc6b2dab3545">b</a> * a1) + (insf32.s3 * a * a1));</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; uchar res = convert_uchar_sat(convert_int_sat_rtp(fr / SCALE) + OFFSET);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160;</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; *((__global <a class="code" href="convolution3x3_8cl.xhtml#afb8c72ce35c4a1f4a2588d6573e54aa1">DATA_TYPE</a> *)out.<a class="code" href="struct_tensor4_d.xhtml#acf52c23cbd7424606c10a606524e3e32">ptr</a>) = res;</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;}</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* defined(DEPTH_OUT) */</span><span class="preprocessor"></span></div><div class="ttc" id="struct_tensor4_d_xhtml_acf52c23cbd7424606c10a606524e3e32"><div class="ttname"><a href="struct_tensor4_d.xhtml#acf52c23cbd7424606c10a606524e3e32">Tensor4D::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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00188">helpers.h:188</a></div></div>
<div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_aebe814363556c244be043b13e7969197"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00129">helpers.h:129</a></div></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>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_aa76b4a6e74940dabc5b7fc6b2dab3545"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#aa76b4a6e74940dabc5b7fc6b2dab3545">arm_compute::test::validation::b</a></div><div class="ttdeci">SimpleTensor&lt; float &gt; b</div><div class="ttdef"><b>Definition:</b> <a href="_c_p_p_2_d_f_t_8cpp_source.xhtml#l00157">DFT.cpp:157</a></div></div>
<div class="ttc" id="scale__quantized_8cl_xhtml_acbe073ffe68691758706acfe1dc305ba"><div class="ttname"><a href="scale__quantized_8cl.xhtml#acbe073ffe68691758706acfe1dc305ba">transform_bilinear_quantized</a></div><div class="ttdeci">const float8 transform_bilinear_quantized(const float2 coord, const float2 scale)</div><div class="ttdoc">Transforms four 2D coordinates.</div><div class="ttdef"><b>Definition:</b> <a href="scale__quantized_8cl_source.xhtml#l00034">scale_quantized.cl:34</a></div></div>
<div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_a22f42fcf2077d951271df83b55c1a71a"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a22f42fcf2077d951271df83b55c1a71a">IMAGE_DECLARATION</a></div><div class="ttdeci">#define IMAGE_DECLARATION(name)</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00093">helpers.h:93</a></div></div>
<div class="ttc" id="struct_tensor4_d_xhtml"><div class="ttname"><a href="struct_tensor4_d.xhtml">Tensor4D</a></div><div class="ttdoc">Structure to hold 4D tensor information.</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00186">helpers.h:186</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1utility_xhtml_a96efecf997f13a914609ddf1eb67f624"><div class="ttname"><a href="namespacearm__compute_1_1utility.xhtml#a96efecf997f13a914609ddf1eb67f624">arm_compute::utility::clamp</a></div><div class="ttdeci">DataType clamp(const DataType &amp;n, const DataType &amp;lower=std::numeric_limits&lt; RangeType &gt;::lowest(), const DataType &amp;upper=std::numeric_limits&lt; RangeType &gt;::max())</div><div class="ttdoc">Performs clamping among a lower and upper value.</div><div class="ttdef"><b>Definition:</b> <a href="_utility_8h_source.xhtml#l00084">Utility.h:84</a></div></div>
<div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_a302e05cc5f90bd76a9d0812c4be8b5eb"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a302e05cc5f90bd76a9d0812c4be8b5eb">CONVERT_TO_TENSOR4D_STRUCT_NO_STEP</a></div><div class="ttdeci">#define CONVERT_TO_TENSOR4D_STRUCT_NO_STEP(name, mod_size)</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00155">helpers.h:155</a></div></div>
<div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_a4334a4a76f8e9628c0fb9e1acf616e2a"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a4334a4a76f8e9628c0fb9e1acf616e2a">CONVERT_TO_IMAGE_STRUCT_NO_STEP</a></div><div class="ttdeci">#define CONVERT_TO_IMAGE_STRUCT_NO_STEP(name)</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00132">helpers.h:132</a></div></div>
<div class="ttc" id="warp__helpers__quantized_8h_xhtml_ae8a3d61874f95580e8110f4f206c3b8b"><div class="ttname"><a href="warp__helpers__quantized_8h.xhtml#ae8a3d61874f95580e8110f4f206c3b8b">bilinear_interpolate_with_border_quantized</a></div><div class="ttdeci">const DATA_TYPE4 bilinear_interpolate_with_border_quantized(const Image *in, const float8 coords, const float width, const float height, const float border_size, const float scale, const int offset_qasymm)</div><div class="ttdoc">Computes the bilinear interpolation for each set of coordinates in the vector coords and returns the ...</div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers__quantized_8h_source.xhtml#l00084">warp_helpers_quantized.h:84</a></div></div>
<div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_ad442fb5ec8be1fff97f543150de5d822"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#ad442fb5ec8be1fff97f543150de5d822">tensor4D_offset</a></div><div class="ttdeci">__global const uchar * tensor4D_offset(const Tensor4D *tensor, int x, int y, int z, int w)</div><div class="ttdoc">Get the pointer position of a Tensor4D.</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00353">helpers.h:353</a></div></div>
<div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_a23b9032d1b9d59547545e457f82ee478"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a23b9032d1b9d59547545e457f82ee478">CONVERT_TO_TENSOR4D_STRUCT</a></div><div class="ttdeci">#define CONVERT_TO_TENSOR4D_STRUCT(name, mod_size)</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00151">helpers.h:151</a></div></div>
<div class="ttc" id="warp__helpers__quantized_8h_xhtml"><div class="ttname"><a href="warp__helpers__quantized_8h.xhtml">warp_helpers_quantized.h</a></div></div>
<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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00167">helpers.h:167</a></div></div>
<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="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00169">helpers.h:169</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_acec6d8ad52a28972fa74e071c1a63b6a"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">arm_compute::test::validation::scale</a></div><div class="ttdeci">scale</div><div class="ttdef"><b>Definition:</b> <a href="_n_e_o_n_2_pixel_wise_multiplication_8cpp_source.xhtml#l00317">PixelWiseMultiplication.cpp:317</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_af77145fbdc6b0c8931148f5597d9de53"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#af77145fbdc6b0c8931148f5597d9de53">arm_compute::test::validation::select</a></div><div class="ttdeci">CLSelect select</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_select_8cpp_source.xhtml#l00164">Select.cpp:164</a></div></div>
<div class="ttc" id="helpers__asymm_8h_xhtml"><div class="ttname"><a href="helpers__asymm_8h.xhtml">helpers_asymm.h</a></div></div>
<div class="ttc" id="warp__helpers__quantized_8h_xhtml_aa13de3eff8afd51e8bf4c1904a9b7415"><div class="ttname"><a href="warp__helpers__quantized_8h.xhtml#aa13de3eff8afd51e8bf4c1904a9b7415">get_current_coords_quantized</a></div><div class="ttdeci">const float2 get_current_coords_quantized()</div><div class="ttdoc">Returns the current thread coordinates.</div><div class="ttdef"><b>Definition:</b> <a href="warp__helpers__quantized_8h_source.xhtml#l00069">warp_helpers_quantized.h:69</a></div></div>
<div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_a481bdc6d61b3df9dcdbdb244f0f97790"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a481bdc6d61b3df9dcdbdb244f0f97790">TENSOR4D_DECLARATION</a></div><div class="ttdeci">#define TENSOR4D_DECLARATION(name)</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00111">helpers.h:111</a></div></div>
<div class="ttc" id="scale__quantized_8cl_xhtml_a157d3c35f643dafe1c4bed09594f3bb5"><div class="ttname"><a href="scale__quantized_8cl.xhtml#a157d3c35f643dafe1c4bed09594f3bb5">scale_bilinear_quantized_nchw</a></div><div class="ttdeci">__kernel void scale_bilinear_quantized_nchw(__global uchar *in_ptr, uint in_stride_x, uint in_step_x, uint in_stride_y, uint in_step_y, uint in_offset_first_element_in_bytes, __global uchar *out_ptr, uint out_stride_x, uint out_step_x, uint out_stride_y, uint out_step_y, uint out_offset_first_element_in_bytes, const float input_width, const float input_height, const float scale_x, const float scale_y)</div><div class="ttdoc">Performs an affine transformation on an image interpolating with the BILINEAR method.</div><div class="ttdef"><b>Definition:</b> <a href="scale__quantized_8cl_source.xhtml#l00073">scale_quantized.cl:73</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<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="scale__quantized_8cl.xhtml">scale_quantized.cl</a></li>
<li class="footer">Generated on Mon Sep 2 2019 11:47:21 for Compute Library by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
</ul>
</div>
</body>
</html>