mlx/docs/build/html/resident_8h_source.html

150 lines
14 KiB
HTML
Raw Normal View History

2024-10-26 04:23:45 +08:00
<!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" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/resident.h 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>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.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>
<link href="doxygen.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 id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',false);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- 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">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li> </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
<div class="headertitle"><div class="title">resident.h</div></div>
</div><!--header-->
<div class="contents">
<a href="resident_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &quot;<a class="code" href="backend_2metal_2device_8h.html">mlx/backend/metal/device.h</a>&quot;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemlx_1_1core_1_1metal.html">mlx::core::metal</a> {</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="foldopen" id="foldopen00009" data-start="{" data-end="};">
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_residency_set.html"> 9</a></span><span class="keyword">class </span><a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_residency_set.html">ResidencySet</a> {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#abb69d020da017a7e52e9e3903b877eec"> 11</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#abb69d020da017a7e52e9e3903b877eec">ResidencySet</a>(MTL::Device* d);</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#a998f07776f489bea9a7dd3c290ea7a79"> 12</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#a998f07776f489bea9a7dd3c290ea7a79">~ResidencySet</a>();</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#aabbf8c16f269f38e4c38097b947d18b7"> 14</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#aabbf8c16f269f38e4c38097b947d18b7">ResidencySet</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_residency_set.html">ResidencySet</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#aef97dbbc755940789f99a26164591c45"> 15</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_residency_set.html">ResidencySet</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#aef97dbbc755940789f99a26164591c45">operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_residency_set.html">ResidencySet</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="foldopen" id="foldopen00017" data-start="{" data-end="}">
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#ac4bfe5ef5e2eaebc458a1ed1953d15e9"> 17</a></span> <span class="keyword">const</span> MTL::ResidencySet* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#ac4bfe5ef5e2eaebc458a1ed1953d15e9">mtl_residency_set</a>() {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordflow">return</span> wired_set_;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> }</div>
</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#aaafe1a4305a107d4bcdd4f35d3df09b3"> 21</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#aaafe1a4305a107d4bcdd4f35d3df09b3">insert</a>(MTL::Allocation* <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#ae136ad270522210c85c13cacf5165238"> 22</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#ae136ad270522210c85c13cacf5165238">erase</a>(MTL::Allocation* <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#a0364647bca4324ac41ea3900925a69b5"> 24</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_residency_set.html#a0364647bca4324ac41ea3900925a69b5">resize</a>(<span class="keywordtype">size_t</span> size);</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> MTL::ResidencySet* wired_set_{<span class="keyword">nullptr</span>};</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> std::unordered_set&lt;const MTL::Allocation*&gt; unwired_set_;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordtype">size_t</span> capacity_{0};</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span>};</div>
</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span>} <span class="comment">// namespace mlx::core::metal</span></div>
<div class="ttc" id="abackend_2metal_2allocator_8h_html_a15aa5cc1baf29be08d55cca88509e697"><div class="ttname"><a href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a></div><div class="ttdeci">MTL::Buffer * buf</div><div class="ttdef"><b>Definition</b> allocator.h:39</div></div>
<div class="ttc" id="abackend_2metal_2device_8h_html"><div class="ttname"><a href="backend_2metal_2device_8h.html">device.h</a></div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_residency_set_html"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_residency_set.html">mlx::core::metal::ResidencySet</a></div><div class="ttdef"><b>Definition</b> resident.h:9</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_residency_set_html_a0364647bca4324ac41ea3900925a69b5"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_residency_set.html#a0364647bca4324ac41ea3900925a69b5">mlx::core::metal::ResidencySet::resize</a></div><div class="ttdeci">void resize(size_t size)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_residency_set_html_a998f07776f489bea9a7dd3c290ea7a79"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_residency_set.html#a998f07776f489bea9a7dd3c290ea7a79">mlx::core::metal::ResidencySet::~ResidencySet</a></div><div class="ttdeci">~ResidencySet()</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_residency_set_html_aaafe1a4305a107d4bcdd4f35d3df09b3"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_residency_set.html#aaafe1a4305a107d4bcdd4f35d3df09b3">mlx::core::metal::ResidencySet::insert</a></div><div class="ttdeci">void insert(MTL::Allocation *buf)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_residency_set_html_aabbf8c16f269f38e4c38097b947d18b7"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_residency_set.html#aabbf8c16f269f38e4c38097b947d18b7">mlx::core::metal::ResidencySet::ResidencySet</a></div><div class="ttdeci">ResidencySet(const ResidencySet &amp;)=delete</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_residency_set_html_abb69d020da017a7e52e9e3903b877eec"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_residency_set.html#abb69d020da017a7e52e9e3903b877eec">mlx::core::metal::ResidencySet::ResidencySet</a></div><div class="ttdeci">ResidencySet(MTL::Device *d)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_residency_set_html_ac4bfe5ef5e2eaebc458a1ed1953d15e9"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_residency_set.html#ac4bfe5ef5e2eaebc458a1ed1953d15e9">mlx::core::metal::ResidencySet::mtl_residency_set</a></div><div class="ttdeci">const MTL::ResidencySet * mtl_residency_set()</div><div class="ttdef"><b>Definition</b> resident.h:17</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_residency_set_html_ae136ad270522210c85c13cacf5165238"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_residency_set.html#ae136ad270522210c85c13cacf5165238">mlx::core::metal::ResidencySet::erase</a></div><div class="ttdeci">void erase(MTL::Allocation *buf)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_residency_set_html_aef97dbbc755940789f99a26164591c45"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_residency_set.html#aef97dbbc755940789f99a26164591c45">mlx::core::metal::ResidencySet::operator=</a></div><div class="ttdeci">ResidencySet &amp; operator=(const ResidencySet &amp;)=delete</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1metal_html"><div class="ttname"><a href="namespacemlx_1_1core_1_1metal.html">mlx::core::metal</a></div><div class="ttdef"><b>Definition</b> allocator.h:13</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>