mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-26 02:33:21 +08:00
176 lines
18 KiB
HTML
176 lines
18 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.13.1"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>MLX: mlx/stream.h Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<script type="text/javascript" src="clipboard.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="cookie.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { init_search(); });
|
|
/* @license-end */
|
|
</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>
|
|
<td> <div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span>
|
|
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.13.1 -->
|
|
<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">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { codefold.init(0); });
|
|
/* @license-end */
|
|
</script>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function(){initNavTree('stream_8h_source.html',''); initResizable(true); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<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 class="header">
|
|
<div class="headertitle"><div class="title">stream.h</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="stream_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 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 "<a class="code" href="device_8h.html">mlx/device.h</a>"</span></div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemlx_1_1core.html">mlx::core</a> {</div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
|
|
<div class="foldopen" id="foldopen00009" data-start="{" data-end="};">
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_stream.html"> 9</a></span><span class="keyword">struct </span><a class="code hl_function" href="structmlx_1_1core_1_1_stream.html#a7f0815ff4886da74cbbff5f93d82dd3e">Stream</a> {</div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_stream.html#a9d0dafc1899333e1176eb2bbc0a8b626"> 10</a></span> <span class="keywordtype">int</span> <a class="code hl_variable" href="structmlx_1_1core_1_1_stream.html#a9d0dafc1899333e1176eb2bbc0a8b626">index</a>;</div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_stream.html#a406b1b0162287a4162fab1f70e2ff3bb"> 11</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1_device.html">Device</a> <a class="code hl_variable" href="structmlx_1_1core_1_1_stream.html#a406b1b0162287a4162fab1f70e2ff3bb">device</a>;</div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_stream.html#a7f0815ff4886da74cbbff5f93d82dd3e"> 12</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="structmlx_1_1core_1_1_stream.html#a7f0815ff4886da74cbbff5f93d82dd3e">Stream</a>(<span class="keywordtype">int</span> <a class="code hl_variable" href="structmlx_1_1core_1_1_stream.html#a9d0dafc1899333e1176eb2bbc0a8b626">index</a>, <a class="code hl_struct" href="structmlx_1_1core_1_1_device.html">Device</a> <a class="code hl_variable" href="structmlx_1_1core_1_1_stream.html#a406b1b0162287a4162fab1f70e2ff3bb">device</a>) : <a class="code hl_variable" href="structmlx_1_1core_1_1_stream.html#a9d0dafc1899333e1176eb2bbc0a8b626">index</a>(<a class="code hl_variable" href="structmlx_1_1core_1_1_stream.html#a9d0dafc1899333e1176eb2bbc0a8b626">index</a>), <a class="code hl_variable" href="structmlx_1_1core_1_1_stream.html#a406b1b0162287a4162fab1f70e2ff3bb">device</a>(<a class="code hl_variable" href="structmlx_1_1core_1_1_stream.html#a406b1b0162287a4162fab1f70e2ff3bb">device</a>) {}</div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span>};</div>
|
|
</div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span></div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#ac198b7e282957c724c84a435e8f1215e"> 16</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1_stream.html">Stream</a> <a class="code hl_function" href="namespacemlx_1_1core.html#ac198b7e282957c724c84a435e8f1215e">default_stream</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1_device.html">Device</a> d);</div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span></div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#af35a2b06517d8bb7dbb469692b4f841c"> 19</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="namespacemlx_1_1core.html#af35a2b06517d8bb7dbb469692b4f841c">set_default_stream</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1_stream.html">Stream</a> s);</div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span></div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a6f7c63a9be10337b3b96d527e1db3c2f"> 22</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1_stream.html">Stream</a> <a class="code hl_function" href="namespacemlx_1_1core.html#a6f7c63a9be10337b3b96d527e1db3c2f">new_stream</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1_device.html">Device</a> d);</div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span></div>
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#ab436b8c08be2be32ef61bd72f7df63cd"> 25</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1_stream.html">Stream</a> <a class="code hl_function" href="namespacemlx_1_1core.html#ab436b8c08be2be32ef61bd72f7df63cd">get_stream</a>(<span class="keywordtype">int</span> index);</div>
|
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
|
|
<div class="foldopen" id="foldopen00027" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#ac470f937a379d6356c8f567c97cd7481"> 27</a></span><span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a937503d72b66c661bf3f5fdcd98ef97c">operator==</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_stream.html">Stream</a>& lhs, <span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_stream.html">Stream</a>& rhs) {</div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">return</span> lhs.<a class="code hl_variable" href="structmlx_1_1core_1_1_stream.html#a9d0dafc1899333e1176eb2bbc0a8b626">index</a> == rhs.<a class="code hl_variable" href="structmlx_1_1core_1_1_stream.html#a9d0dafc1899333e1176eb2bbc0a8b626">index</a>;</div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
|
<div class="foldopen" id="foldopen00031" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a164f109bc19c927b2b3bcc47a5021419"> 31</a></span><span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a94d00a1b7f8a4717ab3f26f45e4da655">operator!=</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_stream.html">Stream</a>& lhs, <span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_stream.html">Stream</a>& rhs) {</div>
|
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">return</span> !(lhs == rhs);</div>
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment">/* Synchronize with the default stream. */</span></div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a14287949d82ffefad0306cef5eb5f9e4"> 36</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a14287949d82ffefad0306cef5eb5f9e4">synchronize</a>();</div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="comment">/* Synchronize with the provided stream. */</span></div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a6648a71937b055e5ff513d98056c2fb5"> 39</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a14287949d82ffefad0306cef5eb5f9e4">synchronize</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1_stream.html">Stream</a>);</div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span>} <span class="comment">// namespace mlx::core</span></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_html"><div class="ttname"><a href="namespacemlx_1_1core.html">mlx::core</a></div><div class="ttdef"><b>Definition</b> allocator.h:7</div></div>
|
|
<div class="ttc" id="anamespacemlx_1_1core_html_a14287949d82ffefad0306cef5eb5f9e4"><div class="ttname"><a href="namespacemlx_1_1core.html#a14287949d82ffefad0306cef5eb5f9e4">mlx::core::synchronize</a></div><div class="ttdeci">void synchronize()</div></div>
|
|
<div class="ttc" id="anamespacemlx_1_1core_html_a6f7c63a9be10337b3b96d527e1db3c2f"><div class="ttname"><a href="namespacemlx_1_1core.html#a6f7c63a9be10337b3b96d527e1db3c2f">mlx::core::new_stream</a></div><div class="ttdeci">Stream new_stream(Device d)</div><div class="ttdoc">Make a new stream on the given device.</div></div>
|
|
<div class="ttc" id="anamespacemlx_1_1core_html_a937503d72b66c661bf3f5fdcd98ef97c"><div class="ttname"><a href="namespacemlx_1_1core.html#a937503d72b66c661bf3f5fdcd98ef97c">mlx::core::operator==</a></div><div class="ttdeci">bool operator==(const Device &lhs, const Device &rhs)</div></div>
|
|
<div class="ttc" id="anamespacemlx_1_1core_html_a94d00a1b7f8a4717ab3f26f45e4da655"><div class="ttname"><a href="namespacemlx_1_1core.html#a94d00a1b7f8a4717ab3f26f45e4da655">mlx::core::operator!=</a></div><div class="ttdeci">bool operator!=(const Device &lhs, const Device &rhs)</div></div>
|
|
<div class="ttc" id="anamespacemlx_1_1core_html_ab436b8c08be2be32ef61bd72f7df63cd"><div class="ttname"><a href="namespacemlx_1_1core.html#ab436b8c08be2be32ef61bd72f7df63cd">mlx::core::get_stream</a></div><div class="ttdeci">Stream get_stream(int index)</div><div class="ttdoc">Get the stream with the given index.</div></div>
|
|
<div class="ttc" id="anamespacemlx_1_1core_html_ac198b7e282957c724c84a435e8f1215e"><div class="ttname"><a href="namespacemlx_1_1core.html#ac198b7e282957c724c84a435e8f1215e">mlx::core::default_stream</a></div><div class="ttdeci">Stream default_stream(Device d)</div><div class="ttdoc">Get the default stream for the given device.</div></div>
|
|
<div class="ttc" id="anamespacemlx_1_1core_html_af35a2b06517d8bb7dbb469692b4f841c"><div class="ttname"><a href="namespacemlx_1_1core.html#af35a2b06517d8bb7dbb469692b4f841c">mlx::core::set_default_stream</a></div><div class="ttdeci">void set_default_stream(Stream s)</div><div class="ttdoc">Make the stream the default for its 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_1_stream_html"><div class="ttname"><a href="structmlx_1_1core_1_1_stream.html">mlx::core::Stream</a></div><div class="ttdef"><b>Definition</b> stream.h:9</div></div>
|
|
<div class="ttc" id="astructmlx_1_1core_1_1_stream_html_a406b1b0162287a4162fab1f70e2ff3bb"><div class="ttname"><a href="structmlx_1_1core_1_1_stream.html#a406b1b0162287a4162fab1f70e2ff3bb">mlx::core::Stream::device</a></div><div class="ttdeci">Device device</div><div class="ttdef"><b>Definition</b> stream.h:11</div></div>
|
|
<div class="ttc" id="astructmlx_1_1core_1_1_stream_html_a7f0815ff4886da74cbbff5f93d82dd3e"><div class="ttname"><a href="structmlx_1_1core_1_1_stream.html#a7f0815ff4886da74cbbff5f93d82dd3e">mlx::core::Stream::Stream</a></div><div class="ttdeci">Stream(int index, Device device)</div><div class="ttdef"><b>Definition</b> stream.h:12</div></div>
|
|
<div class="ttc" id="astructmlx_1_1core_1_1_stream_html_a9d0dafc1899333e1176eb2bbc0a8b626"><div class="ttname"><a href="structmlx_1_1core_1_1_stream.html#a9d0dafc1899333e1176eb2bbc0a8b626">mlx::core::Stream::index</a></div><div class="ttdeci">int index</div><div class="ttdef"><b>Definition</b> stream.h:10</div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="stream_8h.html">stream.h</a></li>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.1 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|