blob: 2be3f986d81c3ba6a695b593ddf21214a06bbd38 [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: TensorCache Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<img alt="Compute Library" src="https://raw.githubusercontent.com/ARM-software/ComputeLibrary/gh-pages/ACL_logo.png" style="max-width: 100%;margin-top: 15px;margin-left: 10px"/>
<td style="padding-left: 0.5em;">
<div id="projectname">
&#160;<span id="projectnumber">19.08</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classarm__compute_1_1test_1_1_tensor_cache.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="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">TensorCache Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Stores <a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a> categorised by the image they are created from including name, format and channel.
<a href="classarm__compute_1_1test_1_1_tensor_cache.xhtml#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_tensor_cache_8h_source.xhtml">TensorCache.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab9838ae8ffe3b1f98e1330d3ee260f98"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1test_1_1_tensor_cache.xhtml#ab9838ae8ffe3b1f98e1330d3ee260f98">find</a> (std::tuple&lt; const std::string &amp;, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">Format</a> &gt; key)</td></tr>
<tr class="memdesc:ab9838ae8ffe3b1f98e1330d3ee260f98"><td class="mdescLeft">&#160;</td><td class="mdescRight">Search the cache for a tensor of created from the specified image and format. <a href="#ab9838ae8ffe3b1f98e1330d3ee260f98">More...</a><br /></td></tr>
<tr class="separator:ab9838ae8ffe3b1f98e1330d3ee260f98"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77d062d1fc4b239c215c4534deee8a2f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1test_1_1_tensor_cache.xhtml#a77d062d1fc4b239c215c4534deee8a2f">find</a> (std::tuple&lt; const std::string &amp;, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">Format</a>, <a class="el" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455a">Channel</a> &gt; key)</td></tr>
<tr class="memdesc:a77d062d1fc4b239c215c4534deee8a2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Search the cache for a tensor of created from the specified image, format and channel. <a href="#a77d062d1fc4b239c215c4534deee8a2f">More...</a><br /></td></tr>
<tr class="separator:a77d062d1fc4b239c215c4534deee8a2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00b2f7f657ef8060c64fce93abac54e1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1test_1_1_tensor_cache.xhtml#a00b2f7f657ef8060c64fce93abac54e1">add</a> (std::tuple&lt; const std::string &amp;, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">Format</a> &gt; key, <a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a> raw)</td></tr>
<tr class="memdesc:a00b2f7f657ef8060c64fce93abac54e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add the given tensor to the cache. <a href="#a00b2f7f657ef8060c64fce93abac54e1">More...</a><br /></td></tr>
<tr class="separator:a00b2f7f657ef8060c64fce93abac54e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a342abc82aa86a51f668dd6a7f89934"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1test_1_1_tensor_cache.xhtml#a8a342abc82aa86a51f668dd6a7f89934">add</a> (std::tuple&lt; const std::string &amp;, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">Format</a>, <a class="el" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455a">Channel</a> &gt; key, <a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a> raw)</td></tr>
<tr class="memdesc:a8a342abc82aa86a51f668dd6a7f89934"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add the given tensor to the cache. <a href="#a8a342abc82aa86a51f668dd6a7f89934">More...</a><br /></td></tr>
<tr class="separator:a8a342abc82aa86a51f668dd6a7f89934"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Stores <a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a> categorised by the image they are created from including name, format and channel. </p>
<p class="definition">Definition at line <a class="el" href="_tensor_cache_8h_source.xhtml#l00042">42</a> of file <a class="el" href="_tensor_cache_8h_source.xhtml">TensorCache.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a00b2f7f657ef8060c64fce93abac54e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a00b2f7f657ef8060c64fce93abac54e1">&#9670;&nbsp;</a></span>add() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a> &amp; add </td>
<td>(</td>
<td class="paramtype">std::tuple&lt; const std::string &amp;, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">Format</a> &gt;&#160;</td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a>&#160;</td>
<td class="paramname"><em>raw</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Add the given tensor to the cache. </p>
<p>Can later be found under the given image name and format.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>Key under which to store the tensor. Consists of image name and format. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">raw</td><td>Raw tensor to be stored.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A reference to the cached tensor. </dd></dl>
<p class="definition">Definition at line <a class="el" href="_tensor_cache_8h_source.xhtml#l00107">107</a> of file <a class="el" href="_tensor_cache_8h_source.xhtml">TensorCache.h</a>.</p>
<div class="fragment"><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; std::lock_guard&lt;arm_compute::Mutex&gt; lock(_raw_tensor_cache_mutex);</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keywordflow">return</span> std::get&lt;0&gt;(_raw_tensor_cache.emplace(std::move(key), std::move(raw)))-&gt;second;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="a8a342abc82aa86a51f668dd6a7f89934"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a342abc82aa86a51f668dd6a7f89934">&#9670;&nbsp;</a></span>add() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a> &amp; add </td>
<td>(</td>
<td class="paramtype">std::tuple&lt; const std::string &amp;, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">Format</a>, <a class="el" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455a">Channel</a> &gt;&#160;</td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a>&#160;</td>
<td class="paramname"><em>raw</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Add the given tensor to the cache. </p>
<p>Can later be found under the given image name, format and channel.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>Key under which to store the tensor. Consists of image name, format and channel. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">raw</td><td>Raw tensor to be stored.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A reference to the cached tensor. </dd></dl>
<p class="definition">Definition at line <a class="el" href="_tensor_cache_8h_source.xhtml#l00113">113</a> of file <a class="el" href="_tensor_cache_8h_source.xhtml">TensorCache.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;{</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; std::lock_guard&lt;arm_compute::Mutex&gt; lock(_raw_tensor_channel_cache_mutex);</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keywordflow">return</span> std::get&lt;0&gt;(_raw_tensor_channel_cache.emplace(std::move(key), std::move(raw)))-&gt;second;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="ab9838ae8ffe3b1f98e1330d3ee260f98"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab9838ae8ffe3b1f98e1330d3ee260f98">&#9670;&nbsp;</a></span>find() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a> * find </td>
<td>(</td>
<td class="paramtype">std::tuple&lt; const std::string &amp;, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">Format</a> &gt;&#160;</td>
<td class="paramname"><em>key</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Search the cache for a tensor of created from the specified image and format. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>Key to look up the tensor. Consists of image name and format.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The cached tensor matching the image name and format if found. A nullptr otherwise. </dd></dl>
<p class="definition">Definition at line <a class="el" href="_tensor_cache_8h_source.xhtml#l00095">95</a> of file <a class="el" href="_tensor_cache_8h_source.xhtml">TensorCache.h</a>.</p>
<div class="fragment"><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="keyword">const</span> <span class="keyword">auto</span> it = _raw_tensor_cache.find(key);</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keywordflow">return</span> it == _raw_tensor_cache.end() ? nullptr : &amp;it-&gt;second;</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="a77d062d1fc4b239c215c4534deee8a2f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a77d062d1fc4b239c215c4534deee8a2f">&#9670;&nbsp;</a></span>find() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classarm__compute_1_1test_1_1_raw_tensor.xhtml">RawTensor</a> * find </td>
<td>(</td>
<td class="paramtype">std::tuple&lt; const std::string &amp;, <a class="el" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58">Format</a>, <a class="el" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455a">Channel</a> &gt;&#160;</td>
<td class="paramname"><em>key</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Search the cache for a tensor of created from the specified image, format and channel. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>Key to look up the tensor. Consists of image name, format and channel.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The cached tensor matching the image name and format if found. A nullptr otherwise. </dd></dl>
<p class="definition">Definition at line <a class="el" href="_tensor_cache_8h_source.xhtml#l00101">101</a> of file <a class="el" href="_tensor_cache_8h_source.xhtml">TensorCache.h</a>.</p>
<div class="fragment"><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; <span class="keyword">const</span> <span class="keyword">auto</span> it = _raw_tensor_channel_cache.find(key);</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordflow">return</span> it == _raw_tensor_channel_cache.end() ? nullptr : &amp;it-&gt;second;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>tests/<a class="el" href="_tensor_cache_8h_source.xhtml">TensorCache.h</a></li>
</ul>
</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="namespacearm__compute.xhtml">arm_compute</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1test.xhtml">test</a></li><li class="navelem"><a class="el" href="classarm__compute_1_1test_1_1_tensor_cache.xhtml">TensorCache</a></li>
<li class="footer">Generated on Mon Sep 2 2019 11:47:40 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>