blob: b314542a2e372b5a815b52e03beaadc3a44247b4 [file] [log] [blame]
<!-- HTML header for doxygen 1.8.17-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Arm NN: ICustomAllocator 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>
<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="customdoxygen.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: 15rem; margin-top: .5rem; margin-left 13px"/>
<td id="projectalign" style="padding-left: 0.9em;">
<div id="projectname">
&#160;<span id="projectnumber">24.02</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<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('classarmnn_1_1_i_custom_allocator.html',''); initResizable(); });
/* @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> &#124;
<a href="classarmnn_1_1_i_custom_allocator-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">ICustomAllocator Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>Custom <a class="el" href="structarmnn_1_1_allocator.html">Allocator</a> interface.
<a href="classarmnn_1_1_i_custom_allocator.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_i_custom_allocator_8hpp_source.html">ICustomAllocator.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ICustomAllocator:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classarmnn_1_1_i_custom_allocator__inherit__graph.svg" width="616" 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.html">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:a572445a15a03cbf4cf219e0ef33e6829"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_i_custom_allocator.html#a572445a15a03cbf4cf219e0ef33e6829">~ICustomAllocator</a> ()=default</td></tr>
<tr class="memdesc:a572445a15a03cbf4cf219e0ef33e6829"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default virtual destructor. <a href="classarmnn_1_1_i_custom_allocator.html#a572445a15a03cbf4cf219e0ef33e6829">More...</a><br /></td></tr>
<tr class="separator:a572445a15a03cbf4cf219e0ef33e6829"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ce9dda753afa9abb498f3d6b673e595"><td class="memItemLeft" align="right" valign="top">virtual void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_i_custom_allocator.html#a6ce9dda753afa9abb498f3d6b673e595">allocate</a> (size_t size, size_t alignment)=0</td></tr>
<tr class="memdesc:a6ce9dda753afa9abb498f3d6b673e595"><td class="mdescLeft">&#160;</td><td class="mdescRight">Interface to be implemented by the child class to allocate bytes. <a href="classarmnn_1_1_i_custom_allocator.html#a6ce9dda753afa9abb498f3d6b673e595">More...</a><br /></td></tr>
<tr class="separator:a6ce9dda753afa9abb498f3d6b673e595"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7dbeba9295a3f52ea54698c31e555dff"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_i_custom_allocator.html#a7dbeba9295a3f52ea54698c31e555dff">free</a> (void *ptr)=0</td></tr>
<tr class="memdesc:a7dbeba9295a3f52ea54698c31e555dff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Interface to be implemented by the child class to free the allocated bytes. <a href="classarmnn_1_1_i_custom_allocator.html#a7dbeba9295a3f52ea54698c31e555dff">More...</a><br /></td></tr>
<tr class="separator:a7dbeba9295a3f52ea54698c31e555dff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf02353c52af045a9af48bb40f857ad2"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="namespacearmnn.html#a14fcd7f88d11cea0a018269dca5f9277">armnn::MemorySource</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_i_custom_allocator.html#abf02353c52af045a9af48bb40f857ad2">GetMemorySourceType</a> ()=0</td></tr>
<tr class="memdesc:abf02353c52af045a9af48bb40f857ad2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Used to specify what type of memory is being allocated by this allocator. <a href="classarmnn_1_1_i_custom_allocator.html#abf02353c52af045a9af48bb40f857ad2">More...</a><br /></td></tr>
<tr class="separator:abf02353c52af045a9af48bb40f857ad2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a08c6c321801ee51077a5af1fc17b5d6f"><td class="memItemLeft" align="right" valign="top">virtual void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_i_custom_allocator.html#a08c6c321801ee51077a5af1fc17b5d6f">GetMemoryRegionAtOffset</a> (void *buffer, size_t offset, size_t alignment=0)</td></tr>
<tr class="memdesc:a08c6c321801ee51077a5af1fc17b5d6f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Interface that may be implemented to allow retrieval of Memory Region from allocated buffer at a certain offset. <a href="classarmnn_1_1_i_custom_allocator.html#a08c6c321801ee51077a5af1fc17b5d6f">More...</a><br /></td></tr>
<tr class="separator:a08c6c321801ee51077a5af1fc17b5d6f"><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>Custom <a class="el" href="structarmnn_1_1_allocator.html">Allocator</a> interface. </p>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="_custom_memory_allocator_sample_8cpp-example.html#_a0">CustomMemoryAllocatorSample.cpp</a>.</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="_i_custom_allocator_8hpp_source.html#l00016">16</a> of file <a class="el" href="_i_custom_allocator_8hpp_source.html">ICustomAllocator.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a572445a15a03cbf4cf219e0ef33e6829"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a572445a15a03cbf4cf219e0ef33e6829">&#9670;&nbsp;</a></span>~ICustomAllocator()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual ~<a class="el" href="classarmnn_1_1_i_custom_allocator.html">ICustomAllocator</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">default</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Default virtual destructor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a6ce9dda753afa9abb498f3d6b673e595"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ce9dda753afa9abb498f3d6b673e595">&#9670;&nbsp;</a></span>allocate()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void* allocate </td>
<td>(</td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>alignment</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">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Interface to be implemented by the child class to allocate bytes. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size to allocate </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">alignment</td><td>Alignment that the returned pointer should comply with</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the allocated memory The returned pointer must be host write accessible </dd></dl>
<p>Implemented in <a class="el" href="classarmnn_1_1_gpu_fsa_backend_default_allocator.html#ac1e67a1d72b9220446e80f16350ff12b">GpuFsaBackendDefaultAllocator</a>, <a class="el" href="classarmnn_1_1_default_allocator.html#ac1e67a1d72b9220446e80f16350ff12b">DefaultAllocator</a>, and <a class="el" href="classarmnn_1_1_cl_backend_default_allocator.html#ac1e67a1d72b9220446e80f16350ff12b">ClBackendDefaultAllocator</a>.</p>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="_custom_memory_allocator_sample_8cpp-example.html#a1">CustomMemoryAllocatorSample.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="a7dbeba9295a3f52ea54698c31e555dff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7dbeba9295a3f52ea54698c31e555dff">&#9670;&nbsp;</a></span>free()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void free </td>
<td>(</td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>ptr</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Interface to be implemented by the child class to free the allocated bytes. </p>
<p>Implemented in <a class="el" href="classarmnn_1_1_gpu_fsa_backend_default_allocator.html#abbd17af5b3fbeff226e4051433c1b929">GpuFsaBackendDefaultAllocator</a>, <a class="el" href="classarmnn_1_1_cl_backend_default_allocator.html#abbd17af5b3fbeff226e4051433c1b929">ClBackendDefaultAllocator</a>, and <a class="el" href="classarmnn_1_1_default_allocator.html#abbd17af5b3fbeff226e4051433c1b929">DefaultAllocator</a>.</p>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="_custom_memory_allocator_sample_8cpp-example.html#a3">CustomMemoryAllocatorSample.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="a08c6c321801ee51077a5af1fc17b5d6f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a08c6c321801ee51077a5af1fc17b5d6f">&#9670;&nbsp;</a></span>GetMemoryRegionAtOffset()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void* GetMemoryRegionAtOffset </td>
<td>(</td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>offset</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>alignment</em> = <code>0</code>&#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 class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Interface that may be implemented to allow retrieval of Memory Region from allocated buffer at a certain offset. </p>
<p>Reimplemented in <a class="el" href="classarmnn_1_1_gpu_fsa_backend_default_allocator.html#a70ba99b0598f9e19b1c81e55e3b3ec8a">GpuFsaBackendDefaultAllocator</a>, <a class="el" href="classarmnn_1_1_cl_backend_default_allocator.html#a70ba99b0598f9e19b1c81e55e3b3ec8a">ClBackendDefaultAllocator</a>, and <a class="el" href="classarmnn_1_1_default_allocator.html#a70ba99b0598f9e19b1c81e55e3b3ec8a">DefaultAllocator</a>.</p>
<p class="definition">Definition at line <a class="el" href="_i_custom_allocator_8hpp_source.html#l00046">46</a> of file <a class="el" href="_i_custom_allocator_8hpp_source.html">ICustomAllocator.hpp</a>.</p>
<div class="fragment"><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; <a class="code" href="namespacearmnn.html#a44affeeb090c3c6a3062830562672e84">IgnoreUnused</a>(offset);</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <a class="code" href="namespacearmnn.html#a44affeeb090c3c6a3062830562672e84">IgnoreUnused</a>(alignment);</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <a class="code" href="namespacearmnn.html#a44affeeb090c3c6a3062830562672e84">IgnoreUnused</a>(buffer);</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keywordflow">throw</span> <a class="code" href="classarmnn_1_1_exception.html">armnn::Exception</a>(</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="stringliteral">&quot;ICustomerAllocator::GetMemoryRegionAtOffset(): This function should be overridden in subclass.&quot;</span>);</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; }</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_ignore_unused_8hpp_source.html#l00014">armnn::IgnoreUnused()</a>.</p>
</div>
</div>
<a id="abf02353c52af045a9af48bb40f857ad2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf02353c52af045a9af48bb40f857ad2">&#9670;&nbsp;</a></span>GetMemorySourceType()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="namespacearmnn.html#a14fcd7f88d11cea0a018269dca5f9277">armnn::MemorySource</a> GetMemorySourceType </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Used to specify what type of memory is being allocated by this allocator. </p>
<p>Supported types are: <a class="el" href="namespacearmnn.html#a14fcd7f88d11cea0a018269dca5f9277a1131a914388fac73e5f07b0ba0aad523">MemorySource::Malloc</a> <a class="el" href="namespacearmnn.html#a14fcd7f88d11cea0a018269dca5f9277a966e13d8aabbff3966a5cd28d67b4846">MemorySource::DmaBuf</a> <a class="el" href="namespacearmnn.html#a14fcd7f88d11cea0a018269dca5f9277a7f9067c59dd34aca0ad09a7f283ed1f8">MemorySource::DmaBufProtected</a> </p>
<p>Implemented in <a class="el" href="classarmnn_1_1_gpu_fsa_backend_default_allocator.html#a866a0dadc42904cda6606da6d518c53d">GpuFsaBackendDefaultAllocator</a>, <a class="el" href="classarmnn_1_1_cl_backend_default_allocator.html#a6b2cd9a186746b493f029fb93bb13226">ClBackendDefaultAllocator</a>, and <a class="el" href="classarmnn_1_1_default_allocator.html#a6b2cd9a186746b493f029fb93bb13226">DefaultAllocator</a>.</p>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="_custom_memory_allocator_sample_8cpp-example.html#a4">CustomMemoryAllocatorSample.cpp</a>.</dd>
</dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/armnn/backends/<a class="el" href="_i_custom_allocator_8hpp_source.html">ICustomAllocator.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aclassarmnn_1_1_exception_html"><div class="ttname"><a href="classarmnn_1_1_exception.html">armnn::Exception</a></div><div class="ttdoc">Base class for all ArmNN exceptions so that users can filter to just those.</div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.html#l00046">Exceptions.hpp:46</a></div></div>
<div class="ttc" id="anamespacearmnn_html_a44affeeb090c3c6a3062830562672e84"><div class="ttname"><a href="namespacearmnn.html#a44affeeb090c3c6a3062830562672e84">armnn::IgnoreUnused</a></div><div class="ttdeci">void IgnoreUnused(Ts &amp;&amp;...)</div><div class="ttdef"><b>Definition:</b> <a href="_ignore_unused_8hpp_source.html#l00014">IgnoreUnused.hpp:14</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespacearmnn.html">armnn</a></li><li class="navelem"><a class="el" href="classarmnn_1_1_i_custom_allocator.html">ICustomAllocator</a></li>
<li class="footer">Generated on Wed Feb 14 2024 16:36:22 for Arm NN by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
</ul>
</div>
</body>
</html>