blob: 917d4cc39a0f79ffd3f11bc1fd7b3ca3ca6145d0 [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: PoolManager 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_1_pool_manager.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">PoolManager Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a class="el" href="classarm__compute_1_1_memory.xhtml" title="CPU implementation of memory object.">Memory</a> pool manager.
<a href="classarm__compute_1_1_pool_manager.xhtml#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_pool_manager_8h_source.xhtml">PoolManager.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for PoolManager:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classarm__compute_1_1_pool_manager__coll__graph.svg" width="119" height="112"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.xhtml">legend</a>]</span></center></div>
<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:a7e937d0097fa10265e28278ce435d0c7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml#a7e937d0097fa10265e28278ce435d0c7">PoolManager</a> ()</td></tr>
<tr class="memdesc:a7e937d0097fa10265e28278ce435d0c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default Constructor. <a href="#a7e937d0097fa10265e28278ce435d0c7">More...</a><br /></td></tr>
<tr class="separator:a7e937d0097fa10265e28278ce435d0c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a36361128592d138a2f70c92271bea397"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml#a36361128592d138a2f70c92271bea397">PoolManager</a> (const <a class="el" href="classarm__compute_1_1_pool_manager.xhtml">PoolManager</a> &amp;)=delete</td></tr>
<tr class="memdesc:a36361128592d138a2f70c92271bea397"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prevent instances of this class to be copy constructed. <a href="#a36361128592d138a2f70c92271bea397">More...</a><br /></td></tr>
<tr class="separator:a36361128592d138a2f70c92271bea397"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2bfc06a61c655c3a5b8638336c6f504f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml">PoolManager</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml#a2bfc06a61c655c3a5b8638336c6f504f">operator=</a> (const <a class="el" href="classarm__compute_1_1_pool_manager.xhtml">PoolManager</a> &amp;)=delete</td></tr>
<tr class="memdesc:a2bfc06a61c655c3a5b8638336c6f504f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prevent instances of this class to be copied. <a href="#a2bfc06a61c655c3a5b8638336c6f504f">More...</a><br /></td></tr>
<tr class="separator:a2bfc06a61c655c3a5b8638336c6f504f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd760cb9fa04bbf421266019bcab7d40"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml#afd760cb9fa04bbf421266019bcab7d40">PoolManager</a> (<a class="el" href="classarm__compute_1_1_pool_manager.xhtml">PoolManager</a> &amp;&amp;)=default</td></tr>
<tr class="memdesc:afd760cb9fa04bbf421266019bcab7d40"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allow instances of this class to be move constructed. <a href="#afd760cb9fa04bbf421266019bcab7d40">More...</a><br /></td></tr>
<tr class="separator:afd760cb9fa04bbf421266019bcab7d40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1989d6763b5a90b6cc2a4d8313001424"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml">PoolManager</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml#a1989d6763b5a90b6cc2a4d8313001424">operator=</a> (<a class="el" href="classarm__compute_1_1_pool_manager.xhtml">PoolManager</a> &amp;&amp;)=default</td></tr>
<tr class="memdesc:a1989d6763b5a90b6cc2a4d8313001424"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allow instances of this class to be moved. <a href="#a1989d6763b5a90b6cc2a4d8313001424">More...</a><br /></td></tr>
<tr class="separator:a1989d6763b5a90b6cc2a4d8313001424"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c9b1303494f430941f09e2ad47f9055"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarm__compute_1_1_i_memory_pool.xhtml">IMemoryPool</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml#a8c9b1303494f430941f09e2ad47f9055">lock_pool</a> () override</td></tr>
<tr class="memdesc:a8c9b1303494f430941f09e2ad47f9055"><td class="mdescLeft">&#160;</td><td class="mdescRight">Locks a pool for execution. <a href="#a8c9b1303494f430941f09e2ad47f9055">More...</a><br /></td></tr>
<tr class="separator:a8c9b1303494f430941f09e2ad47f9055"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7520a565247b2aa3c13dcc4d9332cc4a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml#a7520a565247b2aa3c13dcc4d9332cc4a">unlock_pool</a> (<a class="el" href="classarm__compute_1_1_i_memory_pool.xhtml">IMemoryPool</a> *pool) override</td></tr>
<tr class="memdesc:a7520a565247b2aa3c13dcc4d9332cc4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases memory pool. <a href="#a7520a565247b2aa3c13dcc4d9332cc4a">More...</a><br /></td></tr>
<tr class="separator:a7520a565247b2aa3c13dcc4d9332cc4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40713b55ad2d6ddb4ccead1f9e535a05"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml#a40713b55ad2d6ddb4ccead1f9e535a05">register_pool</a> (std::unique_ptr&lt; <a class="el" href="classarm__compute_1_1_i_memory_pool.xhtml">IMemoryPool</a> &gt; pool) override</td></tr>
<tr class="memdesc:a40713b55ad2d6ddb4ccead1f9e535a05"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register pool to be managed by the pool. <a href="#a40713b55ad2d6ddb4ccead1f9e535a05">More...</a><br /></td></tr>
<tr class="separator:a40713b55ad2d6ddb4ccead1f9e535a05"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8959b1c8bd6265ff3d39623db34505b"><td class="memItemLeft" align="right" valign="top">std::unique_ptr&lt; <a class="el" href="classarm__compute_1_1_i_memory_pool.xhtml">IMemoryPool</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml#ab8959b1c8bd6265ff3d39623db34505b">release_pool</a> () override</td></tr>
<tr class="memdesc:ab8959b1c8bd6265ff3d39623db34505b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases a free pool from the managed pools. <a href="#ab8959b1c8bd6265ff3d39623db34505b">More...</a><br /></td></tr>
<tr class="separator:ab8959b1c8bd6265ff3d39623db34505b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6a508a16df2ff6a9881f612f562b766"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml#ad6a508a16df2ff6a9881f612f562b766">clear_pools</a> () override</td></tr>
<tr class="memdesc:ad6a508a16df2ff6a9881f612f562b766"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears all pools managed by the pool manager. <a href="#ad6a508a16df2ff6a9881f612f562b766">More...</a><br /></td></tr>
<tr class="separator:ad6a508a16df2ff6a9881f612f562b766"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae6779aff1846cda85a356089ee5e45f6"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml#ae6779aff1846cda85a356089ee5e45f6">num_pools</a> () const override</td></tr>
<tr class="memdesc:ae6779aff1846cda85a356089ee5e45f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the total number of pools managed by the pool manager. <a href="#ae6779aff1846cda85a356089ee5e45f6">More...</a><br /></td></tr>
<tr class="separator:ae6779aff1846cda85a356089ee5e45f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classarm__compute_1_1_i_pool_manager"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classarm__compute_1_1_i_pool_manager')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classarm__compute_1_1_i_pool_manager.xhtml">IPoolManager</a></td></tr>
<tr class="memitem:a772884b3ff6b2c22444ba13616d9d13a inherit pub_methods_classarm__compute_1_1_i_pool_manager"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarm__compute_1_1_i_pool_manager.xhtml#a772884b3ff6b2c22444ba13616d9d13a">~IPoolManager</a> ()=default</td></tr>
<tr class="memdesc:a772884b3ff6b2c22444ba13616d9d13a inherit pub_methods_classarm__compute_1_1_i_pool_manager"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default virtual destructor. <a href="classarm__compute_1_1_i_pool_manager.xhtml#a772884b3ff6b2c22444ba13616d9d13a">More...</a><br /></td></tr>
<tr class="separator:a772884b3ff6b2c22444ba13616d9d13a inherit pub_methods_classarm__compute_1_1_i_pool_manager"><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><a class="el" href="classarm__compute_1_1_memory.xhtml" title="CPU implementation of memory object.">Memory</a> pool manager. </p>
<p class="definition">Definition at line <a class="el" href="_pool_manager_8h_source.xhtml#l00041">41</a> of file <a class="el" href="_pool_manager_8h_source.xhtml">PoolManager.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a7e937d0097fa10265e28278ce435d0c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e937d0097fa10265e28278ce435d0c7">&#9670;&nbsp;</a></span>PoolManager() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml">PoolManager</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default Constructor. </p>
<p class="definition">Definition at line <a class="el" href="_pool_manager_8cpp_source.xhtml#l00034">34</a> of file <a class="el" href="_pool_manager_8cpp_source.xhtml">PoolManager.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; : _free_pools(), _occupied_pools(), _sem(), _mtx()</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;}</div></div><!-- fragment -->
</div>
</div>
<a id="a36361128592d138a2f70c92271bea397"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a36361128592d138a2f70c92271bea397">&#9670;&nbsp;</a></span>PoolManager() <span class="overload">[2/3]</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_1_pool_manager.xhtml">PoolManager</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classarm__compute_1_1_pool_manager.xhtml">PoolManager</a> &amp;&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">delete</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Prevent instances of this class to be copy constructed. </p>
</div>
</div>
<a id="afd760cb9fa04bbf421266019bcab7d40"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afd760cb9fa04bbf421266019bcab7d40">&#9670;&nbsp;</a></span>PoolManager() <span class="overload">[3/3]</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_1_pool_manager.xhtml">PoolManager</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml">PoolManager</a> &amp;&amp;&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Allow instances of this class to be move constructed. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ad6a508a16df2ff6a9881f612f562b766"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6a508a16df2ff6a9881f612f562b766">&#9670;&nbsp;</a></span>clear_pools()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void clear_pools </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Clears all pools managed by the pool manager. </p>
<dl class="section pre"><dt>Precondition</dt><dd>All pools must be unoccupied </dd></dl>
<p>Implements <a class="el" href="classarm__compute_1_1_i_pool_manager.xhtml#ae6f30dae01a0db67a7959d70c67f1be7">IPoolManager</a>.</p>
<p class="definition">Definition at line <a class="el" href="_pool_manager_8cpp_source.xhtml#l00096">96</a> of file <a class="el" href="_pool_manager_8cpp_source.xhtml">PoolManager.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;{</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; std::lock_guard&lt;arm_compute::Mutex&gt; lock(_mtx);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <a class="code" href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a>(!_occupied_pools.empty(), <span class="stringliteral">&quot;All pools should be free in order to clear the PoolManager!&quot;</span>);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; _free_pools.clear();</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; <span class="comment">// Update semaphore</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; _sem = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;}</div><div class="ttc" id="_error_8h_xhtml_a5bbdcf574d3f5e412fa6a1117911e67b"><div class="ttname"><a href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON_MSG(cond,...)</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00328">Error.h:328</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_error_8h_source.xhtml#l00328">ARM_COMPUTE_ERROR_ON_MSG</a>.</p>
</div>
</div>
<a id="a8c9b1303494f430941f09e2ad47f9055"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c9b1303494f430941f09e2ad47f9055">&#9670;&nbsp;</a></span>lock_pool()</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_1_i_memory_pool.xhtml">IMemoryPool</a> * lock_pool </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Locks a pool for execution. </p>
<dl class="section return"><dt>Returns</dt><dd>Locked pool that workload will be mapped on </dd></dl>
<p>Implements <a class="el" href="classarm__compute_1_1_i_pool_manager.xhtml#abab838bc75d6ecf91c0c278fff0e3d6f">IPoolManager</a>.</p>
<p class="definition">Definition at line <a class="el" href="_pool_manager_8cpp_source.xhtml#l00039">39</a> of file <a class="el" href="_pool_manager_8cpp_source.xhtml">PoolManager.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;{</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <a class="code" href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a>(_free_pools.empty() &amp;&amp; _occupied_pools.empty(), <span class="stringliteral">&quot;Haven&#39;t setup any pools!&quot;</span>);</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"> 43</span>&#160; _sem-&gt;wait();</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; std::lock_guard&lt;arm_compute::Mutex&gt; lock(_mtx);</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <a class="code" href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a>(_free_pools.empty(), <span class="stringliteral">&quot;Empty pool must exist as semaphore has been signalled&quot;</span>);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; _occupied_pools.splice(std::begin(_occupied_pools), _free_pools, std::begin(_free_pools));</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keywordflow">return</span> _occupied_pools.front().get();</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;}</div><div class="ttc" id="_error_8h_xhtml_a5bbdcf574d3f5e412fa6a1117911e67b"><div class="ttname"><a href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON_MSG(cond,...)</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00328">Error.h:328</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_error_8h_source.xhtml#l00328">ARM_COMPUTE_ERROR_ON_MSG</a>.</p>
</div>
</div>
<a id="ae6779aff1846cda85a356089ee5e45f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae6779aff1846cda85a356089ee5e45f6">&#9670;&nbsp;</a></span>num_pools()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t num_pools </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the total number of pools managed by the pool manager. </p>
<dl class="section return"><dt>Returns</dt><dd>Number of managed pools </dd></dl>
<p>Implements <a class="el" href="classarm__compute_1_1_i_pool_manager.xhtml#a57e6036b79c8583ca2f23771e4b7052a">IPoolManager</a>.</p>
<p class="definition">Definition at line <a class="el" href="_pool_manager_8cpp_source.xhtml#l00106">106</a> of file <a class="el" href="_pool_manager_8cpp_source.xhtml">PoolManager.cpp</a>.</p>
<div class="fragment"><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; std::lock_guard&lt;arm_compute::Mutex&gt; lock(_mtx);</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; <span class="keywordflow">return</span> _free_pools.size() + _occupied_pools.size();</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;}</div></div><!-- fragment -->
</div>
</div>
<a id="a2bfc06a61c655c3a5b8638336c6f504f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2bfc06a61c655c3a5b8638336c6f504f">&#9670;&nbsp;</a></span>operator=() <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_1_pool_manager.xhtml">PoolManager</a>&amp; operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classarm__compute_1_1_pool_manager.xhtml">PoolManager</a> &amp;&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">delete</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Prevent instances of this class to be copied. </p>
</div>
</div>
<a id="a1989d6763b5a90b6cc2a4d8313001424"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1989d6763b5a90b6cc2a4d8313001424">&#9670;&nbsp;</a></span>operator=() <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_1_pool_manager.xhtml">PoolManager</a>&amp; operator= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classarm__compute_1_1_pool_manager.xhtml">PoolManager</a> &amp;&amp;&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Allow instances of this class to be moved. </p>
</div>
</div>
<a id="a40713b55ad2d6ddb4ccead1f9e535a05"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40713b55ad2d6ddb4ccead1f9e535a05">&#9670;&nbsp;</a></span>register_pool()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void register_pool </td>
<td>(</td>
<td class="paramtype">std::unique_ptr&lt; <a class="el" href="classarm__compute_1_1_i_memory_pool.xhtml">IMemoryPool</a> &gt;&#160;</td>
<td class="paramname"><em>pool</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Register pool to be managed by the pool. </p>
<dl class="section note"><dt>Note</dt><dd>Ownership of the pools is being transferred to the pool manager</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">pool</td><td>Pool to be managed </td></tr>
</table>
</dd>
</dl>
<p>Implements <a class="el" href="classarm__compute_1_1_i_pool_manager.xhtml#af5ecacf4a9d67777dacc2bf917a52db4">IPoolManager</a>.</p>
<p class="definition">Definition at line <a class="el" href="_pool_manager_8cpp_source.xhtml#l00064">64</a> of file <a class="el" href="_pool_manager_8cpp_source.xhtml">PoolManager.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;{</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; std::lock_guard&lt;arm_compute::Mutex&gt; lock(_mtx);</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <a class="code" href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a>(!_occupied_pools.empty(), <span class="stringliteral">&quot;All pools should be free in order to register a new one!&quot;</span>);</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; <span class="comment">// Set pool</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; _free_pools.push_front(std::move(pool));</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">// Update semaphore</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; _sem = arm_compute::support::cpp14::make_unique&lt;arm_compute::Semaphore&gt;(_free_pools.size());</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;}</div><div class="ttc" id="_error_8h_xhtml_a5bbdcf574d3f5e412fa6a1117911e67b"><div class="ttname"><a href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON_MSG(cond,...)</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00328">Error.h:328</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_error_8h_source.xhtml#l00328">ARM_COMPUTE_ERROR_ON_MSG</a>.</p>
</div>
</div>
<a id="ab8959b1c8bd6265ff3d39623db34505b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab8959b1c8bd6265ff3d39623db34505b">&#9670;&nbsp;</a></span>release_pool()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::unique_ptr&lt; <a class="el" href="classarm__compute_1_1_i_memory_pool.xhtml">IMemoryPool</a> &gt; release_pool </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Releases a free pool from the managed pools. </p>
<dl class="section return"><dt>Returns</dt><dd>The released pool in case a free pool existed else nullptr </dd></dl>
<p>Implements <a class="el" href="classarm__compute_1_1_i_pool_manager.xhtml#afb8e8d8fbcedfdb45e2b0c07571dd987">IPoolManager</a>.</p>
<p class="definition">Definition at line <a class="el" href="_pool_manager_8cpp_source.xhtml#l00076">76</a> of file <a class="el" href="_pool_manager_8cpp_source.xhtml">PoolManager.cpp</a>.</p>
<div class="fragment"><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;{</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; std::lock_guard&lt;arm_compute::Mutex&gt; lock(_mtx);</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <a class="code" href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a>(!_occupied_pools.empty(), <span class="stringliteral">&quot;All pools should be free in order to release one!&quot;</span>);</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">if</span>(!_free_pools.empty())</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; {</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; std::unique_ptr&lt;IMemoryPool&gt; pool = std::move(_free_pools.front());</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <a class="code" href="_error_8h.xhtml#a54a6080c9f4df1f908e57a9bbb46f5da">ARM_COMPUTE_ERROR_ON</a>(_free_pools.front() != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; _free_pools.pop_front();</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">// Update semaphore</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; _sem = arm_compute::support::cpp14::make_unique&lt;arm_compute::Semaphore&gt;(_free_pools.size());</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; <span class="keywordflow">return</span> pool;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; }</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">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;}</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#l00337">Error.h:337</a></div></div>
<div class="ttc" id="_error_8h_xhtml_a5bbdcf574d3f5e412fa6a1117911e67b"><div class="ttname"><a href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON_MSG(cond,...)</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00328">Error.h:328</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_error_8h_source.xhtml#l00337">ARM_COMPUTE_ERROR_ON</a>, and <a class="el" href="_error_8h_source.xhtml#l00328">ARM_COMPUTE_ERROR_ON_MSG</a>.</p>
</div>
</div>
<a id="a7520a565247b2aa3c13dcc4d9332cc4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7520a565247b2aa3c13dcc4d9332cc4a">&#9670;&nbsp;</a></span>unlock_pool()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void unlock_pool </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classarm__compute_1_1_i_memory_pool.xhtml">IMemoryPool</a> *&#160;</td>
<td class="paramname"><em>pool</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Releases memory pool. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">pool</td><td><a class="el" href="classarm__compute_1_1_memory.xhtml" title="CPU implementation of memory object.">Memory</a> pool to release </td></tr>
</table>
</dd>
</dl>
<p>Implements <a class="el" href="classarm__compute_1_1_i_pool_manager.xhtml#af7d957b92062705c6273d8d56eda2c8e">IPoolManager</a>.</p>
<p class="definition">Definition at line <a class="el" href="_pool_manager_8cpp_source.xhtml#l00050">50</a> of file <a class="el" href="_pool_manager_8cpp_source.xhtml">PoolManager.cpp</a>.</p>
<div class="fragment"><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; <a class="code" href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a>(_free_pools.empty() &amp;&amp; _occupied_pools.empty(), <span class="stringliteral">&quot;Haven&#39;t setup any pools!&quot;</span>);</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; std::lock_guard&lt;arm_compute::Mutex&gt; lock(_mtx);</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keyword">auto</span> it = std::find_if(std::begin(_occupied_pools), std::end(_occupied_pools), [pool](<span class="keyword">const</span> std::unique_ptr&lt;IMemoryPool&gt; &amp;pool_it)</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; {</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keywordflow">return</span> pool_it.get() == pool;</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; <a class="code" href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a>(it == std::end(_occupied_pools), <span class="stringliteral">&quot;Pool to be unlocked couldn&#39;t be found!&quot;</span>);</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; _free_pools.splice(std::begin(_free_pools), _occupied_pools, it);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; _sem-&gt;signal();</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;}</div><div class="ttc" id="_error_8h_xhtml_a5bbdcf574d3f5e412fa6a1117911e67b"><div class="ttname"><a href="_error_8h.xhtml#a5bbdcf574d3f5e412fa6a1117911e67b">ARM_COMPUTE_ERROR_ON_MSG</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR_ON_MSG(cond,...)</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00328">Error.h:328</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_error_8h_source.xhtml#l00328">ARM_COMPUTE_ERROR_ON_MSG</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>arm_compute/runtime/<a class="el" href="_pool_manager_8h_source.xhtml">PoolManager.h</a></li>
<li>src/runtime/<a class="el" href="_pool_manager_8cpp_source.xhtml">PoolManager.cpp</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="classarm__compute_1_1_pool_manager.xhtml">PoolManager</a></li>
<li class="footer">Generated on Mon Sep 2 2019 11:47:38 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>