mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-25 09:51:17 +08:00
390 lines
64 KiB
HTML
390 lines
64 KiB
HTML
<!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&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&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&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 <Metal/Metal.hpp></span></div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include <functional></span></div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include <mutex></span></div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include <string></span></div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include <unordered_map></span></div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <unordered_set></span></div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <dlfcn.h></span></div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <filesystem></span></div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include "<a class="code" href="array_8h.html">mlx/array.h</a>"</span></div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include "<a class="code" href="device_8h.html">mlx/device.h</a>"</span></div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="keyword">namespace </span>fs = std::filesystem;</div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</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="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
|
|
<div class="foldopen" id="foldopen00022" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1metal.html#a5fd6ba2040e53a254b9d71ae7ebd315f"> 22</a></span><span class="keyword">inline</span> std::string <a class="code hl_function" href="namespacemlx_1_1core_1_1metal.html#a5fd6ba2040e53a254b9d71ae7ebd315f">get_colocated_mtllib_path</a>(<span class="keyword">const</span> std::string& lib_name) {</div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> Dl_info info;</div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> std::string mtllib_path;</div>
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> std::string lib_ext = lib_name + <span class="stringliteral">".metallib"</span>;</div>
|
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordtype">int</span> success = dladdr((<span class="keywordtype">void</span>*)<a class="code hl_function" href="namespacemlx_1_1core_1_1metal.html#a5fd6ba2040e53a254b9d71ae7ebd315f">get_colocated_mtllib_path</a>, &info);</div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">if</span> (success) {</div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">auto</span> mtllib = fs::path(info.dli_fname).remove_filename() / lib_ext;</div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> mtllib_path = mtllib.c_str();</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> </div>
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordflow">return</span> mtllib_path;</div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54"> 36</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="l00037" name="l00037"></a><span class="lineno"> 37</span> std::vector<std::tuple<const void*, MTL::DataType, NS::UInteger>>;</div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
|
|
<div class="foldopen" id="foldopen00039" data-start="{" data-end="};">
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html"> 39</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="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#a2334774486f447213ee997e55c2e52a3"> 40</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a2334774486f447213ee997e55c2e52a3">CommandEncoder</a>(MTL::CommandBuffer* cbuf) : cbuf(cbuf) {</div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> enc = cbuf->computeCommandEncoder(MTL::DispatchTypeConcurrent);</div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> enc->retain();</div>
|
|
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> };</div>
|
|
</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#ac68ca977b5bde5434284ce7979647f14"> 44</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>&) = <span class="keyword">delete</span>;</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#a3f42a1362b4a513fa89e7b3dcc570a8e"> 45</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>& <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>&) = <span class="keyword">delete</span>;</div>
|
|
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> </div>
|
|
<div class="foldopen" id="foldopen00047" data-start="{" data-end="};">
|
|
<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_1_1_concurrent_context.html"> 47</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="foldopen00048" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#aee044d7729739c96e845823f9ecc5174"> 48</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>& enc) : enc(enc) {</div>
|
|
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> enc.concurrent = <span class="keyword">true</span>;</div>
|
|
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
|
|
</div>
|
|
<div class="foldopen" id="foldopen00051" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#a28bafec56edec3091e8716d8ccfb6ee1"> 51</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="l00052" name="l00052"></a><span class="lineno"> 52</span> enc.concurrent = <span class="keyword">false</span>;</div>
|
|
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> enc.outputs.insert(</div>
|
|
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> enc.concurrent_outputs.begin(), enc.concurrent_outputs.end());</div>
|
|
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> enc.concurrent_outputs.clear();</div>
|
|
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
|
|
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keyword">private</span>:</div>
|
|
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>& enc;</div>
|
|
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> };</div>
|
|
</div>
|
|
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
|
|
<div class="foldopen" id="foldopen00062" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#aac45ab0630ea32cf7d15c7ba3e229966"> 62</a></span> MTL::ComputeCommandEncoder* <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#aac45ab0630ea32cf7d15c7ba3e229966">operator-></a>() {</div>
|
|
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">return</span> enc;</div>
|
|
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
|
|
<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="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ab69ff0d7f14b9b59db4df0608193dce4"> 66</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>& a, <span class="keywordtype">int</span> idx, int64_t offset = 0) {</div>
|
|
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keyword">auto</span> r_buf =</div>
|
|
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keyword">static_cast<</span>MTL::Resource*<span class="keyword">></span>(<span class="keyword">const_cast<</span><span class="keywordtype">void</span>*<span class="keyword">></span>(a.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08">buffer</a>().<a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94">ptr</a>()));</div>
|
|
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> it = outputs.find(r_buf); it != outputs.end()) {</div>
|
|
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="comment">// Insert a barrier</span></div>
|
|
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> enc->memoryBarrier(&r_buf, 1);</div>
|
|
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
|
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// Remove the output</span></div>
|
|
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> outputs.erase(it);</div>
|
|
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> }</div>
|
|
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keyword">auto</span> a_buf = <span class="keyword">static_cast<</span><span class="keyword">const </span>MTL::Buffer*<span class="keyword">></span>(a.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08">buffer</a>().<a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94">ptr</a>());</div>
|
|
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keyword">auto</span> base_offset = a.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a><<span class="keywordtype">char</span>>() -</div>
|
|
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keyword">static_cast<</span><span class="keywordtype">char</span>*<span class="keyword">></span>(<span class="keyword">const_cast<</span>MTL::Buffer*<span class="keyword">></span>(a_buf)->contents());</div>
|
|
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> base_offset += offset;</div>
|
|
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> enc->setBuffer(a_buf, base_offset, idx);</div>
|
|
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
|
|
<div class="foldopen" id="foldopen00083" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a6a2e28e542eaa2886041bddd51ff6522"> 83</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>& a, <span class="keywordtype">int</span> idx, int64_t offset = 0) {</div>
|
|
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">// Add barriers before adding the output to the output set</span></div>
|
|
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ab69ff0d7f14b9b59db4df0608193dce4">set_input_array</a>(a, idx, offset);</div>
|
|
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keyword">auto</span> <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a> = <span class="keyword">static_cast<</span>MTL::Resource*<span class="keyword">></span>(a.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08">buffer</a>().<a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94">ptr</a>());</div>
|
|
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">if</span> (concurrent) {</div>
|
|
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> concurrent_outputs.insert(<a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
|
|
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> } <span class="keywordflow">else</span> {</div>
|
|
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> outputs.insert(<a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
|
|
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> }</div>
|
|
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
|
|
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a74bcd8e35f80f5a62db48c4a2bb0173e"> 94</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="l00095" name="l00095"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a1e41477f2f489e38499f7830a91c9810"> 95</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="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
|
|
<div class="foldopen" id="foldopen00097" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a48b548a0b15f9d1279c938a1c6167034"> 97</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="l00098" name="l00098"></a><span class="lineno"> 98</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="l00099" name="l00099"></a><span class="lineno"> 99</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> </div>
|
|
<div class="foldopen" id="foldopen00101" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a9b6dd221ccd2d939d544004cb6279198"> 101</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="l00102" name="l00102"></a><span class="lineno"> 102</span> enc->endEncoding();</div>
|
|
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> enc->release();</div>
|
|
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> }</div>
|
|
</div>
|
|
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
|
|
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keyword">private</span>:</div>
|
|
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordtype">void</span> maybe_split();</div>
|
|
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> </div>
|
|
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordtype">int</span> num_dispatches{0};</div>
|
|
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> MTL::CommandBuffer* cbuf;</div>
|
|
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> MTL::ComputeCommandEncoder* enc;</div>
|
|
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordtype">bool</span> concurrent{<span class="keyword">false</span>};</div>
|
|
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> std::unordered_set<MTL::Resource*> outputs;</div>
|
|
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> std::unordered_set<MTL::Resource*> concurrent_outputs;</div>
|
|
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span>};</div>
|
|
</div>
|
|
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> </div>
|
|
<div class="foldopen" id="foldopen00117" data-start="{" data-end="};">
|
|
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html"> 117</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="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keyword">public</span>:</div>
|
|
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#ae0db74570eb4b19d8cf19774db91bfd6"> 119</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="l00120" name="l00120"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#abf59a4addb5473f9e814e3651ba85f06"> 120</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>&) = <span class="keyword">delete</span>;</div>
|
|
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#ad1d6382fd18a46b1906e1b43e0bd2e73"> 121</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a>& <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>&) = <span class="keyword">delete</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#a4f39c28c6cdd1d2da1918f5871bcba6e"> 122</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a4f39c28c6cdd1d2da1918f5871bcba6e">~Device</a>();</div>
|
|
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> </div>
|
|
<div class="foldopen" id="foldopen00124" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a31dba377f2be44a746db10d1b9367653"> 124</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="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordflow">return</span> device_;</div>
|
|
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> };</div>
|
|
</div>
|
|
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
|
|
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a8135ae2a8c1e6f3861e84d4e60c28b67"> 128</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="l00129" name="l00129"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a5fe3970fbe92ccc55fce4241ffbe5210"> 129</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="l00130" name="l00130"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a064e1cb6a16de7a0619f6447622350f8"> 130</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="l00131" name="l00131"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a7a33d4d601423a3d3c23d5ad7072abb6"> 131</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="l00132" name="l00132"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a95248f1387824067fd4fed23ace5ac0c"> 132</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="l00133" name="l00133"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#affa682ef612def4890f5152f81ffb7e6"> 133</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>& <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="l00134" name="l00134"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a60689f97347811b27e8c5ca23e0372bf"> 134</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="l00135" name="l00135"></a><span class="lineno"> 135</span> </div>
|
|
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a45945f2efcd242d915ffa2171e92bf9d"> 136</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="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keyword">const</span> std::string& lib_name,</div>
|
|
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keyword">const</span> std::string& lib_path);</div>
|
|
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a6993ce23a485b725b687628b77751ad2"> 139</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a6993ce23a485b725b687628b77751ad2">register_library</a>(</div>
|
|
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keyword">const</span> std::string& lib_name,</div>
|
|
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keyword">const</span> std::function<std::string(<span class="keyword">const</span> std::string&)>& lib_path_func =</div>
|
|
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <a class="code hl_function" href="namespacemlx_1_1core_1_1metal.html#a5fd6ba2040e53a254b9d71ae7ebd315f">get_colocated_mtllib_path</a>);</div>
|
|
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> </div>
|
|
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a86297d66de43ee77d0697f69c6bd0b87"> 144</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& name);</div>
|
|
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
|
|
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a961d3cdb4bfb14c1a0b0aeb05609f56e"> 146</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="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keyword">const</span> std::string& name,</div>
|
|
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keyword">const</span> std::string& source_string,</div>
|
|
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordtype">bool</span> cache = <span class="keyword">true</span>);</div>
|
|
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> </div>
|
|
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a8d8d9e28ffeea10d687b91ea480fb4bd"> 151</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="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keyword">const</span> std::string& name,</div>
|
|
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="keyword">const</span> MTL::StitchedLibraryDescriptor* desc,</div>
|
|
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordtype">bool</span> cache = <span class="keyword">true</span>);</div>
|
|
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> </div>
|
|
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#abf4ecf035e8be2ff00d2a7e95475d7ac"> 156</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="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="keyword">const</span> std::string& base_name,</div>
|
|
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> MTL::Library* mtl_lib,</div>
|
|
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keyword">const</span> std::string& specialized_name = <span class="stringliteral">""</span>,</div>
|
|
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>& func_consts = {});</div>
|
|
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
|
|
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#ac083535ead07161cb27ad31f8f64fb84"> 162</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="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keyword">const</span> std::string& base_name,</div>
|
|
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keyword">const</span> std::string& lib_name = <span class="stringliteral">"mlx"</span>,</div>
|
|
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keyword">const</span> std::string& specialized_name = <span class="stringliteral">""</span>,</div>
|
|
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>& func_consts = {});</div>
|
|
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> </div>
|
|
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a6810c4dcbcfbf93fc51d42aa5ff0fc3a"> 168</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="l00169" name="l00169"></a><span class="lineno"> 169</span> <span class="keyword">const</span> std::string& base_name,</div>
|
|
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> MTL::Library* mtl_lib,</div>
|
|
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keyword">const</span> std::string& hash_name = <span class="stringliteral">""</span>,</div>
|
|
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>& func_consts = {},</div>
|
|
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <span class="keyword">const</span> std::vector<MTL::Function*>& linked_functions = {});</div>
|
|
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> </div>
|
|
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#afa0cac9d800c21a8a7f6cb224256abaf"> 175</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="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keyword">const</span> std::string& base_name,</div>
|
|
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="keyword">const</span> std::string& lib_name = <span class="stringliteral">"mlx"</span>,</div>
|
|
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="keyword">const</span> std::string& hash_name = <span class="stringliteral">""</span>,</div>
|
|
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>& func_consts = {},</div>
|
|
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <span class="keyword">const</span> std::vector<MTL::Function*>& linked_functions = {});</div>
|
|
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> </div>
|
|
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a6e33e2b1287324fb4a6575e0da5e5881"> 182</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="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="keyword">const</span> std::vector<MTL::ArgumentDescriptor*>& arg_descs) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> </div>
|
|
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> <span class="keyword">private</span>:</div>
|
|
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> MTL::Library* get_library_cache_(<span class="keyword">const</span> std::string& name);</div>
|
|
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> </div>
|
|
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> MTL::Library* get_library_(<span class="keyword">const</span> std::string& source_string);</div>
|
|
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> MTL::Library* get_library_(<span class="keyword">const</span> MTL::StitchedLibraryDescriptor* desc);</div>
|
|
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> </div>
|
|
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> MTL::Function* get_function_(<span class="keyword">const</span> std::string& name, MTL::Library* mtl_lib);</div>
|
|
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> </div>
|
|
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> MTL::Function* get_function_(</div>
|
|
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="keyword">const</span> std::string& name,</div>
|
|
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <span class="keyword">const</span> std::string& specialized_name,</div>
|
|
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>& func_consts,</div>
|
|
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> MTL::Library* mtl_lib);</div>
|
|
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> </div>
|
|
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> MTL::LinkedFunctions* get_linked_functions_(</div>
|
|
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keyword">const</span> std::vector<MTL::Function*>& funcs);</div>
|
|
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> </div>
|
|
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> MTL::ComputePipelineState* get_kernel_(</div>
|
|
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <span class="keyword">const</span> std::string& name,</div>
|
|
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> <span class="keyword">const</span> MTL::Function* mtl_function);</div>
|
|
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> </div>
|
|
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> MTL::ComputePipelineState* get_kernel_(</div>
|
|
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> <span class="keyword">const</span> std::string& name,</div>
|
|
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <span class="keyword">const</span> MTL::Function* mtl_function,</div>
|
|
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <span class="keyword">const</span> MTL::LinkedFunctions* linked_functions);</div>
|
|
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> </div>
|
|
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> MTL::Device* device_;</div>
|
|
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> std::unordered_map<int32_t, MTL::CommandQueue*> queue_map_;</div>
|
|
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> std::unordered_map<int32_t, std::pair<int, MTL::CommandBuffer*>> buffer_map_;</div>
|
|
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> std::unordered_map<int32_t, std::unique_ptr<CommandEncoder>> encoder_map_;</div>
|
|
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> std::unordered_map<std::string, MTL::ComputePipelineState*> kernel_map_;</div>
|
|
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> std::unordered_map<std::string, MTL::Library*> library_map_;</div>
|
|
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> std::mutex mtx_;</div>
|
|
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span>};</div>
|
|
</div>
|
|
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> </div>
|
|
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1metal.html#a910797b74824e6ee576fbb533dee8b57"> 220</a></span><a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a>& <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="l00221" name="l00221"></a><span class="lineno"> 221</span> </div>
|
|
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span>} <span class="comment">// namespace mlx::core::metal</span></div>
|
|
<div class="ttc" id="aarray_8h_html"><div class="ttname"><a href="array_8h.html">array.h</a></div></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:38</div></div>
|
|
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_buffer_html_a990643feac06961c5599aac098c17b94"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94">mlx::core::allocator::Buffer::ptr</a></div><div class="ttdeci">const void * ptr() const</div><div class="ttdef"><b>Definition</b> allocator.h:23</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>
|
|
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a72e3ce6c03fefe272cadf214bd127b95"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">mlx::core::array::data</a></div><div class="ttdeci">T * data()</div><div class="ttdef"><b>Definition</b> array.h:313</div></div>
|
|
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_ab3daf04c27c4593d9d73c397b8484a08"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08">mlx::core::array::buffer</a></div><div class="ttdeci">allocator::Buffer & buffer()</div><div class="ttdef"><b>Definition</b> array.h:299</div></div>
|
|
<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:117</div></div>
|
|
<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>
|
|
<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:124</div></div>
|
|
<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 &lib_name, const std::string &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 &base_name, MTL::Library *mtl_lib, const std::string &hash_name="", const MTLFCList &func_consts={}, const std::vector< MTL::Function * > &linked_functions={})</div></div>
|
|
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a6993ce23a485b725b687628b77751ad2"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a6993ce23a485b725b687628b77751ad2">mlx::core::metal::Device::register_library</a></div><div class="ttdeci">void register_library(const std::string &lib_name, const std::function< std::string(const std::string &)> &lib_path_func=get_colocated_mtllib_path)</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< MTL::ArgumentDescriptor * > &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 &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 &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 &name, const std::string &source_string, bool cache=true)</div></div>
|
|
<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 &base_name, MTL::Library *mtl_lib, const std::string &specialized_name="", const MTLFCList &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 &)=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 &base_name, const std::string &lib_name="mlx", const std::string &specialized_name="", const MTLFCList &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 & operator=(const Device &)=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 &base_name, const std::string &lib_name="mlx", const std::string &hash_name="", const MTLFCList &func_consts={}, const std::vector< MTL::Function * > &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 & 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>
|
|
<div class="ttc" id="anamespacemlx_1_1core_1_1metal_html_a5fd6ba2040e53a254b9d71ae7ebd315f"><div class="ttname"><a href="namespacemlx_1_1core_1_1metal.html#a5fd6ba2040e53a254b9d71ae7ebd315f">mlx::core::metal::get_colocated_mtllib_path</a></div><div class="ttdeci">std::string get_colocated_mtllib_path(const std::string &lib_name)</div><div class="ttdef"><b>Definition</b> device.h:22</div></div>
|
|
<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< std::tuple< const void *, MTL::DataType, NS::UInteger > > MTLFCList</div><div class="ttdef"><b>Definition</b> device.h:36</div></div>
|
|
<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 & 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>
|
|
<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:47</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:51</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 &enc)</div><div class="ttdef"><b>Definition</b> device.h:48</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:39</div></div>
|
|
<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>
|
|
<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 class="ttdef"><b>Definition</b> device.h:40</div></div>
|
|
<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 & operator=(const CommandEncoder &)=delete</div></div>
|
|
<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:97</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 &a, int idx, int64_t offset=0)</div><div class="ttdef"><b>Definition</b> device.h:83</div></div>
|
|
<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>
|
|
<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 class="ttdef"><b>Definition</b> device.h:101</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-></a></div><div class="ttdeci">MTL::ComputeCommandEncoder * operator->()</div><div class="ttdef"><b>Definition</b> device.h:62</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 &a, int idx, int64_t offset=0)</div><div class="ttdef"><b>Definition</b> device.h:66</div></div>
|
|
<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 &)=delete</div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by <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>
|