This commit is contained in:
CircleCI Docs
2025-02-06 20:16:29 +00:00
parent 231caa94a6
commit 3bac79c1d6
2299 changed files with 64934 additions and 28640 deletions

View File

@@ -3,7 +3,7 @@
<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="generator" content="Doxygen 1.13.2"/>
<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"/>
@@ -52,7 +52,7 @@
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.1 -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
@@ -256,10 +256,17 @@ $(function(){initNavTree('utils_8h_source.html',''); initResizable(true); });
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span>}</div>
</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> </div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span>} <span class="comment">// namespace env</span></div>
<div class="foldopen" id="foldopen00129" data-start="{" data-end="}">
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1env.html#afa1ecf087fe0c633d5460ddb2c31c945"> 129</a></span><span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemlx_1_1core_1_1env.html#afa1ecf087fe0c633d5460ddb2c31c945">metal_fast_synch</a>() {</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemlx_1_1core_1_1env.html#afa1ecf087fe0c633d5460ddb2c31c945">metal_fast_synch</a> = <a class="code hl_function" href="namespacemlx_1_1core_1_1env.html#a0efecbf9efe695adafad12b5a4945df3">get_var</a>(<span class="stringliteral">&quot;MLX_METAL_FAST_SYNCH&quot;</span>, 0);</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemlx_1_1core_1_1env.html#afa1ecf087fe0c633d5460ddb2c31c945">metal_fast_synch</a>;</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span>}</div>
</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> </div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span>} <span class="comment">// namespace mlx::core</span></div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> </div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span>} <span class="comment">// namespace env</span></div>
</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"> 136</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:24</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:131</div></div>
@@ -270,6 +277,7 @@ $(function(){initNavTree('utils_8h_source.html',''); initResizable(true); });
<div class="ttc" id="anamespacemlx_1_1core_1_1env_html_a0efecbf9efe695adafad12b5a4945df3"><div class="ttname"><a href="namespacemlx_1_1core_1_1env.html#a0efecbf9efe695adafad12b5a4945df3">mlx::core::env::get_var</a></div><div class="ttdeci">int get_var(const char *name, int default_value)</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1env_html_ac3266e1259a64c8b56bdc6c7029179f2"><div class="ttname"><a href="namespacemlx_1_1core_1_1env.html#ac3266e1259a64c8b56bdc6c7029179f2">mlx::core::env::bfs_max_width</a></div><div class="ttdeci">int bfs_max_width()</div><div class="ttdef"><b>Definition</b> utils.h:119</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1env_html_aedbf4e739553024c33dd0094dd9107aa"><div class="ttname"><a href="namespacemlx_1_1core_1_1env.html#aedbf4e739553024c33dd0094dd9107aa">mlx::core::env::max_ops_per_buffer</a></div><div class="ttdeci">int max_ops_per_buffer()</div><div class="ttdef"><b>Definition</b> utils.h:124</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1env_html_afa1ecf087fe0c633d5460ddb2c31c945"><div class="ttname"><a href="namespacemlx_1_1core_1_1env.html#afa1ecf087fe0c633d5460ddb2c31c945">mlx::core::env::metal_fast_synch</a></div><div class="ttdeci">bool metal_fast_synch()</div><div class="ttdef"><b>Definition</b> utils.h:129</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_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_a1cc130b06d9cdd03dddc74a3b1db0167"><div class="ttname"><a href="namespacemlx_1_1core.html#a1cc130b06d9cdd03dddc74a3b1db0167">mlx::core::normalize_axis_index</a></div><div class="ttdeci">int normalize_axis_index(int axis, int ndim, const std::string &amp;msg_prefix=&quot;&quot;)</div><div class="ttdoc">Returns the axis normalized to be in the range [0, ndim).</div></div>
@@ -281,12 +289,12 @@ $(function(){initNavTree('utils_8h_source.html',''); initResizable(true); });
<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&#39; types with one another.</div><div class="ttdef"><b>Definition</b> utils.h:69</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:15</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_acb5d16c9b83778c7621c38e522e0060b"><div class="ttname"><a href="namespacemlx_1_1core.html#acb5d16c9b83778c7621c38e522e0060b">mlx::core::bfloat16_t</a></div><div class="ttdeci">struct _MLX_BFloat16 bfloat16_t</div><div class="ttdef"><b>Definition</b> half_types.h:32</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_acb5d16c9b83778c7621c38e522e0060b"><div class="ttname"><a href="namespacemlx_1_1core.html#acb5d16c9b83778c7621c38e522e0060b">mlx::core::bfloat16_t</a></div><div class="ttdeci">struct _MLX_BFloat16 bfloat16_t</div><div class="ttdef"><b>Definition</b> half_types.h:34</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_adacbc4526e8964b267a8ec3eb1bc1a32"><div class="ttname"><a href="namespacemlx_1_1core.html#adacbc4526e8964b267a8ec3eb1bc1a32">mlx::core::is_power_of_2</a></div><div class="ttdeci">bool is_power_of_2(int n)</div><div class="ttdef"><b>Definition</b> utils.h:104</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_ae1b6e5cfd27b1526285648686898e011"><div class="ttname"><a href="namespacemlx_1_1core.html#ae1b6e5cfd27b1526285648686898e011">mlx::core::abort_with_exception</a></div><div class="ttdeci">void abort_with_exception(const std::exception &amp;error)</div><div class="ttdoc">Print the exception and then abort.</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_aefa6a2ec6439e9619cafd227a1dc14ab"><div class="ttname"><a href="namespacemlx_1_1core.html#aefa6a2ec6439e9619cafd227a1dc14ab">mlx::core::broadcast_shapes</a></div><div class="ttdeci">Shape broadcast_shapes(const Shape &amp;s1, const Shape &amp;s2)</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_afbd2769c30e721afc85a7b9fb55b8e52"><div class="ttname"><a href="namespacemlx_1_1core.html#afbd2769c30e721afc85a7b9fb55b8e52">mlx::core::float16_t</a></div><div class="ttdeci">struct _MLX_Float16 float16_t</div><div class="ttdef"><b>Definition</b> half_types.h:16</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_afbd2769c30e721afc85a7b9fb55b8e52"><div class="ttname"><a href="namespacemlx_1_1core.html#afbd2769c30e721afc85a7b9fb55b8e52">mlx::core::float16_t</a></div><div class="ttdeci">struct _MLX_Float16 float16_t</div><div class="ttdef"><b>Definition</b> half_types.h:17</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_afc71e62dc5757564486cea5ebb12500e"><div class="ttname"><a href="namespacemlx_1_1core.html#afc71e62dc5757564486cea5ebb12500e">mlx::core::get_global_formatter</a></div><div class="ttdeci">PrintFormatter &amp; get_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_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>
@@ -308,7 +316,7 @@ $(function(){initNavTree('utils_8h_source.html',''); initResizable(true); });
<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:20</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:30</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_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 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:35</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1finfo_html_a00dee158d75d12768d02a3e7b6709109"><div class="ttname"><a href="structmlx_1_1core_1_1finfo.html#a00dee158d75d12768d02a3e7b6709109">mlx::core::finfo::finfo</a></div><div class="ttdeci">finfo(Dtype dtype)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1finfo_html_a4edcbcfae55c1ef3cb8e61d427ac9124"><div class="ttname"><a href="structmlx_1_1core_1_1finfo.html#a4edcbcfae55c1ef3cb8e61d427ac9124">mlx::core::finfo::dtype</a></div><div class="ttdeci">Dtype dtype</div><div class="ttdef"><b>Definition</b> utils.h:63</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1finfo_html_a91332dcbb502799b6cc8e1c6933c042b"><div class="ttname"><a href="structmlx_1_1core_1_1finfo.html#a91332dcbb502799b6cc8e1c6933c042b">mlx::core::finfo::min</a></div><div class="ttdeci">float min</div><div class="ttdef"><b>Definition</b> utils.h:64</div></div>
@@ -319,7 +327,7 @@ $(function(){initNavTree('utils_8h_source.html',''); initResizable(true); });
<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="utils_8h.html">utils.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>
<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.2 </li>
</ul>
</div>
</body>