mlx/docs/build/html/utils_8h_source.html

277 lines
46 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/utils.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> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">utils.h</div></div>
</div><!--header-->
<div class="contents">
<a href="utils_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;variant&gt;</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="preprocessor">#include &quot;<a class="code" href="array_8h.html">array.h</a>&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &quot;<a class="code" href="device_8h.html">device.h</a>&quot;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;<a class="code" href="dtype_8h.html">dtype.h</a>&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;<a class="code" href="stream_8h.html">stream.h</a>&quot;</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="keyword">namespace </span><a class="code hl_namespace" href="namespacemlx_1_1core.html">mlx::core</a> {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58"> 14</a></span><span class="keyword">using </span><a class="code hl_typedef" href="namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58">StreamOrDevice</a> = std::variant&lt;std::monostate, Stream, Device&gt;;</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a4734a596e57434492ddfe79f2cb9dbf9"> 15</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#a4734a596e57434492ddfe79f2cb9dbf9">to_stream</a>(<a class="code hl_typedef" href="namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58">StreamOrDevice</a> s);</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="foldopen" id="foldopen00017" data-start="{" data-end="};">
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_stream_context.html"> 17</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1core_1_1_stream_context.html">StreamContext</a> {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00019" data-start="{" data-end="}">
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_stream_context.html#a89d803151e9d7dce29382aa83d5c6ef1"> 19</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1_stream_context.html#a89d803151e9d7dce29382aa83d5c6ef1">StreamContext</a>(<a class="code hl_typedef" href="namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58">StreamOrDevice</a> s) : _stream(<a class="code hl_function" href="namespacemlx_1_1core.html#ac198b7e282957c724c84a435e8f1215e">default_stream</a>(<a class="code hl_function" href="namespacemlx_1_1core.html#a0196171cfe6ee2953113abce597dc815">default_device</a>())) {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordflow">if</span> (std::holds_alternative&lt;std::monostate&gt;(s)) {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">throw</span> std::runtime_error(</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="stringliteral">&quot;[StreamContext] Invalid argument, please specify a stream or device.&quot;</span>);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> }</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keyword">auto</span> _s = <a class="code hl_function" href="namespacemlx_1_1core.html#a4734a596e57434492ddfe79f2cb9dbf9">to_stream</a>(s);</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a312a2de41367fe52caeaf8c0f596a120">set_default_device</a>(_s.device);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <a class="code hl_function" href="namespacemlx_1_1core.html#af35a2b06517d8bb7dbb469692b4f841c">set_default_stream</a>(_s);</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> }</div>
</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </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_1_stream_context.html#ac5be1c576d22b3d0b0a6fcc7e6abe659"> 29</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1_stream_context.html#ac5be1c576d22b3d0b0a6fcc7e6abe659">~StreamContext</a>() {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a312a2de41367fe52caeaf8c0f596a120">set_default_device</a>(_stream.<a class="code hl_variable" href="structmlx_1_1core_1_1_stream.html#a406b1b0162287a4162fab1f70e2ff3bb">device</a>);</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <a class="code hl_function" href="namespacemlx_1_1core.html#af35a2b06517d8bb7dbb469692b4f841c">set_default_stream</a>(_stream);</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> }</div>
</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_stream.html">Stream</a> _stream;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span>};</div>
</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
<div class="foldopen" id="foldopen00038" data-start="{" data-end="};">
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html"> 38</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1core_1_1_print_formatter.html">PrintFormatter</a> {</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html#a79fad4cf5844db8c92b066539146281b"> 39</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1_print_formatter.html#a79fad4cf5844db8c92b066539146281b">print</a>(std::ostream&amp; os, <span class="keywordtype">bool</span> val);</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html#a8da448a8adae671b26359341ea514316"> 40</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1_print_formatter.html#a8da448a8adae671b26359341ea514316">print</a>(std::ostream&amp; os, int16_t val);</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html#a9d750c134a6fbfa8251c5b1d01d73287"> 41</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1_print_formatter.html#a9d750c134a6fbfa8251c5b1d01d73287">print</a>(std::ostream&amp; os, uint16_t val);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html#adbbb9cbff767f9db73c659a0c07ba633"> 42</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1_print_formatter.html#adbbb9cbff767f9db73c659a0c07ba633">print</a>(std::ostream&amp; os, int32_t val);</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html#a520adb07fafd911b22bc24b295e4f6cf"> 43</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1_print_formatter.html#a520adb07fafd911b22bc24b295e4f6cf">print</a>(std::ostream&amp; os, uint32_t val);</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html#ab0c702f1ae201e17cd328c9855cf522e"> 44</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1_print_formatter.html#ab0c702f1ae201e17cd328c9855cf522e">print</a>(std::ostream&amp; os, int64_t val);</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html#ac59a5137ddd8b32aae057bb9826ee80d"> 45</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1_print_formatter.html#ac59a5137ddd8b32aae057bb9826ee80d">print</a>(std::ostream&amp; os, uint64_t val);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html#ac4b7895d1168cfc1a3d1186d8a414d2f"> 46</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1_print_formatter.html#ac4b7895d1168cfc1a3d1186d8a414d2f">print</a>(std::ostream&amp; os, <a class="code hl_struct" href="structmlx_1_1core_1_1___m_l_x___float16.html">float16_t</a> val);</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html#ae21005f92bc641f2d657096f5d176a6d"> 47</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1_print_formatter.html#ae21005f92bc641f2d657096f5d176a6d">print</a>(std::ostream&amp; os, <a class="code hl_struct" href="structmlx_1_1core_1_1___m_l_x___b_float16.html">bfloat16_t</a> val);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html#a57af5c32561b95d6ac2a3a1dc4f5d43e"> 48</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1_print_formatter.html#a57af5c32561b95d6ac2a3a1dc4f5d43e">print</a>(std::ostream&amp; os, <span class="keywordtype">float</span> val);</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html#a9e1dc67c9afb0a09966336504790823d"> 49</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1_print_formatter.html#a9e1dc67c9afb0a09966336504790823d">print</a>(std::ostream&amp; os, <a class="code hl_struct" href="structmlx_1_1core_1_1complex64__t.html">complex64_t</a> val);</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1_print_formatter.html#adf49a949db36f0ba076842a6d675d79a"> 51</a></span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="structmlx_1_1core_1_1_print_formatter.html#adf49a949db36f0ba076842a6d675d79a">capitalize_bool</a>{<span class="keyword">false</span>};</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span>};</div>
</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="keyword">extern</span> PrintFormatter <a class="code hl_variable" href="namespacemlx_1_1core.html#af5a408a78cc934717dd711ddfda58ea6">global_formatter</a>;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> </div>
<div class="foldopen" id="foldopen00057" data-start="{" data-end="}">
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a8b984eef832f757e28cd262d64a49ae7"> 57</a></span><span class="keyword">inline</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> <a class="code hl_function" href="namespacemlx_1_1core.html#a8b984eef832f757e28cd262d64a49ae7">result_type</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; a, <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; b) {</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a505922e54acd43114308e3bdbda0e497">promote_types</a>(a.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a>(), b.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a>());</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span>}</div>
</div>
<div class="foldopen" id="foldopen00060" data-start="{" data-end="}">
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#ac457c232f956ba802acb69c5a621633d"> 60</a></span><span class="keyword">inline</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> <a class="code hl_function" href="namespacemlx_1_1core.html#a8b984eef832f757e28cd262d64a49ae7">result_type</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; a, <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; b, <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; c) {</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a505922e54acd43114308e3bdbda0e497">promote_types</a>(<a class="code hl_function" href="namespacemlx_1_1core.html#a8b984eef832f757e28cd262d64a49ae7">result_type</a>(a, b), c.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a>());</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span>}</div>
</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#aafaf24a28297428caf6d0c36c623489e"> 63</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> <a class="code hl_function" href="namespacemlx_1_1core.html#a8b984eef832f757e28cd262d64a49ae7">result_type</a>(<span class="keyword">const</span> std::vector&lt;array&gt;&amp; arrays);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a075e07def338cd9d815182d0e6a656c0"> 65</a></span>std::vector&lt;int&gt; <a class="code hl_function" href="namespacemlx_1_1core.html#a075e07def338cd9d815182d0e6a656c0">broadcast_shapes</a>(</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keyword">const</span> std::vector&lt;int&gt;&amp; s1,</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keyword">const</span> std::vector&lt;int&gt;&amp; s2);</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#ad4b664de4a4abd305827b30879b9da33"> 69</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemlx_1_1core.html#ad4b664de4a4abd305827b30879b9da33">is_same_shape</a>(<span class="keyword">const</span> std::vector&lt;array&gt;&amp; arrays);</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<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="namespacemlx_1_1core.html#a8b5f1435b7628a094a38b62e403e1540"> 73</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a8b5f1435b7628a094a38b62e403e1540">check_shape_dim</a>(<span class="keyword">const</span> T dim) {</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> is_signed = std::numeric_limits&lt;T&gt;::is_signed;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keyword">using </span>U = std::conditional_t&lt;is_signed, ssize_t, size_t&gt;;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keyword">constexpr</span> U <a class="code hl_function" href="group__ops.html#gab27599802617a4c8f9964ab5f4ffee12">min</a> = <span class="keyword">static_cast&lt;</span>U<span class="keyword">&gt;</span>(std::numeric_limits&lt;int&gt;::min());</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keyword">constexpr</span> U <a class="code hl_function" href="group__ops.html#ga7fed87d96cc7741d8267f4eac83f5fe7">max</a> = <span class="keyword">static_cast&lt;</span>U<span class="keyword">&gt;</span>(std::numeric_limits&lt;int&gt;::max());</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">if</span> ((is_signed &amp;&amp; dim &lt; <a class="code hl_function" href="group__ops.html#gab27599802617a4c8f9964ab5f4ffee12">min</a>) || dim &gt; <a class="code hl_function" href="group__ops.html#ga7fed87d96cc7741d8267f4eac83f5fe7">max</a>) {</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">throw</span> std::invalid_argument(</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="stringliteral">&quot;Shape dimension falls outside supported `int` range.&quot;</span>);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> }</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(dim);</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span>}</div>
</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> </div>
<div class="foldopen" id="foldopen00087" data-start="{" data-end="}">
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a625ed440df3fa57318017c1f2c589efe"> 87</a></span><span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a625ed440df3fa57318017c1f2c589efe">is_big_endian</a>() {</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keyword">union </span>ByteOrder {</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> int32_t i;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> uint8_t c[4];</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> ByteOrder b = {0x01234567};</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"> 94</span> <span class="keywordflow">return</span> b.c[0] == 0x01;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span>}</div>
</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a0181b5d72bf3d34448dabc70f7ff858d"> 102</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a0181b5d72bf3d34448dabc70f7ff858d">normalize_axis</a>(<span class="keywordtype">int</span> axis, <span class="keywordtype">int</span> ndim);</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> </div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a1e5c30e316afa30c14bc48b92afdb794"> 104</a></span>std::ostream&amp; <a class="code hl_function" href="group__ops.html#gad656c30f9fd7d9467e405657b325aa7e">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_device.html">Device</a>&amp; d);</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a4ddd07021b36c848d6fb1dd9ac276822"> 105</a></span>std::ostream&amp; <a class="code hl_function" href="group__ops.html#gad656c30f9fd7d9467e405657b325aa7e">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_stream.html">Stream</a>&amp; s);</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a0023c267cf81345fad65e7a797954cd3"> 106</a></span>std::ostream&amp; <a class="code hl_function" href="group__ops.html#gad656c30f9fd7d9467e405657b325aa7e">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a>&amp; d);</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a1fd58658474fb842d648dcf8f7d9f078"> 107</a></span>std::ostream&amp; <a class="code hl_function" href="group__ops.html#gad656c30f9fd7d9467e405657b325aa7e">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code hl_enumeration" href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715">Dtype::Kind</a>&amp; k);</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a123331f01188bd76e37623b63b6b4340"> 108</a></span>std::ostream&amp; <a class="code hl_function" href="group__ops.html#gad656c30f9fd7d9467e405657b325aa7e">operator&lt;&lt;</a>(std::ostream&amp; os, <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a> a);</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a4e733bba89760abed32393e085812b22"> 109</a></span>std::ostream&amp; <a class="code hl_function" href="group__ops.html#gad656c30f9fd7d9467e405657b325aa7e">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> std::vector&lt;int&gt;&amp; v);</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a6276bb9bad43ed4a27a1e2c3f5bfd990"> 110</a></span>std::ostream&amp; <a class="code hl_function" href="group__ops.html#gad656c30f9fd7d9467e405657b325aa7e">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> std::vector&lt;size_t&gt;&amp; v);</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a5e5bd5c57b1cf19776bdb41e732861d9"> 111</a></span>std::ostream&amp; <a class="code hl_function" href="group__ops.html#gad656c30f9fd7d9467e405657b325aa7e">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> std::vector&lt;int64_t&gt;&amp; v);</div>
<div class="foldopen" id="foldopen00112" data-start="{" data-end="}">
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a42a19c8442b173606e714364227e7d45"> 112</a></span><span class="keyword">inline</span> std::ostream&amp; <a class="code hl_function" href="group__ops.html#gad656c30f9fd7d9467e405657b325aa7e">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1complex64__t.html">complex64_t</a>&amp; v) {</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordflow">return</span> os &lt;&lt; v.real() &lt;&lt; (v.imag() &gt;= 0 ? <span class="stringliteral">&quot;+&quot;</span> : <span class="stringliteral">&quot;&quot;</span>) &lt;&lt; v.imag() &lt;&lt; <span class="stringliteral">&quot;j&quot;</span>;</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span>}</div>
</div>
<div class="foldopen" id="foldopen00115" data-start="{" data-end="}">
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a57eb97a5eba99a846ac429795e407574"> 115</a></span><span class="keyword">inline</span> std::ostream&amp; <a class="code hl_function" href="group__ops.html#gad656c30f9fd7d9467e405657b325aa7e">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1___m_l_x___float16.html">float16_t</a>&amp; v) {</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">return</span> os &lt;&lt; static_cast&lt;float&gt;(v);</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span>}</div>
</div>
<div class="foldopen" id="foldopen00118" data-start="{" data-end="}">
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a7db909d54cf07375e89424c32c07a29c"> 118</a></span><span class="keyword">inline</span> std::ostream&amp; <a class="code hl_function" href="group__ops.html#gad656c30f9fd7d9467e405657b325aa7e">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1___m_l_x___b_float16.html">bfloat16_t</a>&amp; v) {</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">return</span> os &lt;&lt; static_cast&lt;float&gt;(v);</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span>}</div>
</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span>} <span class="comment">// namespace mlx::core</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="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_ae29e7d6fbfbea1e5e321a8d1ea3cfacd"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">mlx::core::array::dtype</a></div><div class="ttdeci">Dtype dtype() const</div><div class="ttdoc">Get the arrays data type.</div><div class="ttdef"><b>Definition</b> array.h:127</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="adtype_8h_html"><div class="ttname"><a href="dtype_8h.html">dtype.h</a></div></div>
<div class="ttc" id="agroup__ops_html_ga7fed87d96cc7741d8267f4eac83f5fe7"><div class="ttname"><a href="group__ops.html#ga7fed87d96cc7741d8267f4eac83f5fe7">mlx::core::max</a></div><div class="ttdeci">array max(const array &amp;a, bool keepdims, StreamOrDevice s={})</div><div class="ttdoc">The maximum of all elements of the array.</div></div>
<div class="ttc" id="agroup__ops_html_gab27599802617a4c8f9964ab5f4ffee12"><div class="ttname"><a href="group__ops.html#gab27599802617a4c8f9964ab5f4ffee12">mlx::core::min</a></div><div class="ttdeci">array min(const array &amp;a, bool keepdims, StreamOrDevice s={})</div><div class="ttdoc">The minimum of all elements of the array.</div></div>
<div class="ttc" id="agroup__ops_html_gad656c30f9fd7d9467e405657b325aa7e"><div class="ttname"><a href="group__ops.html#gad656c30f9fd7d9467e405657b325aa7e">mlx::core::operator&lt;&lt;</a></div><div class="ttdeci">array operator&lt;&lt;(const array &amp;a, const array &amp;b)</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_a0181b5d72bf3d34448dabc70f7ff858d"><div class="ttname"><a href="namespacemlx_1_1core.html#a0181b5d72bf3d34448dabc70f7ff858d">mlx::core::normalize_axis</a></div><div class="ttdeci">int normalize_axis(int axis, int ndim)</div><div class="ttdoc">Returns the axis normalized to be in the range [0, ndim).</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a0196171cfe6ee2953113abce597dc815"><div class="ttname"><a href="namespacemlx_1_1core.html#a0196171cfe6ee2953113abce597dc815">mlx::core::default_device</a></div><div class="ttdeci">const Device &amp; default_device()</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a075e07def338cd9d815182d0e6a656c0"><div class="ttname"><a href="namespacemlx_1_1core.html#a075e07def338cd9d815182d0e6a656c0">mlx::core::broadcast_shapes</a></div><div class="ttdeci">std::vector&lt; int &gt; broadcast_shapes(const std::vector&lt; int &gt; &amp;s1, const std::vector&lt; int &gt; &amp;s2)</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a312a2de41367fe52caeaf8c0f596a120"><div class="ttname"><a href="namespacemlx_1_1core.html#a312a2de41367fe52caeaf8c0f596a120">mlx::core::set_default_device</a></div><div class="ttdeci">void set_default_device(const Device &amp;d)</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a4734a596e57434492ddfe79f2cb9dbf9"><div class="ttname"><a href="namespacemlx_1_1core.html#a4734a596e57434492ddfe79f2cb9dbf9">mlx::core::to_stream</a></div><div class="ttdeci">Stream to_stream(StreamOrDevice s)</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a505922e54acd43114308e3bdbda0e497"><div class="ttname"><a href="namespacemlx_1_1core.html#a505922e54acd43114308e3bdbda0e497">mlx::core::promote_types</a></div><div class="ttdeci">Dtype promote_types(const Dtype &amp;t1, const Dtype &amp;t2)</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a625ed440df3fa57318017c1f2c589efe"><div class="ttname"><a href="namespacemlx_1_1core.html#a625ed440df3fa57318017c1f2c589efe">mlx::core::is_big_endian</a></div><div class="ttdeci">bool is_big_endian()</div><div class="ttdef"><b>Definition</b> utils.h:87</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a8b5f1435b7628a094a38b62e403e1540"><div class="ttname"><a href="namespacemlx_1_1core.html#a8b5f1435b7628a094a38b62e403e1540">mlx::core::check_shape_dim</a></div><div class="ttdeci">int check_shape_dim(const T dim)</div><div class="ttdoc">Returns the shape dimension if it's within allowed range.</div><div class="ttdef"><b>Definition</b> utils.h:73</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a8b984eef832f757e28cd262d64a49ae7"><div class="ttname"><a href="namespacemlx_1_1core.html#a8b984eef832f757e28cd262d64a49ae7">mlx::core::result_type</a></div><div class="ttdeci">Dtype result_type(const array &amp;a, const array &amp;b)</div><div class="ttdoc">The type from promoting the arrays' types with one another.</div><div class="ttdef"><b>Definition</b> utils.h:57</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a95fc1013cc48fbfee0c54310711a5e58"><div class="ttname"><a href="namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58">mlx::core::StreamOrDevice</a></div><div class="ttdeci">std::variant&lt; std::monostate, Stream, Device &gt; StreamOrDevice</div><div class="ttdef"><b>Definition</b> utils.h:14</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_ad4b664de4a4abd305827b30879b9da33"><div class="ttname"><a href="namespacemlx_1_1core.html#ad4b664de4a4abd305827b30879b9da33">mlx::core::is_same_shape</a></div><div class="ttdeci">bool is_same_shape(const std::vector&lt; array &gt; &amp;arrays)</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="anamespacemlx_1_1core_html_af5a408a78cc934717dd711ddfda58ea6"><div class="ttname"><a href="namespacemlx_1_1core.html#af5a408a78cc934717dd711ddfda58ea6">mlx::core::global_formatter</a></div><div class="ttdeci">PrintFormatter global_formatter</div></div>
<div class="ttc" id="astream_8h_html"><div class="ttname"><a href="stream_8h.html">stream.h</a></div></div>
<div class="ttc" id="astructmlx_1_1core_1_1___m_l_x___b_float16_html"><div class="ttname"><a href="structmlx_1_1core_1_1___m_l_x___b_float16.html">mlx::core::_MLX_BFloat16</a></div><div class="ttdef"><b>Definition</b> bf16.h:21</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1___m_l_x___float16_html"><div class="ttname"><a href="structmlx_1_1core_1_1___m_l_x___float16.html">mlx::core::_MLX_Float16</a></div><div class="ttdef"><b>Definition</b> fp16.h:21</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_dtype_html"><div class="ttname"><a href="structmlx_1_1core_1_1_dtype.html">mlx::core::Dtype</a></div><div class="ttdef"><b>Definition</b> dtype.h:15</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_dtype_html_adb1ea8b45a0c53e04a0e73b168702715"><div class="ttname"><a href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715">mlx::core::Dtype::Kind</a></div><div class="ttdeci">Kind</div><div class="ttdef"><b>Definition</b> dtype.h:32</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html">mlx::core::PrintFormatter</a></div><div class="ttdef"><b>Definition</b> utils.h:38</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html_a520adb07fafd911b22bc24b295e4f6cf"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html#a520adb07fafd911b22bc24b295e4f6cf">mlx::core::PrintFormatter::print</a></div><div class="ttdeci">void print(std::ostream &amp;os, uint32_t val)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html_a57af5c32561b95d6ac2a3a1dc4f5d43e"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html#a57af5c32561b95d6ac2a3a1dc4f5d43e">mlx::core::PrintFormatter::print</a></div><div class="ttdeci">void print(std::ostream &amp;os, float val)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html_a79fad4cf5844db8c92b066539146281b"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html#a79fad4cf5844db8c92b066539146281b">mlx::core::PrintFormatter::print</a></div><div class="ttdeci">void print(std::ostream &amp;os, bool val)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html_a8da448a8adae671b26359341ea514316"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html#a8da448a8adae671b26359341ea514316">mlx::core::PrintFormatter::print</a></div><div class="ttdeci">void print(std::ostream &amp;os, int16_t val)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html_a9d750c134a6fbfa8251c5b1d01d73287"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html#a9d750c134a6fbfa8251c5b1d01d73287">mlx::core::PrintFormatter::print</a></div><div class="ttdeci">void print(std::ostream &amp;os, uint16_t val)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html_a9e1dc67c9afb0a09966336504790823d"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html#a9e1dc67c9afb0a09966336504790823d">mlx::core::PrintFormatter::print</a></div><div class="ttdeci">void print(std::ostream &amp;os, complex64_t val)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html_ab0c702f1ae201e17cd328c9855cf522e"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html#ab0c702f1ae201e17cd328c9855cf522e">mlx::core::PrintFormatter::print</a></div><div class="ttdeci">void print(std::ostream &amp;os, int64_t val)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html_ac4b7895d1168cfc1a3d1186d8a414d2f"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html#ac4b7895d1168cfc1a3d1186d8a414d2f">mlx::core::PrintFormatter::print</a></div><div class="ttdeci">void print(std::ostream &amp;os, float16_t val)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html_ac59a5137ddd8b32aae057bb9826ee80d"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html#ac59a5137ddd8b32aae057bb9826ee80d">mlx::core::PrintFormatter::print</a></div><div class="ttdeci">void print(std::ostream &amp;os, uint64_t val)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html_adbbb9cbff767f9db73c659a0c07ba633"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html#adbbb9cbff767f9db73c659a0c07ba633">mlx::core::PrintFormatter::print</a></div><div class="ttdeci">void print(std::ostream &amp;os, int32_t val)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html_adf49a949db36f0ba076842a6d675d79a"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html#adf49a949db36f0ba076842a6d675d79a">mlx::core::PrintFormatter::capitalize_bool</a></div><div class="ttdeci">bool capitalize_bool</div><div class="ttdef"><b>Definition</b> utils.h:51</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_print_formatter_html_ae21005f92bc641f2d657096f5d176a6d"><div class="ttname"><a href="structmlx_1_1core_1_1_print_formatter.html#ae21005f92bc641f2d657096f5d176a6d">mlx::core::PrintFormatter::print</a></div><div class="ttdeci">void print(std::ostream &amp;os, bfloat16_t val)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_stream_context_html"><div class="ttname"><a href="structmlx_1_1core_1_1_stream_context.html">mlx::core::StreamContext</a></div><div class="ttdef"><b>Definition</b> utils.h:17</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_stream_context_html_a89d803151e9d7dce29382aa83d5c6ef1"><div class="ttname"><a href="structmlx_1_1core_1_1_stream_context.html#a89d803151e9d7dce29382aa83d5c6ef1">mlx::core::StreamContext::StreamContext</a></div><div class="ttdeci">StreamContext(StreamOrDevice s)</div><div class="ttdef"><b>Definition</b> utils.h:19</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_stream_context_html_ac5be1c576d22b3d0b0a6fcc7e6abe659"><div class="ttname"><a href="structmlx_1_1core_1_1_stream_context.html#ac5be1c576d22b3d0b0a6fcc7e6abe659">mlx::core::StreamContext::~StreamContext</a></div><div class="ttdeci">~StreamContext()</div><div class="ttdef"><b>Definition</b> utils.h:29</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_1complex64__t_html"><div class="ttname"><a href="structmlx_1_1core_1_1complex64__t.html">mlx::core::complex64_t</a></div><div class="ttdef"><b>Definition</b> complex.h:34</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>