mlx/docs/build/html/integral__constant_8h_source.html

213 lines
26 KiB
HTML
Raw Normal View History

2024-10-31 11:00:19 +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.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/steel/utils/integral_constant.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="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>
<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.12.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">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @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',false);
$(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(){ initResizable(false); });
/* @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><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li><li class="navelem"><a class="el" href="dir_76215a6c54e2b67053e723fc2395583c.html">steel</a></li><li class="navelem"><a class="el" href="dir_1b634d20b746ceaa770a5379eca5f24a.html">utils</a></li> </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
<div class="headertitle"><div class="title">integral_constant.h</div></div>
</div><!--header-->
<div class="contents">
<a href="integral__constant_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 © 2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;metal_stdlib&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &quot;<a class="code" href="type__traits_8h.html">mlx/backend/metal/kernels/steel/utils/type_traits.h</a>&quot;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#pragma METAL internals : enable</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemlx.html">mlx</a> {</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">namespace </span>steel {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// Integral constant with casting</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, T v&gt;</div>
<div class="foldopen" id="foldopen00018" data-start="{" data-end="};">
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1integral__constant.html"> 18</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">integral_constant</a> {</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1integral__constant.html#a4efa69cb3fd42ac0dcad46578600d637"> 19</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant T <a class="code hl_variable" href="structmlx_1_1steel_1_1integral__constant.html#a4efa69cb3fd42ac0dcad46578600d637">value</a> = v;</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1integral__constant.html#a0569cc1334e0bc4f474304b33d365759"> 20</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="structmlx_1_1steel_1_1integral__constant.html#a0569cc1334e0bc4f474304b33d365759">value_type</a> = T;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1integral__constant.html#a6492c15b37d160d3a33e1cbe770aa3f1"> 21</a></span> <span class="keyword">using </span><a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">type</a> = <a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">integral_constant</a>;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="foldopen" id="foldopen00023" data-start="{" data-end="}">
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1integral__constant.html#a0c11203bed44a6a2c387b365134dcd64"> 23</a></span> METAL_FUNC <span class="keyword">constexpr</span> <span class="keyword">operator</span> <a class="code hl_typedef" href="structmlx_1_1steel_1_1integral__constant.html#a0569cc1334e0bc4f474304b33d365759">value_type</a>() const noexcept {</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="structmlx_1_1steel_1_1integral__constant.html#a4efa69cb3fd42ac0dcad46578600d637">value</a>;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> }</div>
</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="comment">// METAL_FUNC constexpr value_type operator()() const noexcept {</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="comment">// return value;</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="comment">// }</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span>};</div>
</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><span class="keyword">template</span> &lt;<span class="keywordtype">bool</span> B&gt;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#adbb34bcf0d2dca6b9fb803d591d00da9"> 33</a></span><span class="keyword">using </span><a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">bool_constant</a> = <a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">integral_constant&lt;bool, B&gt;</a>;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#a594a6ccb75b38b5ae4ddd0d9ad047b3a"> 34</a></span><span class="keyword">using </span><a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">true_type</a> = <a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">bool_constant&lt;true&gt;</a>;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#ab0ef721cedc2b5a97f60d76b765aff2e"> 35</a></span><span class="keyword">using </span><a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">false_type</a> = <a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">bool_constant&lt;false&gt;</a>;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1is__integral.html"> 38</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1steel_1_1is__integral.html">is_integral</a> : <a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">bool_constant</a>&lt;metal::is_integral&lt;T&gt;::value&gt; {};</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="keyword">template</span> &lt;<span class="keyword">class</span> T, T v&gt;</div>
<div class="foldopen" id="foldopen00041" data-start="{" data-end="};">
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1is__integral_3_01integral__constant_3_01_t_00_01v_01_4_01_4.html"> 41</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1steel_1_1is__integral.html">is_integral</a>&lt;<a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">integral_constant</a>&lt;T, v&gt;&gt;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> : <a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">bool_constant</a>&lt;metal::is_integral&lt;T&gt;::value&gt; {};</div>
</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#a92a3465716ea7fd682d22cecc08d45fd"> 45</a></span><span class="keyword">constexpr</span> constant <span class="keywordtype">bool</span> <a class="code hl_variable" href="namespacemlx_1_1steel.html#a92a3465716ea7fd682d22cecc08d45fd">is_integral_v</a> = <a class="code hl_struct" href="structmlx_1_1steel_1_1is__integral.html">is_integral&lt;T&gt;::value</a>;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="keyword">template</span> &lt;<span class="keywordtype">int</span> val&gt;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#afe36ddf6725498d273e5eef4f1579891"> 48</a></span><span class="keyword">using </span><a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">Int</a> = <a class="code hl_struct" href="structmlx_1_1steel_1_1integral__constant.html">integral_constant&lt;int, val&gt;</a>;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment">// Binary Operators on Integral constants</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="foldopen" id="foldopen00054" data-start="" data-end="">
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6"> 54</a></span><span class="preprocessor">#define integral_const_binop(__op__, __operator__) \</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="preprocessor"> template &lt;typename T, T tv, typename U, U uv&gt; \</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="preprocessor"> METAL_FUNC constexpr auto __operator__( \</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="preprocessor"> integral_constant&lt;T, tv&gt;, integral_constant&lt;U, uv&gt;) { \</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="preprocessor"> constexpr auto res = tv __op__ uv; \</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="preprocessor"> return integral_constant&lt;decltype(res), res&gt;{}; \</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="preprocessor"> }</span></div>
</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#a12ff4f38aa8474bf76770c7b8e3e18cb"> 62</a></span><a class="code hl_define" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a>(+, <span class="keyword">operator</span>+);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#aca8ef21c16984ccb329b3bd0c1e4be48"> 63</a></span><a class="code hl_define" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a>(-, <span class="keyword">operator</span>-);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#aa0c2d29950926ae579adf6337fbea64b"> 64</a></span><a class="code hl_define" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a>(*, <span class="keyword">operator</span>*);</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#a6bde717aca2051499f73a3eee199bfdd"> 65</a></span><a class="code hl_define" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a>(/, <span class="keyword">operator</span>/);</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> </div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#abcc797f27e87e857b41c1a8d33ee2c78"> 67</a></span><a class="code hl_define" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a>(==, <span class="keyword">operator</span>==);</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#aa4364eda56525cf7576ff00e550175e6"> 68</a></span><a class="code hl_define" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a>(!=, <span class="keyword">operator</span>!=);</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#adb5f24b57d98214fc215a06475f21412"> 69</a></span><a class="code hl_define" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a>(&lt;, <span class="keyword">operator</span>&lt;);</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#a7512eadda6160e4c9d9e6aa4049fac20"> 70</a></span><a class="code hl_define" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a>(&gt;, <span class="keyword">operator</span>&gt;);</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#a6cc3bab5e7f6e7c719c82afa90ad2827"> 71</a></span><a class="code hl_define" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a>(&lt;=, <span class="keyword">operator</span>&lt;=);</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#aa3c95c60cf69603705bb4636de547bcb"> 72</a></span><a class="code hl_define" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a>(&gt;=, <span class="keyword">operator</span>&gt;=);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> </div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#a6353bf11881842e25c46b56f92b7044f"> 74</a></span><a class="code hl_define" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a>(&amp;&amp;, <span class="keyword">operator</span>&amp;&amp;);</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#a1bb3ac5061a04e407fc4cdcc9f6ea03f"> 75</a></span><a class="code hl_define" href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a>(||, <span class="keyword">operator</span>||);</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="preprocessor">#undef integral_const_binop</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="comment">// Reduction operators</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><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00084" data-start="{" data-end="}">
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#ab4a6ddea4beb7c447cf5b69b9d46cc3b"> 84</a></span>METAL_FUNC <span class="keyword">constexpr</span> T <a class="code hl_function" href="namespacemlx_1_1steel.html#ab4a6ddea4beb7c447cf5b69b9d46cc3b">sum</a>(T x) {</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">return</span> x;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span>}</div>
</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span>... Us&gt;</div>
<div class="foldopen" id="foldopen00089" data-start="{" data-end="}">
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="namespacemlx_1_1steel.html#acd6e194d37b617d7a5818bc384a97fe4"> 89</a></span>METAL_FUNC <span class="keyword">constexpr</span> <span class="keyword">auto</span> <a class="code hl_function" href="namespacemlx_1_1steel.html#ab4a6ddea4beb7c447cf5b69b9d46cc3b">sum</a>(T x, Us... us) {</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">return</span> x + <a class="code hl_function" href="namespacemlx_1_1steel.html#ab4a6ddea4beb7c447cf5b69b9d46cc3b">sum</a>(us...);</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span>}</div>
</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span>} <span class="comment">// namespace steel</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span>} <span class="comment">// namespace mlx</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="preprocessor">#pragma METAL internals : disable</span></div>
<div class="ttc" id="aintegral__constant_8h_html_ab28d2705f6fd4f54faccbb78fd5ddfb6"><div class="ttname"><a href="integral__constant_8h.html#ab28d2705f6fd4f54faccbb78fd5ddfb6">integral_const_binop</a></div><div class="ttdeci">#define integral_const_binop(__op__, __operator__)</div><div class="ttdef"><b>Definition</b> integral_constant.h:54</div></div>
<div class="ttc" id="anamespacemlx_1_1steel_html_a92a3465716ea7fd682d22cecc08d45fd"><div class="ttname"><a href="namespacemlx_1_1steel.html#a92a3465716ea7fd682d22cecc08d45fd">mlx::steel::is_integral_v</a></div><div class="ttdeci">constexpr constant bool is_integral_v</div><div class="ttdef"><b>Definition</b> integral_constant.h:45</div></div>
<div class="ttc" id="anamespacemlx_1_1steel_html_ab4a6ddea4beb7c447cf5b69b9d46cc3b"><div class="ttname"><a href="namespacemlx_1_1steel.html#ab4a6ddea4beb7c447cf5b69b9d46cc3b">mlx::steel::sum</a></div><div class="ttdeci">METAL_FUNC constexpr T sum(T x)</div><div class="ttdef"><b>Definition</b> integral_constant.h:84</div></div>
<div class="ttc" id="anamespacemlx_html"><div class="ttname"><a href="namespacemlx.html">mlx</a></div><div class="ttdef"><b>Definition</b> allocator.h:7</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1integral__constant_html"><div class="ttname"><a href="structmlx_1_1steel_1_1integral__constant.html">mlx::steel::integral_constant</a></div><div class="ttdef"><b>Definition</b> integral_constant.h:18</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1integral__constant_html_a0569cc1334e0bc4f474304b33d365759"><div class="ttname"><a href="structmlx_1_1steel_1_1integral__constant.html#a0569cc1334e0bc4f474304b33d365759">mlx::steel::integral_constant::value_type</a></div><div class="ttdeci">T value_type</div><div class="ttdef"><b>Definition</b> integral_constant.h:20</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1integral__constant_html_a4efa69cb3fd42ac0dcad46578600d637"><div class="ttname"><a href="structmlx_1_1steel_1_1integral__constant.html#a4efa69cb3fd42ac0dcad46578600d637">mlx::steel::integral_constant::value</a></div><div class="ttdeci">static constexpr constant T value</div><div class="ttdef"><b>Definition</b> integral_constant.h:19</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1is__integral_html"><div class="ttname"><a href="structmlx_1_1steel_1_1is__integral.html">mlx::steel::is_integral</a></div><div class="ttdef"><b>Definition</b> integral_constant.h:38</div></div>
<div class="ttc" id="atype__traits_8h_html"><div class="ttname"><a href="type__traits_8h.html">type_traits.h</a></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.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>