mlx/docs/build/html/backend_2metal_2device_8h_source.html

322 lines
53 KiB
HTML
Raw Normal View History

2024-06-07 11:28:06 +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.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/device.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>
<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.10.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" 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');
$(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() { codefold.init(0); });
/* @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 class="header">
<div class="headertitle"><div class="title">device.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2metal_2device_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 © 2023-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 &lt;Metal/Metal.hpp&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;mutex&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;unordered_map&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;unordered_set&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
2024-08-11 00:24:35 +08:00
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &quot;<a class="code" href="array_8h.html">mlx/array.h</a>&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include &quot;<a class="code" href="device_8h.html">mlx/device.h</a>&quot;</span></div>
2024-06-07 11:28:06 +08:00
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
2024-08-11 00:24:35 +08:00
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</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="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54"> 17</a></span><span class="keyword">using </span><a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a> =</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> std::vector&lt;std::tuple&lt;const void*, MTL::DataType, NS::UInteger&gt;&gt;;</div>
2024-06-07 11:28:06 +08:00
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
2024-08-11 00:24:35 +08:00
<div class="foldopen" id="foldopen00020" data-start="{" data-end="};">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html"> 20</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a> {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a2334774486f447213ee997e55c2e52a3"> 21</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a2334774486f447213ee997e55c2e52a3">CommandEncoder</a>(MTL::CommandBuffer* cbuf);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ac68ca977b5bde5434284ce7979647f14"> 22</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ac68ca977b5bde5434284ce7979647f14">CommandEncoder</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a3f42a1362b4a513fa89e7b3dcc570a8e"> 23</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>&amp; <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a3f42a1362b4a513fa89e7b3dcc570a8e">operator=</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
<div class="foldopen" id="foldopen00025" data-start="{" data-end="};">
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html"> 25</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html">ConcurrentContext</a> {</div>
<div class="foldopen" id="foldopen00026" data-start="{" data-end="}">
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#aee044d7729739c96e845823f9ecc5174"> 26</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#aee044d7729739c96e845823f9ecc5174">ConcurrentContext</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>&amp; enc) : enc(enc) {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> enc.concurrent = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> }</div>
</div>
<div class="foldopen" id="foldopen00029" data-start="{" data-end="}">
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#a28bafec56edec3091e8716d8ccfb6ee1"> 29</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#a28bafec56edec3091e8716d8ccfb6ee1">~ConcurrentContext</a>() {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> enc.concurrent = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> enc.outputs.insert(</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> enc.concurrent_outputs.begin(), enc.concurrent_outputs.end());</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> enc.concurrent_outputs.clear();</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> }</div>
2024-06-07 11:28:06 +08:00
</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
2024-08-11 00:24:35 +08:00
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>&amp; enc;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> };</div>
2024-06-07 11:28:06 +08:00
</div>
2024-08-11 00:24:35 +08:00
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
<div class="foldopen" id="foldopen00040" data-start="{" data-end="}">
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#aac45ab0630ea32cf7d15c7ba3e229966"> 40</a></span> MTL::ComputeCommandEncoder* <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#aac45ab0630ea32cf7d15c7ba3e229966">operator-&gt;</a>() {</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">return</span> enc;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> }</div>
2024-06-07 11:28:06 +08:00
</div>
2024-08-11 00:24:35 +08:00
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ab69ff0d7f14b9b59db4df0608193dce4"> 44</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ab69ff0d7f14b9b59db4df0608193dce4">set_input_array</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; a, <span class="keywordtype">int</span> idx, int64_t offset = 0);</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a6a2e28e542eaa2886041bddd51ff6522"> 45</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a6a2e28e542eaa2886041bddd51ff6522">set_output_array</a>(<a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; a, <span class="keywordtype">int</span> idx, int64_t offset = 0);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a74bcd8e35f80f5a62db48c4a2bb0173e"> 46</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a74bcd8e35f80f5a62db48c4a2bb0173e">dispatchThreadgroups</a>(MTL::Size grid_dims, MTL::Size group_dims);</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a1e41477f2f489e38499f7830a91c9810"> 47</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a1e41477f2f489e38499f7830a91c9810">dispatchThreads</a>(MTL::Size grid_dims, MTL::Size group_dims);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
<div class="foldopen" id="foldopen00049" data-start="{" data-end="}">
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a48b548a0b15f9d1279c938a1c6167034"> 49</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html">ConcurrentContext</a> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a48b548a0b15f9d1279c938a1c6167034">start_concurrent</a>() {</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html">ConcurrentContext</a>(*<span class="keyword">this</span>);</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> }</div>
2024-06-07 11:28:06 +08:00
</div>
2024-08-11 00:24:35 +08:00
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a9b6dd221ccd2d939d544004cb6279198"> 53</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a9b6dd221ccd2d939d544004cb6279198">~CommandEncoder</a>();</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">void</span> maybe_split();</div>
2024-06-07 11:28:06 +08:00
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
2024-08-11 00:24:35 +08:00
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordtype">int</span> num_dispatches{0};</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> MTL::CommandBuffer* cbuf;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> MTL::ComputeCommandEncoder* enc;</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordtype">bool</span> concurrent{<span class="keyword">false</span>};</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> std::unordered_set&lt;MTL::Resource*&gt; outputs;</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> std::unordered_set&lt;MTL::Resource*&gt; concurrent_outputs;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span>};</div>
2024-06-07 11:28:06 +08:00
</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
2024-08-11 00:24:35 +08:00
<div class="foldopen" id="foldopen00066" data-start="{" data-end="};">
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html"> 66</a></span><span class="keyword">class </span><a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a> {</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#ae0db74570eb4b19d8cf19774db91bfd6"> 68</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#ae0db74570eb4b19d8cf19774db91bfd6">Device</a>();</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#abf59a4addb5473f9e814e3651ba85f06"> 69</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#abf59a4addb5473f9e814e3651ba85f06">Device</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#ad1d6382fd18a46b1906e1b43e0bd2e73"> 70</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#ad1d6382fd18a46b1906e1b43e0bd2e73">operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a4f39c28c6cdd1d2da1918f5871bcba6e"> 71</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a4f39c28c6cdd1d2da1918f5871bcba6e">~Device</a>();</div>
2024-06-07 11:28:06 +08:00
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
2024-08-11 00:24:35 +08:00
<div class="foldopen" id="foldopen00073" data-start="{" data-end="}">
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a31dba377f2be44a746db10d1b9367653"> 73</a></span> MTL::Device* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a31dba377f2be44a746db10d1b9367653">mtl_device</a>() {</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordflow">return</span> device_;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> };</div>
2024-06-07 11:28:06 +08:00
</div>
2024-08-11 00:24:35 +08:00
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a8135ae2a8c1e6f3861e84d4e60c28b67"> 77</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a8135ae2a8c1e6f3861e84d4e60c28b67">new_queue</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a5fe3970fbe92ccc55fce4241ffbe5210"> 78</a></span> MTL::CommandBuffer* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a5fe3970fbe92ccc55fce4241ffbe5210">get_command_buffer</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a064e1cb6a16de7a0619f6447622350f8"> 79</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a064e1cb6a16de7a0619f6447622350f8">get_command_buffer_ops</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a7a33d4d601423a3d3c23d5ad7072abb6"> 80</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a7a33d4d601423a3d3c23d5ad7072abb6">increment_command_buffer_ops</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a95248f1387824067fd4fed23ace5ac0c"> 81</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a95248f1387824067fd4fed23ace5ac0c">commit_command_buffer</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#affa682ef612def4890f5152f81ffb7e6"> 82</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#affa682ef612def4890f5152f81ffb7e6">get_command_encoder</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a60689f97347811b27e8c5ca23e0372bf"> 83</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a60689f97347811b27e8c5ca23e0372bf">end_encoding</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> </div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a45945f2efcd242d915ffa2171e92bf9d"> 85</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a45945f2efcd242d915ffa2171e92bf9d">register_library</a>(</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keyword">const</span> std::string&amp; lib_name,</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keyword">const</span> std::string&amp; lib_path);</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a99ff72689b7beb65ad4541391b0eeabf"> 89</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a99ff72689b7beb65ad4541391b0eeabf">register_library</a>(<span class="keyword">const</span> std::string&amp; lib_name);</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a86297d66de43ee77d0697f69c6bd0b87"> 91</a></span> MTL::Library* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a86297d66de43ee77d0697f69c6bd0b87">get_library</a>(<span class="keyword">const</span> std::string&amp; name);</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a961d3cdb4bfb14c1a0b0aeb05609f56e"> 93</a></span> MTL::Library* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a961d3cdb4bfb14c1a0b0aeb05609f56e">get_library</a>(</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keyword">const</span> std::string&amp; name,</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keyword">const</span> std::string&amp; source_string,</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="keywordtype">bool</span> cache = <span class="keyword">true</span>);</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> </div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a8d8d9e28ffeea10d687b91ea480fb4bd"> 98</a></span> MTL::Library* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a8d8d9e28ffeea10d687b91ea480fb4bd">get_library</a>(</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keyword">const</span> std::string&amp; name,</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">const</span> MTL::StitchedLibraryDescriptor* desc,</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordtype">bool</span> cache = <span class="keyword">true</span>);</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> </div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#abf4ecf035e8be2ff00d2a7e95475d7ac"> 103</a></span> MTL::Function* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#abf4ecf035e8be2ff00d2a7e95475d7ac">get_function</a>(</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keyword">const</span> std::string&amp; base_name,</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> MTL::Library* mtl_lib,</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keyword">const</span> std::string&amp; specialized_name = <span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>&amp; func_consts = {});</div>
2024-06-07 11:28:06 +08:00
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> </div>
2024-08-11 00:24:35 +08:00
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#ac083535ead07161cb27ad31f8f64fb84"> 109</a></span> MTL::Function* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#ac083535ead07161cb27ad31f8f64fb84">get_function</a>(</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keyword">const</span> std::string&amp; base_name,</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keyword">const</span> std::string&amp; lib_name = <span class="stringliteral">&quot;mlx&quot;</span>,</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keyword">const</span> std::string&amp; specialized_name = <span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>&amp; func_consts = {});</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> </div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a6810c4dcbcfbf93fc51d42aa5ff0fc3a"> 115</a></span> MTL::ComputePipelineState* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a6810c4dcbcfbf93fc51d42aa5ff0fc3a">get_kernel</a>(</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keyword">const</span> std::string&amp; base_name,</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> MTL::Library* mtl_lib,</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keyword">const</span> std::string&amp; hash_name = <span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>&amp; func_consts = {},</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keyword">const</span> std::vector&lt;MTL::Function*&gt;&amp; linked_functions = {});</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> </div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#afa0cac9d800c21a8a7f6cb224256abaf"> 122</a></span> MTL::ComputePipelineState* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#afa0cac9d800c21a8a7f6cb224256abaf">get_kernel</a>(</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keyword">const</span> std::string&amp; base_name,</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keyword">const</span> std::string&amp; lib_name = <span class="stringliteral">&quot;mlx&quot;</span>,</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keyword">const</span> std::string&amp; hash_name = <span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>&amp; func_consts = {},</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keyword">const</span> std::vector&lt;MTL::Function*&gt;&amp; linked_functions = {});</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> </div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a6e33e2b1287324fb4a6575e0da5e5881"> 129</a></span> MTL::ArgumentEncoder* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a6e33e2b1287324fb4a6575e0da5e5881">argument_encoder</a>(</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="keyword">const</span> std::vector&lt;MTL::ArgumentDescriptor*&gt;&amp; arg_descs) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> MTL::Library* get_library_cache_(<span class="keyword">const</span> std::string&amp; name);</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> MTL::Library* get_library_(<span class="keyword">const</span> std::string&amp; source_string);</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> MTL::Library* get_library_(<span class="keyword">const</span> MTL::StitchedLibraryDescriptor* desc);</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> </div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> MTL::Function* get_function_(<span class="keyword">const</span> std::string&amp; name, MTL::Library* mtl_lib);</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> MTL::Function* get_function_(</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keyword">const</span> std::string&amp; name,</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keyword">const</span> std::string&amp; specialized_name,</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>&amp; func_consts,</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> MTL::Library* mtl_lib);</div>
2024-06-07 11:28:06 +08:00
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
2024-08-11 00:24:35 +08:00
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> MTL::LinkedFunctions* get_linked_functions_(</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keyword">const</span> std::vector&lt;MTL::Function*&gt;&amp; funcs);</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> MTL::ComputePipelineState* get_kernel_(</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keyword">const</span> std::string&amp; name,</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="keyword">const</span> MTL::Function* mtl_function);</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> </div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> MTL::ComputePipelineState* get_kernel_(</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keyword">const</span> std::string&amp; name,</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <span class="keyword">const</span> MTL::Function* mtl_function,</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keyword">const</span> MTL::LinkedFunctions* linked_functions);</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> </div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> MTL::Device* device_;</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> std::unordered_map&lt;int32_t, MTL::CommandQueue*&gt; queue_map_;</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> std::unordered_map&lt;int32_t, std::pair&lt;int, MTL::CommandBuffer*&gt;&gt; buffer_map_;</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> std::unordered_map&lt;int32_t, std::unique_ptr&lt;CommandEncoder&gt;&gt; encoder_map_;</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> std::unordered_map&lt;std::string, MTL::ComputePipelineState*&gt; kernel_map_;</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> std::unordered_map&lt;std::string, MTL::Library*&gt; library_map_;</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> std::mutex mtx_;</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span>};</div>
2024-06-07 11:28:06 +08:00
</div>
2024-08-11 00:24:35 +08:00
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> </div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1metal.html#a910797b74824e6ee576fbb533dee8b57"> 167</a></span><a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a>&amp; <a class="code hl_function" href="namespacemlx_1_1core_1_1metal.html#a910797b74824e6ee576fbb533dee8b57">device</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1_device.html">mlx::core::Device</a>);</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> </div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span>} <span class="comment">// namespace mlx::core::metal</span></div>
2024-06-07 11:28:06 +08:00
<div class="ttc" id="aarray_8h_html"><div class="ttname"><a href="array_8h.html">array.h</a></div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html"><div class="ttname"><a href="classmlx_1_1core_1_1array.html">mlx::core::array</a></div><div class="ttdef"><b>Definition</b> array.h:20</div></div>
2024-08-11 00:24:35 +08:00
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html">mlx::core::metal::Device</a></div><div class="ttdef"><b>Definition</b> device.h:66</div></div>
2024-06-07 11:28:06 +08:00
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a064e1cb6a16de7a0619f6447622350f8"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a064e1cb6a16de7a0619f6447622350f8">mlx::core::metal::Device::get_command_buffer_ops</a></div><div class="ttdeci">int get_command_buffer_ops(int index)</div></div>
2024-08-11 00:24:35 +08:00
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a31dba377f2be44a746db10d1b9367653"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a31dba377f2be44a746db10d1b9367653">mlx::core::metal::Device::mtl_device</a></div><div class="ttdeci">MTL::Device * mtl_device()</div><div class="ttdef"><b>Definition</b> device.h:73</div></div>
2024-06-07 11:28:06 +08:00
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a45945f2efcd242d915ffa2171e92bf9d"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a45945f2efcd242d915ffa2171e92bf9d">mlx::core::metal::Device::register_library</a></div><div class="ttdeci">void register_library(const std::string &amp;lib_name, const std::string &amp;lib_path)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a4f39c28c6cdd1d2da1918f5871bcba6e"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a4f39c28c6cdd1d2da1918f5871bcba6e">mlx::core::metal::Device::~Device</a></div><div class="ttdeci">~Device()</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a5fe3970fbe92ccc55fce4241ffbe5210"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a5fe3970fbe92ccc55fce4241ffbe5210">mlx::core::metal::Device::get_command_buffer</a></div><div class="ttdeci">MTL::CommandBuffer * get_command_buffer(int index)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a60689f97347811b27e8c5ca23e0372bf"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a60689f97347811b27e8c5ca23e0372bf">mlx::core::metal::Device::end_encoding</a></div><div class="ttdeci">void end_encoding(int index)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a6810c4dcbcfbf93fc51d42aa5ff0fc3a"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a6810c4dcbcfbf93fc51d42aa5ff0fc3a">mlx::core::metal::Device::get_kernel</a></div><div class="ttdeci">MTL::ComputePipelineState * get_kernel(const std::string &amp;base_name, MTL::Library *mtl_lib, const std::string &amp;hash_name=&quot;&quot;, const MTLFCList &amp;func_consts={}, const std::vector&lt; MTL::Function * &gt; &amp;linked_functions={})</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a6e33e2b1287324fb4a6575e0da5e5881"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a6e33e2b1287324fb4a6575e0da5e5881">mlx::core::metal::Device::argument_encoder</a></div><div class="ttdeci">MTL::ArgumentEncoder * argument_encoder(const std::vector&lt; MTL::ArgumentDescriptor * &gt; &amp;arg_descs) const</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a7a33d4d601423a3d3c23d5ad7072abb6"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a7a33d4d601423a3d3c23d5ad7072abb6">mlx::core::metal::Device::increment_command_buffer_ops</a></div><div class="ttdeci">void increment_command_buffer_ops(int index)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a8135ae2a8c1e6f3861e84d4e60c28b67"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a8135ae2a8c1e6f3861e84d4e60c28b67">mlx::core::metal::Device::new_queue</a></div><div class="ttdeci">void new_queue(int index)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a86297d66de43ee77d0697f69c6bd0b87"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a86297d66de43ee77d0697f69c6bd0b87">mlx::core::metal::Device::get_library</a></div><div class="ttdeci">MTL::Library * get_library(const std::string &amp;name)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a8d8d9e28ffeea10d687b91ea480fb4bd"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a8d8d9e28ffeea10d687b91ea480fb4bd">mlx::core::metal::Device::get_library</a></div><div class="ttdeci">MTL::Library * get_library(const std::string &amp;name, const MTL::StitchedLibraryDescriptor *desc, bool cache=true)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a95248f1387824067fd4fed23ace5ac0c"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a95248f1387824067fd4fed23ace5ac0c">mlx::core::metal::Device::commit_command_buffer</a></div><div class="ttdeci">void commit_command_buffer(int index)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a961d3cdb4bfb14c1a0b0aeb05609f56e"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a961d3cdb4bfb14c1a0b0aeb05609f56e">mlx::core::metal::Device::get_library</a></div><div class="ttdeci">MTL::Library * get_library(const std::string &amp;name, const std::string &amp;source_string, bool cache=true)</div></div>
2024-08-11 00:24:35 +08:00
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a99ff72689b7beb65ad4541391b0eeabf"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a99ff72689b7beb65ad4541391b0eeabf">mlx::core::metal::Device::register_library</a></div><div class="ttdeci">void register_library(const std::string &amp;lib_name)</div></div>
2024-06-07 11:28:06 +08:00
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_abf4ecf035e8be2ff00d2a7e95475d7ac"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#abf4ecf035e8be2ff00d2a7e95475d7ac">mlx::core::metal::Device::get_function</a></div><div class="ttdeci">MTL::Function * get_function(const std::string &amp;base_name, MTL::Library *mtl_lib, const std::string &amp;specialized_name=&quot;&quot;, const MTLFCList &amp;func_consts={})</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_abf59a4addb5473f9e814e3651ba85f06"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#abf59a4addb5473f9e814e3651ba85f06">mlx::core::metal::Device::Device</a></div><div class="ttdeci">Device(const Device &amp;)=delete</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_ac083535ead07161cb27ad31f8f64fb84"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#ac083535ead07161cb27ad31f8f64fb84">mlx::core::metal::Device::get_function</a></div><div class="ttdeci">MTL::Function * get_function(const std::string &amp;base_name, const std::string &amp;lib_name=&quot;mlx&quot;, const std::string &amp;specialized_name=&quot;&quot;, const MTLFCList &amp;func_consts={})</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_ad1d6382fd18a46b1906e1b43e0bd2e73"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#ad1d6382fd18a46b1906e1b43e0bd2e73">mlx::core::metal::Device::operator=</a></div><div class="ttdeci">Device &amp; operator=(const Device &amp;)=delete</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_ae0db74570eb4b19d8cf19774db91bfd6"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#ae0db74570eb4b19d8cf19774db91bfd6">mlx::core::metal::Device::Device</a></div><div class="ttdeci">Device()</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_afa0cac9d800c21a8a7f6cb224256abaf"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#afa0cac9d800c21a8a7f6cb224256abaf">mlx::core::metal::Device::get_kernel</a></div><div class="ttdeci">MTL::ComputePipelineState * get_kernel(const std::string &amp;base_name, const std::string &amp;lib_name=&quot;mlx&quot;, const std::string &amp;hash_name=&quot;&quot;, const MTLFCList &amp;func_consts={}, const std::vector&lt; MTL::Function * &gt; &amp;linked_functions={})</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_affa682ef612def4890f5152f81ffb7e6"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#affa682ef612def4890f5152f81ffb7e6">mlx::core::metal::Device::get_command_encoder</a></div><div class="ttdeci">CommandEncoder &amp; get_command_encoder(int index)</div></div>
<div class="ttc" id="adevice_8h_html"><div class="ttname"><a href="device_8h.html">device.h</a></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:12</div></div>
2024-08-11 00:24:35 +08:00
<div class="ttc" id="anamespacemlx_1_1core_1_1metal_html_a616e09a1ef321d527770721cef264c54"><div class="ttname"><a href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">mlx::core::metal::MTLFCList</a></div><div class="ttdeci">std::vector&lt; std::tuple&lt; const void *, MTL::DataType, NS::UInteger &gt; &gt; MTLFCList</div><div class="ttdef"><b>Definition</b> device.h:17</div></div>
2024-06-07 11:28:06 +08:00
<div class="ttc" id="anamespacemlx_1_1core_1_1metal_html_a910797b74824e6ee576fbb533dee8b57"><div class="ttname"><a href="namespacemlx_1_1core_1_1metal.html#a910797b74824e6ee576fbb533dee8b57">mlx::core::metal::device</a></div><div class="ttdeci">Device &amp; device(mlx::core::Device)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_device_html"><div class="ttname"><a href="structmlx_1_1core_1_1_device.html">mlx::core::Device</a></div><div class="ttdef"><b>Definition</b> device.h:7</div></div>
2024-08-11 00:24:35 +08:00
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context_html"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html">mlx::core::metal::CommandEncoder::ConcurrentContext</a></div><div class="ttdef"><b>Definition</b> device.h:25</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context_html_a28bafec56edec3091e8716d8ccfb6ee1"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#a28bafec56edec3091e8716d8ccfb6ee1">mlx::core::metal::CommandEncoder::ConcurrentContext::~ConcurrentContext</a></div><div class="ttdeci">~ConcurrentContext()</div><div class="ttdef"><b>Definition</b> device.h:29</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context_html_aee044d7729739c96e845823f9ecc5174"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#aee044d7729739c96e845823f9ecc5174">mlx::core::metal::CommandEncoder::ConcurrentContext::ConcurrentContext</a></div><div class="ttdeci">ConcurrentContext(CommandEncoder &amp;enc)</div><div class="ttdef"><b>Definition</b> device.h:26</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">mlx::core::metal::CommandEncoder</a></div><div class="ttdef"><b>Definition</b> device.h:20</div></div>
2024-06-07 11:28:06 +08:00
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a1e41477f2f489e38499f7830a91c9810"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a1e41477f2f489e38499f7830a91c9810">mlx::core::metal::CommandEncoder::dispatchThreads</a></div><div class="ttdeci">void dispatchThreads(MTL::Size grid_dims, MTL::Size group_dims)</div></div>
2024-08-11 00:24:35 +08:00
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a2334774486f447213ee997e55c2e52a3"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a2334774486f447213ee997e55c2e52a3">mlx::core::metal::CommandEncoder::CommandEncoder</a></div><div class="ttdeci">CommandEncoder(MTL::CommandBuffer *cbuf)</div></div>
2024-06-07 11:28:06 +08:00
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a3f42a1362b4a513fa89e7b3dcc570a8e"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a3f42a1362b4a513fa89e7b3dcc570a8e">mlx::core::metal::CommandEncoder::operator=</a></div><div class="ttdeci">CommandEncoder &amp; operator=(const CommandEncoder &amp;)=delete</div></div>
2024-08-11 00:24:35 +08:00
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a48b548a0b15f9d1279c938a1c6167034"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a48b548a0b15f9d1279c938a1c6167034">mlx::core::metal::CommandEncoder::start_concurrent</a></div><div class="ttdeci">ConcurrentContext start_concurrent()</div><div class="ttdef"><b>Definition</b> device.h:49</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a6a2e28e542eaa2886041bddd51ff6522"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a6a2e28e542eaa2886041bddd51ff6522">mlx::core::metal::CommandEncoder::set_output_array</a></div><div class="ttdeci">void set_output_array(array &amp;a, int idx, int64_t offset=0)</div></div>
2024-06-07 11:28:06 +08:00
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a74bcd8e35f80f5a62db48c4a2bb0173e"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a74bcd8e35f80f5a62db48c4a2bb0173e">mlx::core::metal::CommandEncoder::dispatchThreadgroups</a></div><div class="ttdeci">void dispatchThreadgroups(MTL::Size grid_dims, MTL::Size group_dims)</div></div>
2024-08-11 00:24:35 +08:00
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a9b6dd221ccd2d939d544004cb6279198"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a9b6dd221ccd2d939d544004cb6279198">mlx::core::metal::CommandEncoder::~CommandEncoder</a></div><div class="ttdeci">~CommandEncoder()</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_aac45ab0630ea32cf7d15c7ba3e229966"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#aac45ab0630ea32cf7d15c7ba3e229966">mlx::core::metal::CommandEncoder::operator-&gt;</a></div><div class="ttdeci">MTL::ComputeCommandEncoder * operator-&gt;()</div><div class="ttdef"><b>Definition</b> device.h:40</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_ab69ff0d7f14b9b59db4df0608193dce4"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ab69ff0d7f14b9b59db4df0608193dce4">mlx::core::metal::CommandEncoder::set_input_array</a></div><div class="ttdeci">void set_input_array(const array &amp;a, int idx, int64_t offset=0)</div></div>
2024-06-07 11:28:06 +08:00
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_ac68ca977b5bde5434284ce7979647f14"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ac68ca977b5bde5434284ce7979647f14">mlx::core::metal::CommandEncoder::CommandEncoder</a></div><div class="ttdeci">CommandEncoder(const CommandEncoder &amp;)=delete</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.10.0
</small></address>
</body>
</html>