aboutsummaryrefslogtreecommitdiff
path: root/20.02/_cpu_tensor_handle_8cpp_source.xhtml
diff options
context:
space:
mode:
Diffstat (limited to '20.02/_cpu_tensor_handle_8cpp_source.xhtml')
-rw-r--r--20.02/_cpu_tensor_handle_8cpp_source.xhtml143
1 files changed, 143 insertions, 0 deletions
diff --git a/20.02/_cpu_tensor_handle_8cpp_source.xhtml b/20.02/_cpu_tensor_handle_8cpp_source.xhtml
new file mode 100644
index 0000000000..abc9d335c9
--- /dev/null
+++ b/20.02/_cpu_tensor_handle_8cpp_source.xhtml
@@ -0,0 +1,143 @@
+<!-- Copyright (c) 2020 ARM Limited. -->
+<!-- -->
+<!-- SPDX-License-Identifier: MIT -->
+<!-- -->
+<!-- HTML header for doxygen 1.8.13-->
+<!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.13"/>
+<meta name="robots" content="NOINDEX, NOFOLLOW" />
+<meta name="viewport" content="width=device-width, initial-scale=1"/>
+<title>ArmNN: src/backends/backendsCommon/CpuTensorHandle.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">
+ $(document).ready(initResizable);
+</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" 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="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 10rem; margin-top: .5rem; margin-left 10px"/>
+ <td style="padding-left: 0.5em;">
+ <div id="projectname">
+ &#160;<span id="projectnumber">20.02</span>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.13 -->
+<script type="text/javascript">
+var searchBox = new SearchBox("searchBox", "search",false,'Search');
+</script>
+<script type="text/javascript" src="menudata.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript">
+$(function() {
+ initMenu('',true,false,'search.php','Search');
+ $(document).ready(function() { init_search(); });
+});
+</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">
+$(document).ready(function(){initNavTree('_cpu_tensor_handle_8cpp_source.xhtml','');});
+</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">CpuTensorHandle.cpp</div> </div>
+</div><!--header-->
+<div class="contents">
+<a href="_cpu_tensor_handle_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 © 2017 Arm Ltd. All rights reserved.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// SPDX-License-Identifier: MIT</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_exceptions_8hpp.xhtml">armnn/Exceptions.hpp</a>&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_ignore_unused_8hpp.xhtml">armnn/utility/IgnoreUnused.hpp</a>&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_cpu_tensor_handle_8hpp.xhtml">backendsCommon/CpuTensorHandle.hpp</a>&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="preprocessor">#include &lt;cstring&gt;</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacearmnn.xhtml">armnn</a></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;{</div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="namespacearmnn.xhtml#a36e8f52330a21eeab3cc7c4e030f3583"> 15</a></span>&#160;<a class="code" href="classarmnn_1_1_tensor_shape.xhtml">TensorShape</a> <a class="code" href="namespacearmnn.xhtml#a36e8f52330a21eeab3cc7c4e030f3583">GetUnpaddedTensorStrides</a>(<span class="keyword">const</span> <a class="code" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a>&amp; tensorInfo)</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;{</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160; <a class="code" href="classarmnn_1_1_tensor_shape.xhtml">TensorShape</a> shape(tensorInfo.<a class="code" href="classarmnn_1_1_tensor_info.xhtml#a8b5d0f8a24e9d9238f412260a552acf8">GetShape</a>());</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160; <span class="keyword">auto</span> size = <a class="code" href="namespacearmnn.xhtml#aa02b9e06fb20fa3c13da0427e6ee5ab2">GetDataTypeSize</a>(tensorInfo.<a class="code" href="classarmnn_1_1_tensor_info.xhtml#aea909c7327109228ef618d459015def3">GetDataType</a>());</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160; <span class="keyword">auto</span> runningSize = size;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160; std::vector&lt;unsigned int&gt; strides(shape.GetNumDimensions());</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; <span class="keyword">auto</span> lastIdx = shape.GetNumDimensions()-1;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i &lt; lastIdx ; i++)</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; {</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; strides[lastIdx-i] = runningSize;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; runningSize *= shape[lastIdx-i];</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; }</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; strides[0] = runningSize;</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classarmnn_1_1_tensor_shape.xhtml">TensorShape</a>(shape.GetNumDimensions(), strides.data());</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;}</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"><a class="line" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#ac9bdc423c74013d226c902c3d8a263bf"> 31</a></span>&#160;<a class="code" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#ac9bdc423c74013d226c902c3d8a263bf">ConstCpuTensorHandle::ConstCpuTensorHandle</a>(<span class="keyword">const</span> <a class="code" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a>&amp; tensorInfo)</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;: m_TensorInfo(tensorInfo)</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;, m_Memory(nullptr)</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;}</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="keyword">template</span> &lt;&gt;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#aecc243f62d4777927e15af592d330764"> 38</a></span>&#160;<span class="keyword">const</span> <span class="keywordtype">void</span>* ConstCpuTensorHandle::GetConstTensor&lt;void&gt;() <span class="keyword">const</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;{</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keywordflow">return</span> m_Memory;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;}</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classarmnn_1_1_cpu_tensor_handle.xhtml#aeacd5d2fd0265f9bbc7d494bb4026315"> 43</a></span>&#160;<a class="code" href="classarmnn_1_1_cpu_tensor_handle.xhtml#aeacd5d2fd0265f9bbc7d494bb4026315">CpuTensorHandle::CpuTensorHandle</a>(<span class="keyword">const</span> <a class="code" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a>&amp; tensorInfo)</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;: <a class="code" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml">ConstCpuTensorHandle</a>(tensorInfo)</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;, m_MutableMemory(nullptr)</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;}</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;<span class="keyword">template</span> &lt;&gt;</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="classarmnn_1_1_cpu_tensor_handle.xhtml#a3871e7881538e3be0b16e70beb2d0c38"> 50</a></span>&#160;<span class="keywordtype">void</span>* CpuTensorHandle::GetTensor&lt;void&gt;() <span class="keyword">const</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;{</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keywordflow">return</span> m_MutableMemory;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;}</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#a1eee87f1c25cef40cbf163cad231a426"> 55</a></span>&#160;<a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#a1eee87f1c25cef40cbf163cad231a426">ScopedCpuTensorHandle::ScopedCpuTensorHandle</a>(<span class="keyword">const</span> <a class="code" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a>&amp; tensorInfo)</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;: <a class="code" href="classarmnn_1_1_cpu_tensor_handle.xhtml">CpuTensorHandle</a>(tensorInfo)</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;}</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#a13864c168ce45c781d3455dd49c2e9d1"> 60</a></span>&#160;<a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#a1eee87f1c25cef40cbf163cad231a426">ScopedCpuTensorHandle::ScopedCpuTensorHandle</a>(<span class="keyword">const</span> <a class="code" href="classarmnn_1_1_const_tensor.xhtml">ConstTensor</a>&amp; tensor)</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;: <a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml">ScopedCpuTensorHandle</a>(tensor.GetInfo())</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; CopyFrom(tensor.<a class="code" href="classarmnn_1_1_base_tensor.xhtml#aa81f67ac64f0c249e26499600c45d996">GetMemoryArea</a>(), tensor.<a class="code" href="classarmnn_1_1_base_tensor.xhtml#abcbdfb544ece4c31d0b37715ad0f3be0">GetNumBytes</a>());</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;}</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#a80173a05406a4c168ec03f6b2e36d6ed"> 66</a></span>&#160;<a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#a1eee87f1c25cef40cbf163cad231a426">ScopedCpuTensorHandle::ScopedCpuTensorHandle</a>(<span class="keyword">const</span> <a class="code" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml">ConstCpuTensorHandle</a>&amp; tensorHandle)</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;: <a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml">ScopedCpuTensorHandle</a>(tensorHandle.<a class="code" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#a66e8f43a5b42b500871ed96e15419567">GetTensorInfo</a>())</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;{</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; CopyFrom(tensorHandle.<a class="code" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#a3a76fc8b348e13d5a6ac1240c96ebef4">GetConstTensor</a>&lt;<span class="keywordtype">void</span>&gt;(), tensorHandle.<a class="code" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#a66e8f43a5b42b500871ed96e15419567">GetTensorInfo</a>().<a class="code" href="classarmnn_1_1_tensor_info.xhtml#abcbdfb544ece4c31d0b37715ad0f3be0">GetNumBytes</a>());</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;}</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"><a class="line" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#ae97b9f072ef4b9d98cc735a094e40962"> 72</a></span>&#160;<a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#a1eee87f1c25cef40cbf163cad231a426">ScopedCpuTensorHandle::ScopedCpuTensorHandle</a>(<span class="keyword">const</span> <a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml">ScopedCpuTensorHandle</a>&amp; other)</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;: <a class="code" href="classarmnn_1_1_cpu_tensor_handle.xhtml">CpuTensorHandle</a>(other.<a class="code" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#a66e8f43a5b42b500871ed96e15419567">GetTensorInfo</a>())</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;{</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; CopyFrom(other);</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;}</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#aef93c47aa1c6ecbbf262af95d75cc957"> 78</a></span>&#160;<a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml">ScopedCpuTensorHandle</a>&amp; <a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#aef93c47aa1c6ecbbf262af95d75cc957">ScopedCpuTensorHandle::operator=</a>(<span class="keyword">const</span> <a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml">ScopedCpuTensorHandle</a>&amp; other)</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;{</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; ::operator <span class="keyword">delete</span>(GetTensor&lt;void&gt;());</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <a class="code" href="classarmnn_1_1_cpu_tensor_handle.xhtml#a0feac8591ac1a88993aa3278b24dcb57">SetMemory</a>(<span class="keyword">nullptr</span>);</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; CopyFrom(other);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordflow">return</span> *<span class="keyword">this</span>;</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;</div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#afe9682a83c8e6967e18db5603c4eed2a"> 86</a></span>&#160;<a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#afe9682a83c8e6967e18db5603c4eed2a">ScopedCpuTensorHandle::~ScopedCpuTensorHandle</a>()</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; ::operator <span class="keyword">delete</span>(GetTensor&lt;void&gt;());</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;}</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#a8518772c5d692e334a76617582b10b92"> 91</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#a8518772c5d692e334a76617582b10b92">ScopedCpuTensorHandle::Allocate</a>()</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;{</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">if</span> (GetTensor&lt;void&gt;() == <span class="keyword">nullptr</span>)</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; <a class="code" href="classarmnn_1_1_cpu_tensor_handle.xhtml#a0feac8591ac1a88993aa3278b24dcb57">SetMemory</a>(::<span class="keyword">operator</span> <span class="keyword">new</span>(<a class="code" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#a66e8f43a5b42b500871ed96e15419567">GetTensorInfo</a>().GetNumBytes()));</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="keywordflow">else</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; {</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">throw</span> <a class="code" href="classarmnn_1_1_invalid_argument_exception.xhtml">InvalidArgumentException</a>(<span class="stringliteral">&quot;CpuTensorHandle::Allocate Trying to allocate a CpuTensorHandle&quot;</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="stringliteral">&quot;that already has allocated memory.&quot;</span>);</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; }</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;}</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;<span class="keywordtype">void</span> ScopedCpuTensorHandle::CopyOutTo(<span class="keywordtype">void</span>* memory)<span class="keyword"> const</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="keyword"></span>{</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; memcpy(memory, GetTensor&lt;void&gt;(), <a class="code" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#a66e8f43a5b42b500871ed96e15419567">GetTensorInfo</a>().GetNumBytes());</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;}</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;<span class="keywordtype">void</span> ScopedCpuTensorHandle::CopyInFrom(<span class="keyword">const</span> <span class="keywordtype">void</span>* memory)</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; memcpy(GetTensor&lt;void&gt;(), memory, <a class="code" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#a66e8f43a5b42b500871ed96e15419567">GetTensorInfo</a>().GetNumBytes());</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;}</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="keywordtype">void</span> ScopedCpuTensorHandle::CopyFrom(<span class="keyword">const</span> <a class="code" href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml">ScopedCpuTensorHandle</a>&amp; other)</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; CopyFrom(other.<a class="code" href="classarmnn_1_1_cpu_tensor_handle.xhtml#aabedf69ab42fd7a0b0f751dd8534e2ab">GetTensor</a>&lt;<span class="keywordtype">void</span>&gt;(), other.<a class="code" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#a66e8f43a5b42b500871ed96e15419567">GetTensorInfo</a>().<a class="code" href="classarmnn_1_1_tensor_info.xhtml#abcbdfb544ece4c31d0b37715ad0f3be0">GetNumBytes</a>());</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;}</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="keywordtype">void</span> ScopedCpuTensorHandle::CopyFrom(<span class="keyword">const</span> <span class="keywordtype">void</span>* srcMemory, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numBytes)</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; BOOST_ASSERT(GetTensor&lt;void&gt;() == <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; BOOST_ASSERT(<a class="code" href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#a66e8f43a5b42b500871ed96e15419567">GetTensorInfo</a>().GetNumBytes() == numBytes);</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keywordflow">if</span> (srcMemory)</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="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#a8518772c5d692e334a76617582b10b92">Allocate</a>();</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; memcpy(GetTensor&lt;void&gt;(), srcMemory, numBytes);</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;}</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno"><a class="line" href="classarmnn_1_1_passthrough_cpu_tensor_handle.xhtml#a8518772c5d692e334a76617582b10b92"> 131</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classarmnn_1_1_passthrough_cpu_tensor_handle.xhtml#a8518772c5d692e334a76617582b10b92">PassthroughCpuTensorHandle::Allocate</a>()</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;{</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keywordflow">throw</span> <a class="code" href="classarmnn_1_1_invalid_argument_exception.xhtml">InvalidArgumentException</a>(<span class="stringliteral">&quot;PassthroughCpuTensorHandle::Allocate() should never be called&quot;</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;</div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="classarmnn_1_1_const_passthrough_cpu_tensor_handle.xhtml#a8518772c5d692e334a76617582b10b92"> 136</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="classarmnn_1_1_const_passthrough_cpu_tensor_handle.xhtml#a8518772c5d692e334a76617582b10b92">ConstPassthroughCpuTensorHandle::Allocate</a>()</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">throw</span> <a class="code" href="classarmnn_1_1_invalid_argument_exception.xhtml">InvalidArgumentException</a>(<span class="stringliteral">&quot;ConstPassthroughCpuTensorHandle::Allocate() should never be called&quot;</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;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;} <span class="comment">// namespace armnn</span></div><div class="ttc" id="_ignore_unused_8hpp_xhtml"><div class="ttname"><a href="_ignore_unused_8hpp.xhtml">IgnoreUnused.hpp</a></div></div>
+<div class="ttc" id="classarmnn_1_1_tensor_info_xhtml_a8b5d0f8a24e9d9238f412260a552acf8"><div class="ttname"><a href="classarmnn_1_1_tensor_info.xhtml#a8b5d0f8a24e9d9238f412260a552acf8">armnn::TensorInfo::GetShape</a></div><div class="ttdeci">const TensorShape &amp; GetShape() const</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00088">Tensor.hpp:88</a></div></div>
+<div class="ttc" id="classarmnn_1_1_tensor_info_xhtml"><div class="ttname"><a href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00053">Tensor.hpp:53</a></div></div>
+<div class="ttc" id="classarmnn_1_1_tensor_info_xhtml_abcbdfb544ece4c31d0b37715ad0f3be0"><div class="ttname"><a href="classarmnn_1_1_tensor_info.xhtml#abcbdfb544ece4c31d0b37715ad0f3be0">armnn::TensorInfo::GetNumBytes</a></div><div class="ttdeci">unsigned int GetNumBytes() const</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8cpp_source.xhtml#l00213">Tensor.cpp:213</a></div></div>
+<div class="ttc" id="classarmnn_1_1_const_cpu_tensor_handle_xhtml"><div class="ttname"><a href="classarmnn_1_1_const_cpu_tensor_handle.xhtml">armnn::ConstCpuTensorHandle</a></div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8hpp_source.xhtml#l00027">CpuTensorHandle.hpp:27</a></div></div>
+<div class="ttc" id="classarmnn_1_1_cpu_tensor_handle_xhtml_aabedf69ab42fd7a0b0f751dd8534e2ab"><div class="ttname"><a href="classarmnn_1_1_cpu_tensor_handle.xhtml#aabedf69ab42fd7a0b0f751dd8534e2ab">armnn::CpuTensorHandle::GetTensor</a></div><div class="ttdeci">T * GetTensor() const</div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8hpp_source.xhtml#l00080">CpuTensorHandle.hpp:80</a></div></div>
+<div class="ttc" id="classarmnn_1_1_cpu_tensor_handle_xhtml_a0feac8591ac1a88993aa3278b24dcb57"><div class="ttname"><a href="classarmnn_1_1_cpu_tensor_handle.xhtml#a0feac8591ac1a88993aa3278b24dcb57">armnn::CpuTensorHandle::SetMemory</a></div><div class="ttdeci">void SetMemory(void *mem)</div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8hpp_source.xhtml#l00089">CpuTensorHandle.hpp:89</a></div></div>
+<div class="ttc" id="classarmnn_1_1_base_tensor_xhtml_aa81f67ac64f0c249e26499600c45d996"><div class="ttname"><a href="classarmnn_1_1_base_tensor.xhtml#aa81f67ac64f0c249e26499600c45d996">armnn::BaseTensor::GetMemoryArea</a></div><div class="ttdeci">MemoryType GetMemoryArea() const</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00177">Tensor.hpp:177</a></div></div>
+<div class="ttc" id="classarmnn_1_1_const_cpu_tensor_handle_xhtml_a3a76fc8b348e13d5a6ac1240c96ebef4"><div class="ttname"><a href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#a3a76fc8b348e13d5a6ac1240c96ebef4">armnn::ConstCpuTensorHandle::GetConstTensor</a></div><div class="ttdeci">const T * GetConstTensor() const</div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8hpp_source.xhtml#l00031">CpuTensorHandle.hpp:31</a></div></div>
+<div class="ttc" id="namespacearmnn_xhtml"><div class="ttname"><a href="namespacearmnn.xhtml">armnn</a></div><div class="ttdoc">Copyright (c) 2020 ARM Limited. </div><div class="ttdef"><b>Definition:</b> <a href="00__introduction_8dox_source.xhtml#l00025">00_introduction.dox:25</a></div></div>
+<div class="ttc" id="classarmnn_1_1_tensor_shape_xhtml"><div class="ttname"><a href="classarmnn_1_1_tensor_shape.xhtml">armnn::TensorShape</a></div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00020">Tensor.hpp:20</a></div></div>
+<div class="ttc" id="classarmnn_1_1_scoped_cpu_tensor_handle_xhtml_aef93c47aa1c6ecbbf262af95d75cc957"><div class="ttname"><a href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#aef93c47aa1c6ecbbf262af95d75cc957">armnn::ScopedCpuTensorHandle::operator=</a></div><div class="ttdeci">ScopedCpuTensorHandle &amp; operator=(const ScopedCpuTensorHandle &amp;other)</div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8cpp_source.xhtml#l00078">CpuTensorHandle.cpp:78</a></div></div>
+<div class="ttc" id="classarmnn_1_1_const_passthrough_cpu_tensor_handle_xhtml_a8518772c5d692e334a76617582b10b92"><div class="ttname"><a href="classarmnn_1_1_const_passthrough_cpu_tensor_handle.xhtml#a8518772c5d692e334a76617582b10b92">armnn::ConstPassthroughCpuTensorHandle::Allocate</a></div><div class="ttdeci">virtual void Allocate() override</div><div class="ttdoc">Indicate to the memory manager that this resource is no longer active. </div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8cpp_source.xhtml#l00136">CpuTensorHandle.cpp:136</a></div></div>
+<div class="ttc" id="classarmnn_1_1_tensor_info_xhtml_aea909c7327109228ef618d459015def3"><div class="ttname"><a href="classarmnn_1_1_tensor_info.xhtml#aea909c7327109228ef618d459015def3">armnn::TensorInfo::GetDataType</a></div><div class="ttdeci">DataType GetDataType() const</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00095">Tensor.hpp:95</a></div></div>
+<div class="ttc" id="classarmnn_1_1_const_tensor_xhtml"><div class="ttname"><a href="classarmnn_1_1_const_tensor.xhtml">armnn::ConstTensor</a></div><div class="ttdoc">A tensor defined by a TensorInfo (shape and data type) and an immutable backing store. </div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00199">Tensor.hpp:199</a></div></div>
+<div class="ttc" id="classarmnn_1_1_cpu_tensor_handle_xhtml"><div class="ttname"><a href="classarmnn_1_1_cpu_tensor_handle.xhtml">armnn::CpuTensorHandle</a></div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8hpp_source.xhtml#l00076">CpuTensorHandle.hpp:76</a></div></div>
+<div class="ttc" id="classarmnn_1_1_invalid_argument_exception_xhtml"><div class="ttname"><a href="classarmnn_1_1_invalid_argument_exception.xhtml">armnn::InvalidArgumentException</a></div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.xhtml#l00080">Exceptions.hpp:80</a></div></div>
+<div class="ttc" id="namespacearmnn_xhtml_a36e8f52330a21eeab3cc7c4e030f3583"><div class="ttname"><a href="namespacearmnn.xhtml#a36e8f52330a21eeab3cc7c4e030f3583">armnn::GetUnpaddedTensorStrides</a></div><div class="ttdeci">TensorShape GetUnpaddedTensorStrides(const TensorInfo &amp;tensorInfo)</div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8cpp_source.xhtml#l00015">CpuTensorHandle.cpp:15</a></div></div>
+<div class="ttc" id="_cpu_tensor_handle_8hpp_xhtml"><div class="ttname"><a href="_cpu_tensor_handle_8hpp.xhtml">CpuTensorHandle.hpp</a></div></div>
+<div class="ttc" id="classarmnn_1_1_const_cpu_tensor_handle_xhtml_ac9bdc423c74013d226c902c3d8a263bf"><div class="ttname"><a href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#ac9bdc423c74013d226c902c3d8a263bf">armnn::ConstCpuTensorHandle::ConstCpuTensorHandle</a></div><div class="ttdeci">ConstCpuTensorHandle(const TensorInfo &amp;tensorInfo)</div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8cpp_source.xhtml#l00031">CpuTensorHandle.cpp:31</a></div></div>
+<div class="ttc" id="classarmnn_1_1_scoped_cpu_tensor_handle_xhtml_afe9682a83c8e6967e18db5603c4eed2a"><div class="ttname"><a href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#afe9682a83c8e6967e18db5603c4eed2a">armnn::ScopedCpuTensorHandle::~ScopedCpuTensorHandle</a></div><div class="ttdeci">~ScopedCpuTensorHandle()</div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8cpp_source.xhtml#l00086">CpuTensorHandle.cpp:86</a></div></div>
+<div class="ttc" id="classarmnn_1_1_scoped_cpu_tensor_handle_xhtml"><div class="ttname"><a href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml">armnn::ScopedCpuTensorHandle</a></div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8hpp_source.xhtml#l00106">CpuTensorHandle.hpp:106</a></div></div>
+<div class="ttc" id="classarmnn_1_1_scoped_cpu_tensor_handle_xhtml_a8518772c5d692e334a76617582b10b92"><div class="ttname"><a href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#a8518772c5d692e334a76617582b10b92">armnn::ScopedCpuTensorHandle::Allocate</a></div><div class="ttdeci">virtual void Allocate() override</div><div class="ttdoc">Indicate to the memory manager that this resource is no longer active. </div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8cpp_source.xhtml#l00091">CpuTensorHandle.cpp:91</a></div></div>
+<div class="ttc" id="classarmnn_1_1_scoped_cpu_tensor_handle_xhtml_a1eee87f1c25cef40cbf163cad231a426"><div class="ttname"><a href="classarmnn_1_1_scoped_cpu_tensor_handle.xhtml#a1eee87f1c25cef40cbf163cad231a426">armnn::ScopedCpuTensorHandle::ScopedCpuTensorHandle</a></div><div class="ttdeci">ScopedCpuTensorHandle(const TensorInfo &amp;tensorInfo)</div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8cpp_source.xhtml#l00055">CpuTensorHandle.cpp:55</a></div></div>
+<div class="ttc" id="_exceptions_8hpp_xhtml"><div class="ttname"><a href="_exceptions_8hpp.xhtml">Exceptions.hpp</a></div></div>
+<div class="ttc" id="classarmnn_1_1_cpu_tensor_handle_xhtml_aeacd5d2fd0265f9bbc7d494bb4026315"><div class="ttname"><a href="classarmnn_1_1_cpu_tensor_handle.xhtml#aeacd5d2fd0265f9bbc7d494bb4026315">armnn::CpuTensorHandle::CpuTensorHandle</a></div><div class="ttdeci">CpuTensorHandle(const TensorInfo &amp;tensorInfo)</div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8cpp_source.xhtml#l00043">CpuTensorHandle.cpp:43</a></div></div>
+<div class="ttc" id="classarmnn_1_1_const_cpu_tensor_handle_xhtml_a66e8f43a5b42b500871ed96e15419567"><div class="ttname"><a href="classarmnn_1_1_const_cpu_tensor_handle.xhtml#a66e8f43a5b42b500871ed96e15419567">armnn::ConstCpuTensorHandle::GetTensorInfo</a></div><div class="ttdeci">const TensorInfo &amp; GetTensorInfo() const</div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8hpp_source.xhtml#l00037">CpuTensorHandle.hpp:37</a></div></div>
+<div class="ttc" id="classarmnn_1_1_base_tensor_xhtml_abcbdfb544ece4c31d0b37715ad0f3be0"><div class="ttname"><a href="classarmnn_1_1_base_tensor.xhtml#abcbdfb544ece4c31d0b37715ad0f3be0">armnn::BaseTensor::GetNumBytes</a></div><div class="ttdeci">unsigned int GetNumBytes() const</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00174">Tensor.hpp:174</a></div></div>
+<div class="ttc" id="namespacearmnn_xhtml_aa02b9e06fb20fa3c13da0427e6ee5ab2"><div class="ttname"><a href="namespacearmnn.xhtml#aa02b9e06fb20fa3c13da0427e6ee5ab2">armnn::GetDataTypeSize</a></div><div class="ttdeci">constexpr unsigned int GetDataTypeSize(DataType dataType)</div><div class="ttdef"><b>Definition:</b> <a href="_types_utils_8hpp_source.xhtml#l00115">TypesUtils.hpp:115</a></div></div>
+<div class="ttc" id="classarmnn_1_1_passthrough_cpu_tensor_handle_xhtml_a8518772c5d692e334a76617582b10b92"><div class="ttname"><a href="classarmnn_1_1_passthrough_cpu_tensor_handle.xhtml#a8518772c5d692e334a76617582b10b92">armnn::PassthroughCpuTensorHandle::Allocate</a></div><div class="ttdeci">virtual void Allocate() override</div><div class="ttdoc">Indicate to the memory manager that this resource is no longer active. </div><div class="ttdef"><b>Definition:</b> <a href="_cpu_tensor_handle_8cpp_source.xhtml#l00131">CpuTensorHandle.cpp:131</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_0f3cdec46afbc61a1ded8e1687c9c9a0.xhtml">backends</a></li><li class="navelem"><a class="el" href="dir_797a213d7d01b98ef12d53b0820ea64e.xhtml">backendsCommon</a></li><li class="navelem"><a class="el" href="_cpu_tensor_handle_8cpp.xhtml">CpuTensorHandle.cpp</a></li>
+ <li class="footer">Generated on Fri Mar 13 2020 16:09:10 for ArmNN by
+ <a href="http://www.doxygen.org/index.html">
+ <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
+ </ul>
+</div>
+</body>
+</html>