blob: 3eab6c49ce78ea692f59a57499d944f0217202bf [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/runtime/CL/CLTensorAllocator.cpp 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">20.02.1</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('_c_l_tensor_allocator_8cpp_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">CLTensorAllocator.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="_c_l_tensor_allocator_8cpp.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) 2016-2019 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="_c_l_tensor_allocator_8h.xhtml">arm_compute/runtime/CL/CLTensorAllocator.h</a>&quot;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_error_8h.xhtml">arm_compute/core/Error.h</a>&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_tensor_info_8h.xhtml">arm_compute/core/TensorInfo.h</a>&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_c_l_runtime_context_8h.xhtml">arm_compute/runtime/CL/CLRuntimeContext.h</a>&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_c_l_scheduler_8h.xhtml">arm_compute/runtime/CL/CLScheduler.h</a>&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacearm__compute.xhtml">arm_compute</a></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;{</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">const</span> cl::Buffer CLTensorAllocator::_empty_buffer = cl::Buffer();</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="keyword">namespace</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;{<span class="comment"></span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="comment">/** Helper function used to allocate the backing memory of a tensor</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="comment"> * @param[in] context OpenCL context to use</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="comment"> * @param[in] size Size of the allocation</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="comment"> * @param[in] alignment Alignment of the allocation</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="comment"> * @return A wrapped memory region</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;std::unique_ptr&lt;ICLMemoryRegion&gt; allocate_region(CLCoreRuntimeContext *ctx, <span class="keywordtype">size_t</span> size, cl_uint alignment)</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;{</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="comment">// Try fine-grain SVM</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; std::unique_ptr&lt;ICLMemoryRegion&gt; region = support::cpp14::make_unique&lt;CLFineSVMMemoryRegion&gt;(ctx,</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; CL_MEM_READ_WRITE | CL_MEM_SVM_FINE_GRAIN_BUFFER,</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; size,</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; alignment);</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="comment">// Try coarse-grain SVM in case of failure</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordflow">if</span>(region != <span class="keyword">nullptr</span> &amp;&amp; region-&gt;ptr() == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; {</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; region = support::cpp14::make_unique&lt;CLCoarseSVMMemoryRegion&gt;(ctx, CL_MEM_READ_WRITE, size, alignment);</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; }</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="comment">// Try legacy buffer memory in case of failure</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keywordflow">if</span>(region != <span class="keyword">nullptr</span> &amp;&amp; region-&gt;ptr() == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; {</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; region = support::cpp14::make_unique&lt;CLBufferMemoryRegion&gt;(ctx, CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE, size);</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; }</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keywordflow">return</span> region;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;}<span class="comment"></span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="comment">/** Clears quantization arrays</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="comment"> * @param[in, out] scale Quantization scale array</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="comment"> * @param[in, out] offset Quantization offset array</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="keywordtype">void</span> clear_quantization_arrays(<a class="code" href="namespacearm__compute.xhtml#a193a4859b365f3ef4e0d73a1e6b12c85">CLFloatArray</a> &amp;<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a>, <a class="code" href="namespacearm__compute.xhtml#a8a401a071524761c661a75969c951cf5">CLInt32Array</a> &amp;<a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>)</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;{</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="comment">// Clear arrays</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a> = <a class="code" href="namespacearm__compute.xhtml#a193a4859b365f3ef4e0d73a1e6b12c85">CLFloatArray</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#a009469e4d9b8fce3b6d5e97d2077827d">offset</a> = <a class="code" href="namespacearm__compute.xhtml#a8a401a071524761c661a75969c951cf5">CLInt32Array</a>();</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;}<span class="comment"></span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="comment">/** Helper function used to create quantization data arrays</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="comment"> * @param[in, out] scale Quantization scale array</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="comment"> * @param[in, out] offset Quantization offset array</span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="comment"> * @param[in] qinfo Quantization info</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="comment"> * @param[in] pad_size Pad size to use in case array needs to be padded for computation purposes</span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;<span class="keywordtype">void</span> populate_quantization_info(<a class="code" href="namespacearm__compute.xhtml#a193a4859b365f3ef4e0d73a1e6b12c85">CLFloatArray</a> &amp;<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a>, <a class="code" href="namespacearm__compute.xhtml#a8a401a071524761c661a75969c951cf5">CLInt32Array</a> &amp;<a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>, <span class="keyword">const</span> QuantizationInfo &amp;<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#ad85d7becf0c6e3cffbc255489808e219">qinfo</a>, <span class="keywordtype">size_t</span> pad_size)</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;{</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; clear_quantization_arrays(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a>, <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</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; <span class="comment">// Create scale array</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keyword">const</span> std::vector&lt;float&gt; &amp;qscale = <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#ad85d7becf0c6e3cffbc255489808e219">qinfo</a>.<a class="code" href="classarm__compute_1_1_quantization_info.xhtml#af21c7fddee28e9aa0a37c633300db0e0">scale</a>();</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keyword">const</span> <span class="keywordtype">size_t</span> num_elements = qscale.size();</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keyword">const</span> <span class="keywordtype">size_t</span> element_size = <span class="keyword">sizeof</span>(std::remove_reference&lt;decltype(qscale)&gt;::type::value_type);</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a> = <a class="code" href="namespacearm__compute.xhtml#a193a4859b365f3ef4e0d73a1e6b12c85">CLFloatArray</a>(num_elements + pad_size);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a>.resize(num_elements);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a9b58d0eb9a2af8e6d7908695e1557d6c">CLScheduler::get</a>().<a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a398a2582c746d28fc125487a44c9ed74">queue</a>().enqueueWriteBuffer(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#acec6d8ad52a28972fa74e071c1a63b6a">scale</a>.cl_buffer(), CL_TRUE, 0, num_elements * element_size, <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#ad85d7becf0c6e3cffbc255489808e219">qinfo</a>.<a class="code" href="classarm__compute_1_1_quantization_info.xhtml#af21c7fddee28e9aa0a37c633300db0e0">scale</a>().data());</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keywordflow">if</span>(!<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#ad85d7becf0c6e3cffbc255489808e219">qinfo</a>.<a class="code" href="classarm__compute_1_1_quantization_info.xhtml#a08ffa53eaabde3e18b003f8182ac09bf">offset</a>().empty())</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; {</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="comment">// Create offset array</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keyword">const</span> std::vector&lt;int32_t&gt; &amp;qoffset = <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#ad85d7becf0c6e3cffbc255489808e219">qinfo</a>.<a class="code" href="classarm__compute_1_1_quantization_info.xhtml#a08ffa53eaabde3e18b003f8182ac09bf">offset</a>();</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keyword">const</span> <span class="keywordtype">size_t</span> offset_element_size = <span class="keyword">sizeof</span>(std::remove_reference&lt;decltype(qoffset)&gt;::type::value_type);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a> = <a class="code" href="namespacearm__compute.xhtml#a8a401a071524761c661a75969c951cf5">CLInt32Array</a>(num_elements + pad_size);</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>.resize(num_elements);</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a9b58d0eb9a2af8e6d7908695e1557d6c">CLScheduler::get</a>().<a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a398a2582c746d28fc125487a44c9ed74">queue</a>().enqueueWriteBuffer(<a class="code" href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a>.cl_buffer(), CL_TRUE, 0, num_elements * offset_element_size, <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#ad85d7becf0c6e3cffbc255489808e219">qinfo</a>.<a class="code" href="classarm__compute_1_1_quantization_info.xhtml#a08ffa53eaabde3e18b003f8182ac09bf">offset</a>().data());</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; }</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;}</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;} <span class="comment">// namespace</span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#aba4802aaab407cc9b70b5e396f203203"> 107</a></span>&#160;<a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#aba4802aaab407cc9b70b5e396f203203">CLTensorAllocator::CLTensorAllocator</a>(<a class="code" href="classarm__compute_1_1_i_memory_manageable.xhtml">IMemoryManageable</a> *owner, <a class="code" href="classarm__compute_1_1_c_l_runtime_context.xhtml">CLRuntimeContext</a> *ctx)</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; : _ctx(ctx), _owner(owner), _associated_memory_group(nullptr), _memory(), _mapping(nullptr), _scale(), _offset()</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;{</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;}</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a5c27e81a1ad958e4de947c1da77f4cf1"> 112</a></span>&#160;<a class="code" href="structarm__compute_1_1_c_l_quantization.xhtml">CLQuantization</a> <a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a5c27e81a1ad958e4de947c1da77f4cf1">CLTensorAllocator::quantization</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="keyword"></span>{</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keywordflow">return</span> { &amp;_scale, &amp;_offset };</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;}</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a99c07c946023f413991a249db8b99ab0"> 117</a></span>&#160;uint8_t *<a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a99c07c946023f413991a249db8b99ab0">CLTensorAllocator::data</a>()</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;{</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordflow">return</span> _mapping;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;}</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#ac7e247b94ceae35db2a172961ab83df9"> 122</a></span>&#160;<span class="keyword">const</span> cl::Buffer &amp;<a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#ac7e247b94ceae35db2a172961ab83df9">CLTensorAllocator::cl_data</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<span class="keyword"></span>{</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keywordflow">return</span> _memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a146cb960b44f4b1fb11ef4420382021a">region</a>() == <span class="keyword">nullptr</span> ? _empty_buffer : _memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a4ca2850f9acbac8fb013038b4d9b684d">cl_region</a>()-&gt;<a class="code" href="classarm__compute_1_1_i_c_l_memory_region.xhtml#ac7e247b94ceae35db2a172961ab83df9">cl_data</a>();</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;</div><div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a6e509c2a177b0b29e9e2369535094dee"> 127</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a6e509c2a177b0b29e9e2369535094dee">CLTensorAllocator::allocate</a>()</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="comment">// Allocate tensor backing memory</span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordflow">if</span>(_associated_memory_group == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; {</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="comment">// Perform memory allocation</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keywordflow">if</span>(_ctx == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; {</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keyword">auto</span> legacy_ctx = <a class="code" href="classarm__compute_1_1_c_l_core_runtime_context.xhtml">CLCoreRuntimeContext</a>(<span class="keyword">nullptr</span>, <a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a9b58d0eb9a2af8e6d7908695e1557d6c">CLScheduler::get</a>().context(), <a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a9b58d0eb9a2af8e6d7908695e1557d6c">CLScheduler::get</a>().queue());</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; _memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#af2d30bc4b38a0f4703ff154a39f1b422">set_owned_region</a>(allocate_region(&amp;legacy_ctx, <a class="code" href="classarm__compute_1_1_i_tensor_allocator.xhtml#a29737b25723597c9708c662c7088e6c3">info</a>().total_size(), 0));</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; }</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; {</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; _memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#af2d30bc4b38a0f4703ff154a39f1b422">set_owned_region</a>(allocate_region(_ctx-&gt;<a class="code" href="classarm__compute_1_1_c_l_runtime_context.xhtml#a7b4da359c81757339d03c7753b95f617">core_runtime_context</a>(), <a class="code" href="classarm__compute_1_1_i_tensor_allocator.xhtml#a29737b25723597c9708c662c7088e6c3">info</a>().<a class="code" href="classarm__compute_1_1_tensor_info.xhtml#af398466b602a02b42d8df19fb66a6c60">total_size</a>(), 0));</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; }</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; }</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; {</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; _associated_memory_group-&gt;<a class="code" href="classarm__compute_1_1_i_memory_group.xhtml#afe894be960031e036ae121a4c5111043">finalize_memory</a>(_owner, _memory, <a class="code" href="classarm__compute_1_1_i_tensor_allocator.xhtml#a29737b25723597c9708c662c7088e6c3">info</a>().total_size(), <a class="code" href="classarm__compute_1_1_i_tensor_allocator.xhtml#a32899157b4898866a4a58440f2f7b13f">alignment</a>());</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; }</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="comment">// Allocate and fill the quantization parameter arrays</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="keywordflow">if</span>(<a class="code" href="namespacearm__compute.xhtml#a84437d80241f6a31e1a07c231ee8e3ac">is_data_type_quantized_per_channel</a>(<a class="code" href="classarm__compute_1_1_i_tensor_allocator.xhtml#a29737b25723597c9708c662c7088e6c3">info</a>().<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a5f5b6c4337eac9e2e0046ca2304d80dc">data_type</a>()))</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; {</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="keyword">const</span> <span class="keywordtype">size_t</span> pad_size = 0;</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; populate_quantization_info(_scale, _offset, <a class="code" href="classarm__compute_1_1_i_tensor_allocator.xhtml#a29737b25723597c9708c662c7088e6c3">info</a>().quantization_info(), pad_size);</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; }</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; <span class="comment">// Lock allocator</span></div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <a class="code" href="classarm__compute_1_1_i_tensor_allocator.xhtml#a29737b25723597c9708c662c7088e6c3">info</a>().<a class="code" href="classarm__compute_1_1_tensor_info.xhtml#a78bf77b2d9b959259f77a32b9a412184">set_is_resizable</a>(<span class="keyword">false</span>);</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;}</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a1468b0adb6ec3f9d38aa7d60b8a91974"> 159</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a1468b0adb6ec3f9d38aa7d60b8a91974">CLTensorAllocator::free</a>()</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;{</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; _mapping = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; _memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a5e343ebd0fb1c7816e7abfee53d2578b">set_region</a>(<span class="keyword">nullptr</span>);</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; clear_quantization_arrays(_scale, _offset);</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <a class="code" href="classarm__compute_1_1_i_tensor_allocator.xhtml#a29737b25723597c9708c662c7088e6c3">info</a>().<a class="code" href="classarm__compute_1_1_tensor_info.xhtml#a78bf77b2d9b959259f77a32b9a412184">set_is_resizable</a>(<span class="keyword">true</span>);</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;</div><div class="line"><a name="l00167"></a><span class="lineno"><a class="line" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#aee45c9a6939cadf66a6e7d998c6f59df"> 167</a></span>&#160;<a class="code" href="classarm__compute_1_1_status.xhtml">Status</a> <a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#aee45c9a6939cadf66a6e7d998c6f59df">CLTensorAllocator::import_memory</a>(cl::Buffer buffer)</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;{</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <a class="code" href="_error_8h.xhtml#a206d6e247e0957ac3dee45d27756fc25">ARM_COMPUTE_RETURN_ERROR_ON</a>(buffer.get() == <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <a class="code" href="_error_8h.xhtml#a206d6e247e0957ac3dee45d27756fc25">ARM_COMPUTE_RETURN_ERROR_ON</a>(buffer.getInfo&lt;CL_MEM_SIZE&gt;() &lt; <a class="code" href="classarm__compute_1_1_i_tensor_allocator.xhtml#a29737b25723597c9708c662c7088e6c3">info</a>().total_size());</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <a class="code" href="_error_8h.xhtml#a206d6e247e0957ac3dee45d27756fc25">ARM_COMPUTE_RETURN_ERROR_ON</a>(buffer.getInfo&lt;CL_MEM_CONTEXT&gt;().get() != <a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a9b58d0eb9a2af8e6d7908695e1557d6c">CLScheduler::get</a>().<a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a86409f541991c3ac377c2a6b7d1f832d">context</a>().get());</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <a class="code" href="_error_8h.xhtml#a206d6e247e0957ac3dee45d27756fc25">ARM_COMPUTE_RETURN_ERROR_ON</a>(_associated_memory_group != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordflow">if</span>(_ctx == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; {</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keyword">auto</span> legacy_ctx = <a class="code" href="classarm__compute_1_1_c_l_core_runtime_context.xhtml">CLCoreRuntimeContext</a>(<span class="keyword">nullptr</span>, <a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a9b58d0eb9a2af8e6d7908695e1557d6c">CLScheduler::get</a>().context(), <a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a9b58d0eb9a2af8e6d7908695e1557d6c">CLScheduler::get</a>().queue());</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; _memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#af2d30bc4b38a0f4703ff154a39f1b422">set_owned_region</a>(support::cpp14::make_unique&lt;CLBufferMemoryRegion&gt;(buffer, &amp;legacy_ctx));</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; }</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; {</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; _memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#af2d30bc4b38a0f4703ff154a39f1b422">set_owned_region</a>(support::cpp14::make_unique&lt;CLBufferMemoryRegion&gt;(buffer, _ctx-&gt;<a class="code" href="classarm__compute_1_1_c_l_runtime_context.xhtml#a7b4da359c81757339d03c7753b95f617">core_runtime_context</a>()));</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; }</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <a class="code" href="classarm__compute_1_1_i_tensor_allocator.xhtml#a29737b25723597c9708c662c7088e6c3">info</a>().<a class="code" href="classarm__compute_1_1_tensor_info.xhtml#a78bf77b2d9b959259f77a32b9a412184">set_is_resizable</a>(<span class="keyword">false</span>);</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classarm__compute_1_1_status.xhtml">Status</a>{};</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;}</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a34177e00ce3d627e8a6a9ca215aaddfb"> 188</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a34177e00ce3d627e8a6a9ca215aaddfb">CLTensorAllocator::set_associated_memory_group</a>(<a class="code" href="classarm__compute_1_1_i_memory_group.xhtml">IMemoryGroup</a> *associated_memory_group)</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;{</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(associated_memory_group == <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(_associated_memory_group != <span class="keyword">nullptr</span> &amp;&amp; _associated_memory_group != associated_memory_group);</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(_memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a146cb960b44f4b1fb11ef4420382021a">region</a>() != <span class="keyword">nullptr</span> &amp;&amp; _memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a4ca2850f9acbac8fb013038b4d9b684d">cl_region</a>()-&gt;<a class="code" href="classarm__compute_1_1_i_c_l_memory_region.xhtml#ac7e247b94ceae35db2a172961ab83df9">cl_data</a>().get() != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; _associated_memory_group = associated_memory_group;</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;}</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;uint8_t *CLTensorAllocator::lock()</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160;{</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <span class="keywordflow">if</span>(_ctx)</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; {</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a15eaecea13a8a49c8d259fddefcbd7ac">map</a>(_ctx-&gt;<a class="code" href="classarm__compute_1_1_c_l_runtime_context.xhtml#aca669157282266de0605044219e0d2b6">gpu_scheduler</a>()-&gt;<a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a398a2582c746d28fc125487a44c9ed74">queue</a>(), <span class="keyword">true</span>);</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; }</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; {</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a15eaecea13a8a49c8d259fddefcbd7ac">map</a>(<a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a9b58d0eb9a2af8e6d7908695e1557d6c">CLScheduler::get</a>().queue(), <span class="keyword">true</span>);</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; }</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;}</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;<span class="keywordtype">void</span> CLTensorAllocator::unlock()</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;{</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(_memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a146cb960b44f4b1fb11ef4420382021a">region</a>() == <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="keywordflow">if</span>(_ctx)</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; {</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a34b854d640d247bd7422f60ca2f3a05c">unmap</a>(_ctx-&gt;<a class="code" href="classarm__compute_1_1_c_l_runtime_context.xhtml#aca669157282266de0605044219e0d2b6">gpu_scheduler</a>()-&gt;<a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a398a2582c746d28fc125487a44c9ed74">queue</a>(), reinterpret_cast&lt;uint8_t *&gt;(_memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a146cb960b44f4b1fb11ef4420382021a">region</a>()-&gt;<a class="code" href="classarm__compute_1_1_i_memory_region.xhtml#af4cf95f81e1b269a31d2d9a7e0429a24">buffer</a>()));</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; }</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordflow">else</span></div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; {</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <span class="comment">//Legacy singleton api</span></div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a34b854d640d247bd7422f60ca2f3a05c">unmap</a>(<a class="code" href="classarm__compute_1_1_c_l_scheduler.xhtml#a9b58d0eb9a2af8e6d7908695e1557d6c">CLScheduler::get</a>().queue(), reinterpret_cast&lt;uint8_t *&gt;(_memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a146cb960b44f4b1fb11ef4420382021a">region</a>()-&gt;<a class="code" href="classarm__compute_1_1_i_memory_region.xhtml#af4cf95f81e1b269a31d2d9a7e0429a24">buffer</a>()));</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; }</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;}</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;</div><div class="line"><a name="l00223"></a><span class="lineno"><a class="line" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a15eaecea13a8a49c8d259fddefcbd7ac"> 223</a></span>&#160;uint8_t *<a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a15eaecea13a8a49c8d259fddefcbd7ac">CLTensorAllocator::map</a>(cl::CommandQueue &amp;q, <span class="keywordtype">bool</span> blocking)</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;{</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(_mapping != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(_memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a146cb960b44f4b1fb11ef4420382021a">region</a>() == <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(_memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a146cb960b44f4b1fb11ef4420382021a">region</a>()-&gt;<a class="code" href="classarm__compute_1_1_i_memory_region.xhtml#af4cf95f81e1b269a31d2d9a7e0429a24">buffer</a>() != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; _mapping = reinterpret_cast&lt;uint8_t *&gt;(_memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a4ca2850f9acbac8fb013038b4d9b684d">cl_region</a>()-&gt;<a class="code" href="classarm__compute_1_1_i_c_l_memory_region.xhtml#a929af627a6a0430539998d12024d6c69">map</a>(q, blocking));</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="keywordflow">return</span> _mapping;</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;}</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;</div><div class="line"><a name="l00233"></a><span class="lineno"><a class="line" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a34b854d640d247bd7422f60ca2f3a05c"> 233</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a34b854d640d247bd7422f60ca2f3a05c">CLTensorAllocator::unmap</a>(cl::CommandQueue &amp;q, uint8_t *mapping)</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160;{</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(_mapping == <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(_mapping != mapping);</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(_memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a146cb960b44f4b1fb11ef4420382021a">region</a>() == <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(_memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a146cb960b44f4b1fb11ef4420382021a">region</a>()-&gt;<a class="code" href="classarm__compute_1_1_i_memory_region.xhtml#af4cf95f81e1b269a31d2d9a7e0429a24">buffer</a>() == <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <a class="code" href="_error_8h.xhtml#a6dc630a6ae9cc063b3924bcea8dee9d6">ARM_COMPUTE_UNUSED</a>(mapping);</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; _memory.<a class="code" href="classarm__compute_1_1_c_l_memory.xhtml#a4ca2850f9acbac8fb013038b4d9b684d">cl_region</a>()-&gt;<a class="code" href="classarm__compute_1_1_i_c_l_memory_region.xhtml#a0ee6b952accaff0f7e8e61bda7889102">unmap</a>(q);</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; _mapping = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;}</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;} <span class="comment">// namespace arm_compute</span></div><div class="ttc" id="classarm__compute_1_1_i_memory_group_xhtml"><div class="ttname"><a href="classarm__compute_1_1_i_memory_group.xhtml">arm_compute::IMemoryGroup</a></div><div class="ttdoc">Memory group interface.</div><div class="ttdef"><b>Definition:</b> <a href="_i_memory_group_8h_source.xhtml#l00037">IMemoryGroup.h:37</a></div></div>
<div class="ttc" id="src_2core_2_c_l_2cl__kernels_2_helpers_8h_xhtml_a009469e4d9b8fce3b6d5e97d2077827d"><div class="ttname"><a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h.xhtml#a009469e4d9b8fce3b6d5e97d2077827d">offset</a></div><div class="ttdeci">__global uchar * offset(const Image *img, int x, int y)</div><div class="ttdoc">Get the pointer position of a Image.</div><div class="ttdef"><b>Definition:</b> <a href="src_2core_2_c_l_2cl__kernels_2_helpers_8h_source.xhtml#l00510">helpers.h:510</a></div></div>
<div class="ttc" id="classarm__compute_1_1_quantization_info_xhtml_a08ffa53eaabde3e18b003f8182ac09bf"><div class="ttname"><a href="classarm__compute_1_1_quantization_info.xhtml#a08ffa53eaabde3e18b003f8182ac09bf">arm_compute::QuantizationInfo::offset</a></div><div class="ttdeci">const std::vector&lt; int32_t &gt; &amp; offset() const</div><div class="ttdoc">Offset vector accessor.</div><div class="ttdef"><b>Definition:</b> <a href="_quantization_info_8h_source.xhtml#l00132">QuantizationInfo.h:132</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_scheduler_xhtml_a9b58d0eb9a2af8e6d7908695e1557d6c"><div class="ttname"><a href="classarm__compute_1_1_c_l_scheduler.xhtml#a9b58d0eb9a2af8e6d7908695e1557d6c">arm_compute::CLScheduler::get</a></div><div class="ttdeci">static CLScheduler &amp; get()</div><div class="ttdoc">Access the scheduler singleton.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_scheduler_8cpp_source.xhtml#l00099">CLScheduler.cpp:99</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_tensor_allocator_xhtml_a5c27e81a1ad958e4de947c1da77f4cf1"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a5c27e81a1ad958e4de947c1da77f4cf1">arm_compute::CLTensorAllocator::quantization</a></div><div class="ttdeci">CLQuantization quantization() const</div><div class="ttdoc">Wrapped quantization info data accessor.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_tensor_allocator_8cpp_source.xhtml#l00112">CLTensorAllocator.cpp:112</a></div></div>
<div class="ttc" id="_error_8h_xhtml_a54a6080c9f4df1f908e57a9bbb46f5da"><div class="ttname"><a href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON(cond)</div><div class="ttdoc">If the condition is true then an error message is printed and an exception thrown.</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00466">Error.h:466</a></div></div>
<div class="ttc" id="classarm__compute_1_1_i_memory_region_xhtml_af4cf95f81e1b269a31d2d9a7e0429a24"><div class="ttname"><a href="classarm__compute_1_1_i_memory_region.xhtml#af4cf95f81e1b269a31d2d9a7e0429a24">arm_compute::IMemoryRegion::buffer</a></div><div class="ttdeci">virtual void * buffer()=0</div><div class="ttdoc">Returns the pointer to the allocated data.</div></div>
<div class="ttc" id="classarm__compute_1_1_status_xhtml"><div class="ttname"><a href="classarm__compute_1_1_status.xhtml">arm_compute::Status</a></div><div class="ttdoc">Status class.</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00052">Error.h:52</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_runtime_context_xhtml_a7b4da359c81757339d03c7753b95f617"><div class="ttname"><a href="classarm__compute_1_1_c_l_runtime_context.xhtml#a7b4da359c81757339d03c7753b95f617">arm_compute::CLRuntimeContext::core_runtime_context</a></div><div class="ttdeci">CLCoreRuntimeContext * core_runtime_context()</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_runtime_context_8cpp_source.xhtml#l00051">CLRuntimeContext.cpp:51</a></div></div>
<div class="ttc" id="_tensor_info_8h_xhtml"><div class="ttname"><a href="_tensor_info_8h.xhtml">TensorInfo.h</a></div></div>
<div class="ttc" id="_error_8h_xhtml_a206d6e247e0957ac3dee45d27756fc25"><div class="ttname"><a href="_error_8h.xhtml#a206d6e247e0957ac3dee45d27756fc25">ARM_COMPUTE_RETURN_ERROR_ON</a></div><div class="ttdeci">#define ARM_COMPUTE_RETURN_ERROR_ON(cond)</div><div class="ttdoc">If the condition is true, an error is returned.</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00296">Error.h:296</a></div></div>
<div class="ttc" id="structarm__compute_1_1_c_l_quantization_xhtml"><div class="ttname"><a href="structarm__compute_1_1_c_l_quantization.xhtml">arm_compute::CLQuantization</a></div><div class="ttdoc">OpenCL quantization data.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_types_8h_source.xhtml#l00059">CLTypes.h:59</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml"><div class="ttname"><a href="namespacearm__compute.xhtml">arm_compute</a></div><div class="ttdoc">Copyright (c) 2017-2020 ARM Limited.</div><div class="ttdef"><b>Definition:</b> <a href="00__introduction_8dox_source.xhtml#l00024">00_introduction.dox:24</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_tensor_allocator_xhtml_aee45c9a6939cadf66a6e7d998c6f59df"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#aee45c9a6939cadf66a6e7d998c6f59df">arm_compute::CLTensorAllocator::import_memory</a></div><div class="ttdeci">Status import_memory(cl::Buffer buffer)</div><div class="ttdoc">Import an existing memory as a tensor's backing memory.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_tensor_allocator_8cpp_source.xhtml#l00167">CLTensorAllocator.cpp:167</a></div></div>
<div class="ttc" id="classarm__compute_1_1_i_c_l_memory_region_xhtml_ac7e247b94ceae35db2a172961ab83df9"><div class="ttname"><a href="classarm__compute_1_1_i_c_l_memory_region.xhtml#ac7e247b94ceae35db2a172961ab83df9">arm_compute::ICLMemoryRegion::cl_data</a></div><div class="ttdeci">const cl::Buffer &amp; cl_data() const</div><div class="ttdoc">Returns the underlying CL buffer.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_memory_region_8cpp_source.xhtml#l00041">CLMemoryRegion.cpp:41</a></div></div>
<div class="ttc" id="_c_l_tensor_allocator_8h_xhtml"><div class="ttname"><a href="_c_l_tensor_allocator_8h.xhtml">CLTensorAllocator.h</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_tensor_allocator_xhtml_a34177e00ce3d627e8a6a9ca215aaddfb"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a34177e00ce3d627e8a6a9ca215aaddfb">arm_compute::CLTensorAllocator::set_associated_memory_group</a></div><div class="ttdeci">void set_associated_memory_group(IMemoryGroup *associated_memory_group)</div><div class="ttdoc">Associates the tensor with a memory group.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_tensor_allocator_8cpp_source.xhtml#l00188">CLTensorAllocator.cpp:188</a></div></div>
<div class="ttc" id="_c_l_scheduler_8h_xhtml"><div class="ttname"><a href="_c_l_scheduler_8h.xhtml">CLScheduler.h</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a193a4859b365f3ef4e0d73a1e6b12c85"><div class="ttname"><a href="namespacearm__compute.xhtml#a193a4859b365f3ef4e0d73a1e6b12c85">arm_compute::CLFloatArray</a></div><div class="ttdeci">CLArray&lt; cl_float &gt; CLFloatArray</div><div class="ttdoc">OpenCL Array of floats.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_array_8h_source.xhtml#l00125">CLArray.h:125</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_tensor_allocator_xhtml_a99c07c946023f413991a249db8b99ab0"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a99c07c946023f413991a249db8b99ab0">arm_compute::CLTensorAllocator::data</a></div><div class="ttdeci">uint8_t * data()</div><div class="ttdoc">Interface to be implemented by the child class to return the pointer to the mapped data.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_tensor_allocator_8cpp_source.xhtml#l00117">CLTensorAllocator.cpp:117</a></div></div>
<div class="ttc" id="_error_8h_xhtml_a6dc630a6ae9cc063b3924bcea8dee9d6"><div class="ttname"><a href="_error_8h.xhtml#a6dc630a6ae9cc063b3924bcea8dee9d6">ARM_COMPUTE_UNUSED</a></div><div class="ttdeci">#define ARM_COMPUTE_UNUSED(...)</div><div class="ttdoc">To avoid unused variables warnings.</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00152">Error.h:152</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_tensor_allocator_xhtml_a15eaecea13a8a49c8d259fddefcbd7ac"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a15eaecea13a8a49c8d259fddefcbd7ac">arm_compute::CLTensorAllocator::map</a></div><div class="ttdeci">uint8_t * map(cl::CommandQueue &amp;q, bool blocking)</div><div class="ttdoc">Enqueue a map operation of the allocated buffer on the given queue.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_tensor_allocator_8cpp_source.xhtml#l00223">CLTensorAllocator.cpp:223</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_scheduler_xhtml_a86409f541991c3ac377c2a6b7d1f832d"><div class="ttname"><a href="classarm__compute_1_1_c_l_scheduler.xhtml#a86409f541991c3ac377c2a6b7d1f832d">arm_compute::CLScheduler::context</a></div><div class="ttdeci">cl::Context &amp; context()</div><div class="ttdoc">Accessor for the associated CL context.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_scheduler_8cpp_source.xhtml#l00034">CLScheduler.cpp:34</a></div></div>
<div class="ttc" id="classarm__compute_1_1_i_memory_group_xhtml_afe894be960031e036ae121a4c5111043"><div class="ttname"><a href="classarm__compute_1_1_i_memory_group.xhtml#afe894be960031e036ae121a4c5111043">arm_compute::IMemoryGroup::finalize_memory</a></div><div class="ttdeci">virtual void finalize_memory(IMemoryManageable *obj, IMemory &amp;obj_memory, size_t size, size_t alignment)=0</div><div class="ttdoc">Finalizes memory for a given object.</div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_core_runtime_context_xhtml"><div class="ttname"><a href="classarm__compute_1_1_c_l_core_runtime_context.xhtml">arm_compute::CLCoreRuntimeContext</a></div><div class="ttdoc">Core runtime context for OpenCL.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_core_runtime_context_8h_source.xhtml#l00035">CLCoreRuntimeContext.h:35</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a84437d80241f6a31e1a07c231ee8e3ac"><div class="ttname"><a href="namespacearm__compute.xhtml#a84437d80241f6a31e1a07c231ee8e3ac">arm_compute::is_data_type_quantized_per_channel</a></div><div class="ttdeci">bool is_data_type_quantized_per_channel(DataType dt)</div><div class="ttdoc">Check if a given data type is of per channel type.</div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_utils_8h_source.xhtml#l01194">Utils.h:1194</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_memory_xhtml_af2d30bc4b38a0f4703ff154a39f1b422"><div class="ttname"><a href="classarm__compute_1_1_c_l_memory.xhtml#af2d30bc4b38a0f4703ff154a39f1b422">arm_compute::CLMemory::set_owned_region</a></div><div class="ttdeci">void set_owned_region(std::unique_ptr&lt; IMemoryRegion &gt; region) final</div><div class="ttdoc">Sets a memory region.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_memory_8cpp_source.xhtml#l00076">CLMemory.cpp:76</a></div></div>
<div class="ttc" id="classarm__compute_1_1_tensor_info_xhtml_af398466b602a02b42d8df19fb66a6c60"><div class="ttname"><a href="classarm__compute_1_1_tensor_info.xhtml#af398466b602a02b42d8df19fb66a6c60">arm_compute::TensorInfo::total_size</a></div><div class="ttdeci">size_t total_size() const override</div><div class="ttdoc">Returns the total size of the tensor in bytes.</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_info_8h_source.xhtml#l00273">TensorInfo.h:273</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_tensor_allocator_xhtml_aba4802aaab407cc9b70b5e396f203203"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#aba4802aaab407cc9b70b5e396f203203">arm_compute::CLTensorAllocator::CLTensorAllocator</a></div><div class="ttdeci">CLTensorAllocator(IMemoryManageable *owner=nullptr, CLRuntimeContext *ctx=nullptr)</div><div class="ttdoc">Default constructor.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_tensor_allocator_8cpp_source.xhtml#l00107">CLTensorAllocator.cpp:107</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_memory_xhtml_a146cb960b44f4b1fb11ef4420382021a"><div class="ttname"><a href="classarm__compute_1_1_c_l_memory.xhtml#a146cb960b44f4b1fb11ef4420382021a">arm_compute::CLMemory::region</a></div><div class="ttdeci">IMemoryRegion * region() final</div><div class="ttdoc">Region accessor.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_memory_8cpp_source.xhtml#l00059">CLMemory.cpp:59</a></div></div>
<div class="ttc" id="classarm__compute_1_1_i_tensor_allocator_xhtml_a32899157b4898866a4a58440f2f7b13f"><div class="ttname"><a href="classarm__compute_1_1_i_tensor_allocator.xhtml#a32899157b4898866a4a58440f2f7b13f">arm_compute::ITensorAllocator::alignment</a></div><div class="ttdeci">size_t alignment() const</div><div class="ttdoc">Return underlying's tensor buffer alignment.</div><div class="ttdef"><b>Definition:</b> <a href="_i_tensor_allocator_8cpp_source.xhtml#l00054">ITensorAllocator.cpp:54</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_runtime_context_xhtml"><div class="ttname"><a href="classarm__compute_1_1_c_l_runtime_context.xhtml">arm_compute::CLRuntimeContext</a></div><div class="ttdoc">Runtime context.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_runtime_context_8h_source.xhtml#l00038">CLRuntimeContext.h:38</a></div></div>
<div class="ttc" id="classarm__compute_1_1_quantization_info_xhtml_af21c7fddee28e9aa0a37c633300db0e0"><div class="ttname"><a href="classarm__compute_1_1_quantization_info.xhtml#af21c7fddee28e9aa0a37c633300db0e0">arm_compute::QuantizationInfo::scale</a></div><div class="ttdeci">const std::vector&lt; float &gt; &amp; scale() const</div><div class="ttdoc">Scale vector accessor.</div><div class="ttdef"><b>Definition:</b> <a href="_quantization_info_8h_source.xhtml#l00124">QuantizationInfo.h:124</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_memory_xhtml_a4ca2850f9acbac8fb013038b4d9b684d"><div class="ttname"><a href="classarm__compute_1_1_c_l_memory.xhtml#a4ca2850f9acbac8fb013038b4d9b684d">arm_compute::CLMemory::cl_region</a></div><div class="ttdeci">ICLMemoryRegion * cl_region()</div><div class="ttdoc">OpenCL Region accessor.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_memory_8cpp_source.xhtml#l00049">CLMemory.cpp:49</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_tensor_allocator_xhtml_a34b854d640d247bd7422f60ca2f3a05c"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a34b854d640d247bd7422f60ca2f3a05c">arm_compute::CLTensorAllocator::unmap</a></div><div class="ttdeci">void unmap(cl::CommandQueue &amp;q, uint8_t *mapping)</div><div class="ttdoc">Enqueue an unmap operation of the allocated buffer on the given queue.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_tensor_allocator_8cpp_source.xhtml#l00233">CLTensorAllocator.cpp:233</a></div></div>
<div class="ttc" id="classarm__compute_1_1_tensor_info_xhtml_a78bf77b2d9b959259f77a32b9a412184"><div class="ttname"><a href="classarm__compute_1_1_tensor_info.xhtml#a78bf77b2d9b959259f77a32b9a412184">arm_compute::TensorInfo::set_is_resizable</a></div><div class="ttdeci">ITensorInfo &amp; set_is_resizable(bool is_resizable) override</div><div class="ttdoc">Set the flag whether the tensor size can be changed.</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_info_8h_source.xhtml#l00293">TensorInfo.h:293</a></div></div>
<div class="ttc" id="_error_8h_xhtml"><div class="ttname"><a href="_error_8h.xhtml">Error.h</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_scheduler_xhtml_a398a2582c746d28fc125487a44c9ed74"><div class="ttname"><a href="classarm__compute_1_1_c_l_scheduler.xhtml#a398a2582c746d28fc125487a44c9ed74">arm_compute::CLScheduler::queue</a></div><div class="ttdeci">cl::CommandQueue &amp; queue()</div><div class="ttdoc">Accessor for the associated CL command queue.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_scheduler_8cpp_source.xhtml#l00041">CLScheduler.cpp:41</a></div></div>
<div class="ttc" id="classarm__compute_1_1_i_c_l_memory_region_xhtml_a929af627a6a0430539998d12024d6c69"><div class="ttname"><a href="classarm__compute_1_1_i_c_l_memory_region.xhtml#a929af627a6a0430539998d12024d6c69">arm_compute::ICLMemoryRegion::map</a></div><div class="ttdeci">virtual void * map(cl::CommandQueue &amp;q, bool blocking)=0</div><div class="ttdoc">Enqueue a map operation of the allocated buffer on the given queue.</div></div>
<div class="ttc" id="classarm__compute_1_1_i_tensor_allocator_xhtml_a29737b25723597c9708c662c7088e6c3"><div class="ttname"><a href="classarm__compute_1_1_i_tensor_allocator.xhtml#a29737b25723597c9708c662c7088e6c3">arm_compute::ITensorAllocator::info</a></div><div class="ttdeci">TensorInfo &amp; info()</div><div class="ttdoc">Return a reference to the tensor's metadata.</div><div class="ttdef"><b>Definition:</b> <a href="_i_tensor_allocator_8cpp_source.xhtml#l00044">ITensorAllocator.cpp:44</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_memory_xhtml_a5e343ebd0fb1c7816e7abfee53d2578b"><div class="ttname"><a href="classarm__compute_1_1_c_l_memory.xhtml#a5e343ebd0fb1c7816e7abfee53d2578b">arm_compute::CLMemory::set_region</a></div><div class="ttdeci">void set_region(IMemoryRegion *region) final</div><div class="ttdoc">Sets a memory region.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_memory_8cpp_source.xhtml#l00069">CLMemory.cpp:69</a></div></div>
<div class="ttc" id="_c_l_runtime_context_8h_xhtml"><div class="ttname"><a href="_c_l_runtime_context_8h.xhtml">CLRuntimeContext.h</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_tensor_allocator_xhtml_a6e509c2a177b0b29e9e2369535094dee"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a6e509c2a177b0b29e9e2369535094dee">arm_compute::CLTensorAllocator::allocate</a></div><div class="ttdeci">void allocate() override</div><div class="ttdoc">Allocate size specified by TensorInfo of OpenCL memory.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_tensor_allocator_8cpp_source.xhtml#l00127">CLTensorAllocator.cpp:127</a></div></div>
<div class="ttc" id="namespacearm__compute_xhtml_a8a401a071524761c661a75969c951cf5"><div class="ttname"><a href="namespacearm__compute.xhtml#a8a401a071524761c661a75969c951cf5">arm_compute::CLInt32Array</a></div><div class="ttdeci">CLArray&lt; cl_int &gt; CLInt32Array</div><div class="ttdoc">OpenCL Array of int32s.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_array_8h_source.xhtml#l00123">CLArray.h:123</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#l00375">PixelWiseMultiplication.cpp:375</a></div></div>
<div class="ttc" id="classarm__compute_1_1_i_memory_manageable_xhtml"><div class="ttname"><a href="classarm__compute_1_1_i_memory_manageable.xhtml">arm_compute::IMemoryManageable</a></div><div class="ttdoc">Interface of an object than can be memory managed.</div><div class="ttdef"><b>Definition:</b> <a href="_i_memory_group_8h_source.xhtml#l00069">IMemoryGroup.h:69</a></div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_ad85d7becf0c6e3cffbc255489808e219"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#ad85d7becf0c6e3cffbc255489808e219">arm_compute::test::validation::qinfo</a></div><div class="ttdeci">const QuantizationInfo qinfo</div><div class="ttdef"><b>Definition:</b> <a href="_n_e_o_n_2_im2_col_8cpp_source.xhtml#l00150">Im2Col.cpp:150</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_tensor_allocator_xhtml_ac7e247b94ceae35db2a172961ab83df9"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#ac7e247b94ceae35db2a172961ab83df9">arm_compute::CLTensorAllocator::cl_data</a></div><div class="ttdeci">const cl::Buffer &amp; cl_data() const</div><div class="ttdoc">Interface to be implemented by the child class to return the pointer to the CL data.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_tensor_allocator_8cpp_source.xhtml#l00122">CLTensorAllocator.cpp:122</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_tensor_allocator_xhtml_a1468b0adb6ec3f9d38aa7d60b8a91974"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor_allocator.xhtml#a1468b0adb6ec3f9d38aa7d60b8a91974">arm_compute::CLTensorAllocator::free</a></div><div class="ttdeci">void free() override</div><div class="ttdoc">Free allocated OpenCL memory.</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_tensor_allocator_8cpp_source.xhtml#l00159">CLTensorAllocator.cpp:159</a></div></div>
<div class="ttc" id="classarm__compute_1_1_i_c_l_memory_region_xhtml_a0ee6b952accaff0f7e8e61bda7889102"><div class="ttname"><a href="classarm__compute_1_1_i_c_l_memory_region.xhtml#a0ee6b952accaff0f7e8e61bda7889102">arm_compute::ICLMemoryRegion::unmap</a></div><div class="ttdeci">virtual void unmap(cl::CommandQueue &amp;q)=0</div><div class="ttdoc">Enqueue an unmap operation of the allocated buffer on the given queue.</div></div>
<div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a5f5b6c4337eac9e2e0046ca2304d80dc"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a5f5b6c4337eac9e2e0046ca2304d80dc">arm_compute::test::validation::data_type</a></div><div class="ttdeci">data_type</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_arithmetic_addition_8cpp_source.xhtml#l00138">ArithmeticAddition.cpp:138</a></div></div>
<div class="ttc" id="classarm__compute_1_1_c_l_runtime_context_xhtml_aca669157282266de0605044219e0d2b6"><div class="ttname"><a href="classarm__compute_1_1_c_l_runtime_context.xhtml#aca669157282266de0605044219e0d2b6">arm_compute::CLRuntimeContext::gpu_scheduler</a></div><div class="ttdeci">CLScheduler * gpu_scheduler()</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_runtime_context_8cpp_source.xhtml#l00062">CLRuntimeContext.cpp:62</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_bf9f26469d00835ba20ff8d80ee5a804.xhtml">runtime</a></li><li class="navelem"><a class="el" href="dir_43c3fdbf778d1fd99e2e38f09fddd920.xhtml">CL</a></li><li class="navelem"><a class="el" href="_c_l_tensor_allocator_8cpp.xhtml">CLTensorAllocator.cpp</a></li>
<li class="footer">Generated on Thu Mar 5 2020 16:07:02 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>