mlx/docs/build/html/base__simd_8h_source.html
CircleCI Docs c7080f89ca rebase
2025-06-04 01:01:55 +00:00

477 lines
90 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.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/cpu/simd/base_simd.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&amp;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()">&#160;</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.2 -->
<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>
</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&amp;dn=expat.txt MIT */
$(function(){initNavTree('base__simd_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">base_simd.h</div></div>
</div><!--header-->
<div class="contents">
<a href="base__simd_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="preprocessor">#pragma once</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">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include &lt;algorithm&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;cmath&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;complex&gt;</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="keyword">namespace </span><a class="code hl_namespace" href="namespacemlx_1_1core_1_1simd.html">mlx::core::simd</a> {</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, <span class="keywordtype">int</span> N&gt;</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a>;</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">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ac91bd36c7caafd3c7ff176e7e2f81887"> 13</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="namespacemlx_1_1core_1_1simd.html#ac91bd36c7caafd3c7ff176e7e2f81887">max_size</a> = 1;</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00016" data-start="{" data-end="};">
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html"> 16</a></span><span class="keyword">struct </span><a class="code hl_function" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#a3f6e4a83ecf897465f44160b6fad5a7a">Simd</a>&lt;T, 1&gt; {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#a14e16c6e2ef5e89135cf8e85dc9f1f1f"> 17</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#a14e16c6e2ef5e89135cf8e85dc9f1f1f">size</a> = 1;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#ac348445fd44bce2b6ee77adeac7d82df"> 18</a></span> T <a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#ac348445fd44bce2b6ee77adeac7d82df">value</a>;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#a3f6e4a83ecf897465f44160b6fad5a7a"> 19</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#a3f6e4a83ecf897465f44160b6fad5a7a">Simd</a>() {}</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#a585bc4768c4f7e1313d7e8756fbb00cc"> 21</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#a585bc4768c4f7e1313d7e8756fbb00cc">Simd</a>(<a class="code hl_function" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#a3f6e4a83ecf897465f44160b6fad5a7a">Simd&lt;U, 1&gt;</a> v) : <a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#ac348445fd44bce2b6ee77adeac7d82df">value</a>(v.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#ac348445fd44bce2b6ee77adeac7d82df">value</a>) {}</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#acf948f7c5e8829432c0ac17fc9f911e2"> 23</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#acf948f7c5e8829432c0ac17fc9f911e2">Simd</a>(U v) : <a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#ac348445fd44bce2b6ee77adeac7d82df">value</a>(v) {}</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span>};</div>
</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, <span class="keywordtype">int</span> N&gt;</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_1_1simd.html#a4041676517d96870293e5448c7e2b5a4"> 27</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, N&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a4041676517d96870293e5448c7e2b5a4">load</a>(<span class="keyword">const</span> T* x) {</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">return</span> *(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, N&gt;</a>*)x;</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="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, <span class="keywordtype">int</span> N&gt;</div>
<div class="foldopen" id="foldopen00032" data-start="{" data-end="}">
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#afa2236afddfdec312eb7e27b89a5316a"> 32</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#afa2236afddfdec312eb7e27b89a5316a">store</a>(T* dst, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, N&gt;</a> x) {</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="comment">// Maintain invariant that bool is either 0 or 1 as</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="comment">// simd comparison ops set all bits in the result to 1</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (std::is_same_v&lt;T, bool&gt; &amp;&amp; <a class="code hl_variable" href="namespacemlx_1_1core_1_1simd.html#a12b1553495a0c99d52472bd2a6626ddb">N</a> &gt; 1) {</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> x = x &amp; 1;</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> *(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, N&gt;</a>*)dst = x;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span>}</div>
</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="keyword">template</span> &lt;<span class="keyword">typename</span>, <span class="keyword">typename</span> = <span class="keywordtype">void</span>&gt;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a64e80f096a8baf99ba8d396414473cc7"> 42</a></span><span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="namespacemlx_1_1core_1_1simd.html#a64e80f096a8baf99ba8d396414473cc7">is_complex</a> = <span class="keyword">false</span>;</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_1core_1_1simd.html#a29fe8445e54a61f6bccc8d50f142ca54"> 45</a></span><span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="namespacemlx_1_1core_1_1simd.html#a64e80f096a8baf99ba8d396414473cc7">is_complex&lt;T, std::void_t&lt;decltype(std::declval&lt;T&gt;</a>().real())&gt;&gt; =</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00049" data-start="{" data-end="}">
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a797196eccc3690aac5c45e5f9c804ceb"> 49</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a400d89d040f43d471b306a8e8bdb3974">rint</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> in) {</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (<a class="code hl_variable" href="namespacemlx_1_1core_1_1simd.html#a64e80f096a8baf99ba8d396414473cc7">is_complex&lt;T&gt;</a>) {</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a>{</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> T{std::rint(in.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>.real()), std::rint(in.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>.imag())}};</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a>{std::rint(in.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>)};</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> }</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span>}</div>
</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00059" data-start="{" data-end="}">
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a74ac0fd799967b0f303bfd26fc6a17cf"> 59</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#aea75ddf8c696efc2e5e924667ed48e70">rsqrt</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> in) {</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordflow">return</span> T(1.0) / <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#ae39b8e1d1fff94947406eeb8ec6e0414">sqrt</a>(in);</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span>}</div>
</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00064" data-start="{" data-end="}">
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#afc915aed256295475ac88fde3a736f1f"> 64</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#ae344abefc91c7d9c0a9506c868a84d61">recip</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> in) {</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> T(1.0) / in;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span>}</div>
</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
<div class="foldopen" id="foldopen00068" data-start="" data-end="">
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124"> 68</a></span><span class="preprocessor">#define DEFAULT_UNARY(name, op) \</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="preprocessor"> template &lt;typename T&gt; \</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="preprocessor"> Simd&lt;T, 1&gt; name(Simd&lt;T, 1&gt; in) { \</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="preprocessor"> return op(in.value); \</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="preprocessor"> }</span></div>
</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_1core_1_1simd.html#a70563bcd6c28802d11199812ffef38c8"> 74</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<span class="keyword">operator</span>-, std::negate{})</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#afaa6ce61de4d80a4b7e9b2ab7454fff4"> 75</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<span class="keyword">operator</span>!, std::logical_not{})</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a1958f026f26f313d17155ac87ea6eca3"> 76</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a4f3cc8b2493586e83fd65640df3b60ad">abs</a>, std::abs)</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a3d4f9d08d1902e3d62c6f63d39329dbd"> 77</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#ae623449dfa7aab3031aa2f14c1b10a2d">acos</a>, std::acos)</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a51071c8104494b5bd8097990da3bf943"> 78</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a4f8a64e7742fcd8f759f723a36a7c826">acosh</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a4f8a64e7742fcd8f759f723a36a7c826">acosh</a>)</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a75349994f899aecb68553c2247580163"> 79</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a9c7723fc49137394fa817136a7ffb50f">asin</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a9c7723fc49137394fa817136a7ffb50f">asin</a>)</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a9323e370f6740651ebfd51367985d0e2"> 80</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#aaa76bdf1db09261d84da51d394837f5d">asinh</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#aaa76bdf1db09261d84da51d394837f5d">asinh</a>)</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a421845a6f68f88c58f520d2c1fa15914"> 81</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#aa7550a1210e50c996d0db84034b8a22e">atan</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#aa7550a1210e50c996d0db84034b8a22e">atan</a>)</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a5ebae2e6cce1889513f15be3adb265ea"> 82</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a18d330fd2c7360b2890a722232ba35b7">atanh</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a18d330fd2c7360b2890a722232ba35b7">atanh</a>)</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a4e54bd4ceb51ec41b0f95ebabe558713"> 83</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#ae1d5460c58c507a0104d8dfa90343f12">ceil</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#ae1d5460c58c507a0104d8dfa90343f12">ceil</a>)</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a660b79a51fb439f4aba91e2aea276300"> 84</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a660b79a51fb439f4aba91e2aea276300">conj</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a660b79a51fb439f4aba91e2aea276300">conj</a>)</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ae1265896d855818d20f2de2a9ebb684a"> 85</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#aedc18b6fdb820cce9125c977c02833aa">cosh</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#aedc18b6fdb820cce9125c977c02833aa">cosh</a>)</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a8f73d1dac82177e0aeadaeda349c4f96"> 86</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a9407980793ecff5d5eb19c9a2cbda1eb">expm1</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a9407980793ecff5d5eb19c9a2cbda1eb">expm1</a>)</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#aa396efa6e9c94f4ac1f8381d5e07f069"> 87</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a8e22c484298d9af10b6604c835e52052">floor</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a8e22c484298d9af10b6604c835e52052">floor</a>)</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#abd09d3f5989558ce5156549a94d0fb04"> 88</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a8cec82f4fb15bfd31d7554c6c09ceed4">log</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a8cec82f4fb15bfd31d7554c6c09ceed4">log</a>)</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#af9eafa15692dec783860ddae3dd8c072"> 89</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a66426c28a4324b9f617b7018d9354ea1">log2</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a66426c28a4324b9f617b7018d9354ea1">log2</a>)</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#adf754ade6cc1dd0e0bae0e31c7b513a2"> 90</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a3cb6ea94836e999c07329b34c501ed85">log10</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a3cb6ea94836e999c07329b34c501ed85">log10</a>)</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a92fcc8037ddb767bff517814ab55c259"> 91</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#ad06680bbc041e76efe2dbff4e11b9a13">log1p</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#ad06680bbc041e76efe2dbff4e11b9a13">log1p</a>)</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a40879bf874309c0a5abef783aea2057d"> 92</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a09a2f3f2bc999c16babf3d8d90994d6e">sinh</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a09a2f3f2bc999c16babf3d8d90994d6e">sinh</a>)</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a2ba6c75c0821db3e9ac525a89b3ac859"> 93</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#ae39b8e1d1fff94947406eeb8ec6e0414">sqrt</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#ae39b8e1d1fff94947406eeb8ec6e0414">sqrt</a>)</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a5abc381a85fe8b0e9cb472f874704652"> 94</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a445ddc4ed928656df64d889942588cfd">tan</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a445ddc4ed928656df64d889942588cfd">tan</a>)</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ab80a7db8d99e3f4032e761c60216027d"> 95</a></span><a class="code hl_define" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#aa244fbe7456b653aa50a473108fd6a2b">tanh</a>, <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#aa244fbe7456b653aa50a473108fd6a2b">tanh</a>)</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span>template &lt;typename T&gt;</div>
<div class="foldopen" id="foldopen00098" data-start="{" data-end="}">
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#acdf822b7626bbab6a495552aea3457b5"> 98</a></span>auto <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#acdf822b7626bbab6a495552aea3457b5">real</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a>&lt;T, 1&gt; in) -&gt; <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a>&lt;decltype(<a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#acdf822b7626bbab6a495552aea3457b5">real</a>(in.value)), 1&gt; {</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keywordflow">return</span> std::real(in.value);</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span>}</div>
</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00102" data-start="{" data-end="}">
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a97c69b04852ccba242f1348fda17ca20"> 102</a></span><span class="keyword">auto</span> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a97c69b04852ccba242f1348fda17ca20">imag</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> in) -&gt; <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a>&lt;<span class="keyword">decltype</span>(std::imag(in.value)), 1&gt; {</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordflow">return</span> std::imag(in.value);</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span>}</div>
</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00106" data-start="{" data-end="}">
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ac1c6c9b8bc7f3cd32ae39fa84975194d"> 106</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;bool, 1&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a05f4422a037c3bef343fb11f71363b65">isnan</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> in) {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">return</span> std::isnan(in.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>);</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span>}</div>
</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
<div class="foldopen" id="foldopen00110" data-start="" data-end="">
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047"> 110</a></span><span class="preprocessor">#define DEFAULT_BINARY(OP) \</span></div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span><span class="preprocessor"> template &lt;typename T1, typename T2&gt; \</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="preprocessor"> auto operator OP(Simd&lt;T1, 1&gt; a, Simd&lt;T2, 1&gt; b) \</span></div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span><span class="preprocessor"> -&gt;Simd&lt;decltype(a.value OP b.value), 1&gt; { \</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="preprocessor"> return a.value OP b.value; \</span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span><span class="preprocessor"> template &lt;typename T1, typename T2&gt; \</span></div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span><span class="preprocessor"> auto operator OP(T1 a, Simd&lt;T2, 1&gt; b)-&gt;Simd&lt;decltype(a OP b.value), 1&gt; { \</span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span><span class="preprocessor"> return a OP b.value; \</span></div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span><span class="preprocessor"> template &lt;typename T1, typename T2&gt; \</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span><span class="preprocessor"> auto operator OP(Simd&lt;T1, 1&gt; a, T2 b)-&gt;Simd&lt;decltype(a.value OP b), 1&gt; { \</span></div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span><span class="preprocessor"> return a.value OP b; \</span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span><span class="preprocessor"> }</span></div>
</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a27dfc3843dbefbbebed5b7137bacbb59"> 125</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(+)</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ab1f7f553d3a9176a70404a29cad06619"> 126</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(-)</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ab6a73491bcb185cd91ae4db6b0f21e49"> 127</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(*)</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a1d45c3b97cecfff86a2e43ae1f7fa185"> 128</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(/)</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a33232e2342d5a3e542c9428924a25830"> 129</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(&lt;&lt;)</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a1108d186d57c2010c743d3f9297befc7"> 130</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(&gt;&gt;)</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a60805b5f57ddbbf74f700b54cd3fc4f8"> 131</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(|)</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a369178519e0e91fa936c0fd4aa9ee109"> 132</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(^)</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a3c42ac1dc74f6c0bb934dfa45986875b"> 133</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(&amp;)</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a82676bd32059d1172296f8074a841de6"> 134</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(&amp;&amp;)</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a7a1c3be1c37d41e450469f2e98cd9dde"> 135</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(||)</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> </div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span>template &lt;typename T&gt;</div>
<div class="foldopen" id="foldopen00138" data-start="{" data-end="}">
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a54c7f2f2b995eb767462b1228982967f"> 138</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a>&lt;T, 1&gt; <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#ac66bdf1a8e86a4d350c85037bc764da5">remainder</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a>&lt;T, 1&gt; a_, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a>&lt;T, 1&gt; b_) {</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> T a = a_.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>;</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> T b = b_.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>;</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> T r;</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (std::is_integral_v&lt;T&gt;) {</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> r = a % b;</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> r = std::remainder(a, b);</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> }</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (std::is_signed_v&lt;T&gt;) {</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keywordflow">if</span> (r != 0 &amp;&amp; (r &lt; 0 != b &lt; 0)) {</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> r += b;</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> }</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> }</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keywordflow">return</span> r;</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span>}</div>
</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> </div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00156" data-start="{" data-end="}">
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ab54ff0f073be504e8428912f8e21effd"> 156</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a7f7a298284e71ddbd2ba0bb6d98b0d16">maximum</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> a_, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> b_) {</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> T a = a_.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>;</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> T b = b_.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>;</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (!std::is_integral_v&lt;T&gt;) {</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="keywordflow">if</span> (std::isnan(a)) {</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="keywordflow">return</span> a;</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> }</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> }</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keywordflow">return</span> (a &gt; b) ? a : b;</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span>}</div>
</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> </div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00168" data-start="{" data-end="}">
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ac836568622a3e5957c275e115e2fcaf3"> 168</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a1996e77a8c3c24b1ba706113ed9028c4">minimum</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> a_, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> b_) {</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> T a = a_.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>;</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> T b = b_.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>;</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (!std::is_integral_v&lt;T&gt;) {</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keywordflow">if</span> (std::isnan(a)) {</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <span class="keywordflow">return</span> a;</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> }</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> }</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keywordflow">return</span> (a &lt; b) ? a : b;</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span>}</div>
</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> </div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00180" data-start="{" data-end="}">
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#afe3d50bc4a11061898aa57377fa9536d"> 180</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a19d535de1fc179cc39ec9643c9863cbc">pow</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> a, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> b) {</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> T base = a.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>;</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> T <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a835d71dd0bb2f9494a397d9939696ec2">exp</a> = b.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>;</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (!std::is_integral_v&lt;T&gt;) {</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keywordflow">return</span> std::pow(base, <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a835d71dd0bb2f9494a397d9939696ec2">exp</a>);</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> T res = 1;</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <span class="keywordflow">while</span> (<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a835d71dd0bb2f9494a397d9939696ec2">exp</a>) {</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a835d71dd0bb2f9494a397d9939696ec2">exp</a> &amp; 1) {</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> res *= base;</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> }</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a835d71dd0bb2f9494a397d9939696ec2">exp</a> &gt;&gt;= 1;</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> base *= base;</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> }</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="keywordflow">return</span> res;</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> }</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span>}</div>
</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> </div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00199" data-start="{" data-end="}">
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#af5e8e8230c7d7af8201a3aaa7f491a2d"> 199</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a23dba4ee3f0811b41c381733a6e6ff16">atan2</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> a, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> b) {</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keywordflow">return</span> std::atan2(a.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>, b.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>);</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span>}</div>
</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> </div>
<div class="foldopen" id="foldopen00203" data-start="" data-end="">
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"><a class="line" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366"> 203</a></span><span class="preprocessor">#define DEFAULT_COMPARISONS(OP) \</span></div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span><span class="preprocessor"> template &lt;typename T1, typename T2&gt; \</span></div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span><span class="preprocessor"> Simd&lt;bool, 1&gt; operator OP(Simd&lt;T1, 1&gt; a, Simd&lt;T2, 1&gt; b) { \</span></div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span><span class="preprocessor"> return a.value OP b.value; \</span></div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span><span class="preprocessor"> template &lt;typename T1, typename T2&gt; \</span></div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span><span class="preprocessor"> Simd&lt;bool, 1&gt; operator OP(T1 a, Simd&lt;T2, 1&gt; b) { \</span></div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span><span class="preprocessor"> return a OP b.value; \</span></div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span><span class="preprocessor"> template &lt;typename T1, typename T2&gt; \</span></div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span><span class="preprocessor"> Simd&lt;bool, 1&gt; operator OP(Simd&lt;T1, 1&gt; a, T2 b) { \</span></div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span><span class="preprocessor"> return a.value OP b; \</span></div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span><span class="preprocessor"> }</span></div>
</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> </div>
<div class="foldopen" id="foldopen00217" data-start="{" data-end="}">
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a23b59272b0760326844fffe20db9b3e2"> 217</a></span><a class="code hl_define" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a>(&gt;)</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span><a class="code hl_define" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a>(&lt;)</div>
</div>
<div class="foldopen" id="foldopen00219" data-start="{" data-end="}">
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#aec6783f79ca181d6782a810ffb267482"> 219</a></span><a class="code hl_define" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a>(&gt;=)</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span><a class="code hl_define" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a>(&lt;=)</div>
</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a7928482ed5d25932be80413c7239125c"> 221</a></span><a class="code hl_define" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a>(==)</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a757838b9d56e132e797a381d3bb0dc86"> 222</a></span><a class="code hl_define" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a>(!=)</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> </div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span>template &lt;typename MaskT, typename T&gt;</div>
<div class="foldopen" id="foldopen00225" data-start="{" data-end="}">
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a9e3e7b35d564c70de8fa0b6150570ed8"> 225</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a>&lt;T, 1&gt; <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#afb3bcbd8d8b34128cd0c8eb677a170ef">select</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a>&lt;MaskT, 1&gt; mask, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a>&lt;T, 1&gt; x, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a>&lt;T, 1&gt; y) {</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> <span class="keywordflow">return</span> mask.value ? x.value : y.value;</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span>}</div>
</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> </div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00230" data-start="{" data-end="}">
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a567c06bf988af03988478679055a6c45"> 230</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#ae4be4d88cd8eba7a8c1784fd53b86edb">clamp</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> v, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#acd4196d0c66204cfae70b064c305e146">min</a>, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a6fcea259041cecfd042d0c4e6afc4b8f">max</a>) {</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="keywordflow">return</span> std::clamp(v.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>, <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#acd4196d0c66204cfae70b064c305e146">min</a>.value, <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a6fcea259041cecfd042d0c4e6afc4b8f">max</a>.value);</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span>}</div>
</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> </div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> U&gt;</div>
<div class="foldopen" id="foldopen00235" data-start="{" data-end="}">
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a8aa81ebff4c26f21cae2253d885fd87a"> 235</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a9ddc7f119cc1dc04372ec1adcaf55f70">fma</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> x, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a> y, U z) {</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> <span class="keywordflow">return</span> std::fma(x.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>, y.<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd&lt;T, 1&gt;</a>(z).<a class="code hl_variable" href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">value</a>);</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span>}</div>
</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> </div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span><span class="comment">// Reductions</span></div>
<div class="foldopen" id="foldopen00240" data-start="" data-end="">
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"><a class="line" href="base__simd_8h.html#a0adf6d25084019eff671abc59031573e"> 240</a></span><span class="preprocessor">#define DEFAULT_REDUCTION(name, type) \</span></div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span><span class="preprocessor"> template &lt;typename T&gt; \</span></div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span><span class="preprocessor"> type name(Simd&lt;T, 1&gt; x) { \</span></div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span><span class="preprocessor"> return x.value; \</span></div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span><span class="preprocessor"> }</span></div>
</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> </div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a312ecd0ae1c38d32147cee71fd8539d7"> 246</a></span><a class="code hl_define" href="base__simd_8h.html#a0adf6d25084019eff671abc59031573e">DEFAULT_REDUCTION</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a6fcea259041cecfd042d0c4e6afc4b8f">max</a>, T)</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a96db878d780a8da6abad19ac772d08ca"> 247</a></span><a class="code hl_define" href="base__simd_8h.html#a0adf6d25084019eff671abc59031573e">DEFAULT_REDUCTION</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#acd4196d0c66204cfae70b064c305e146">min</a>, T)</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a96ce7d90b3b8b6dddab36ef5b49fffc2"> 248</a></span><a class="code hl_define" href="base__simd_8h.html#a0adf6d25084019eff671abc59031573e">DEFAULT_REDUCTION</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a53b547b886918dc13d4da88eeb8811d2">sum</a>, T)</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ac27cdc630e86b25ad607ca409de2b274"> 249</a></span><a class="code hl_define" href="base__simd_8h.html#a0adf6d25084019eff671abc59031573e">DEFAULT_REDUCTION</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a271cedfc48efc69db43813e8c424bf7c">prod</a>, T)</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ae3b138b4bbcee0ca70b58a3e2ebd818c"> 250</a></span><a class="code hl_define" href="base__simd_8h.html#a0adf6d25084019eff671abc59031573e">DEFAULT_REDUCTION</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a9d968537ad5ef18630f5afce8453b30e">any</a>, <span class="keywordtype">bool</span>)</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a4ba3690489c2bf861e22e1175255438c"> 251</a></span><a class="code hl_define" href="base__simd_8h.html#a0adf6d25084019eff671abc59031573e">DEFAULT_REDUCTION</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a5109118acb6766855878b9e8a56b156a">all</a>, <span class="keywordtype">bool</span>)</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> </div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span>} <span class="comment">// namespace mlx::core::simd</span></div>
<div class="ttc" id="abase__simd_8h_html_a0adf6d25084019eff671abc59031573e"><div class="ttname"><a href="base__simd_8h.html#a0adf6d25084019eff671abc59031573e">DEFAULT_REDUCTION</a></div><div class="ttdeci">#define DEFAULT_REDUCTION(name, type)</div><div class="ttdef"><b>Definition</b> base_simd.h:240</div></div>
<div class="ttc" id="abase__simd_8h_html_a122d6a2fa4dcfe78b221e52155419124"><div class="ttname"><a href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124">DEFAULT_UNARY</a></div><div class="ttdeci">#define DEFAULT_UNARY(name, op)</div><div class="ttdef"><b>Definition</b> base_simd.h:68</div></div>
<div class="ttc" id="abase__simd_8h_html_a1d01fad7230543d56f4facf17dcc4047"><div class="ttname"><a href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a></div><div class="ttdeci">#define DEFAULT_BINARY(OP)</div><div class="ttdef"><b>Definition</b> base_simd.h:110</div></div>
<div class="ttc" id="abase__simd_8h_html_af5153f51cdd18d56d1de24b5da9f4366"><div class="ttname"><a href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a></div><div class="ttdeci">#define DEFAULT_COMPARISONS(OP)</div><div class="ttdef"><b>Definition</b> base_simd.h:203</div></div>
<div class="ttc" id="agroup__ops_html_ga2a466024f8061febc0a64be557644cb0"><div class="ttname"><a href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">mlx::core::std</a></div><div class="ttdeci">array std(const array &amp;a, bool keepdims, int ddof=0, StreamOrDevice s={})</div><div class="ttdoc">Computes the standard deviation of the elements of an array.</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html">mlx::core::simd</a></div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:9</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a05f4422a037c3bef343fb11f71363b65"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a05f4422a037c3bef343fb11f71363b65">mlx::core::simd::isnan</a></div><div class="ttdeci">Simd&lt; bool, N &gt; isnan(Simd&lt; T, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:141</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a09a2f3f2bc999c16babf3d8d90994d6e"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a09a2f3f2bc999c16babf3d8d90994d6e">mlx::core::simd::sinh</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; sinh(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:41</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a12b1553495a0c99d52472bd2a6626ddb"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a12b1553495a0c99d52472bd2a6626ddb">mlx::core::simd::N</a></div><div class="ttdeci">constexpr int N</div><div class="ttdef"><b>Definition</b> neon_fp16_simd.h:9</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a18d330fd2c7360b2890a722232ba35b7"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a18d330fd2c7360b2890a722232ba35b7">mlx::core::simd::atanh</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; atanh(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:34</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a1996e77a8c3c24b1ba706113ed9028c4"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a1996e77a8c3c24b1ba706113ed9028c4">mlx::core::simd::minimum</a></div><div class="ttdeci">Simd&lt; T, N &gt; minimum(Simd&lt; T, N &gt; a, Simd&lt; T, N &gt; b)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:210</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a19d535de1fc179cc39ec9643c9863cbc"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a19d535de1fc179cc39ec9643c9863cbc">mlx::core::simd::pow</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; pow(Simd&lt; float16_t, N &gt; x, Simd&lt; float16_t, N &gt; y)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:54</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a23dba4ee3f0811b41c381733a6e6ff16"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a23dba4ee3f0811b41c381733a6e6ff16">mlx::core::simd::atan2</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; atan2(Simd&lt; float16_t, N &gt; x, Simd&lt; float16_t, N &gt; y)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:52</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a271cedfc48efc69db43813e8c424bf7c"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a271cedfc48efc69db43813e8c424bf7c">mlx::core::simd::prod</a></div><div class="ttdeci">T prod(Simd&lt; T, N &gt; x)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:292</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a3cb6ea94836e999c07329b34c501ed85"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a3cb6ea94836e999c07329b34c501ed85">mlx::core::simd::log10</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; log10(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:39</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a400d89d040f43d471b306a8e8bdb3974"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a400d89d040f43d471b306a8e8bdb3974">mlx::core::simd::rint</a></div><div class="ttdeci">Simd&lt; T, N &gt; rint(Simd&lt; T, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:127</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a4041676517d96870293e5448c7e2b5a4"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a4041676517d96870293e5448c7e2b5a4">mlx::core::simd::load</a></div><div class="ttdeci">Simd&lt; T, N &gt; load(const T *x)</div><div class="ttdef"><b>Definition</b> base_simd.h:27</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a445ddc4ed928656df64d889942588cfd"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a445ddc4ed928656df64d889942588cfd">mlx::core::simd::tan</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; tan(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:42</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a4f3cc8b2493586e83fd65640df3b60ad"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a4f3cc8b2493586e83fd65640df3b60ad">mlx::core::simd::abs</a></div><div class="ttdeci">Simd&lt; T, N &gt; abs(Simd&lt; T, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:112</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a4f8a64e7742fcd8f759f723a36a7c826"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a4f8a64e7742fcd8f759f723a36a7c826">mlx::core::simd::acosh</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; acosh(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:30</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a5109118acb6766855878b9e8a56b156a"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a5109118acb6766855878b9e8a56b156a">mlx::core::simd::all</a></div><div class="ttdeci">bool all(Simd&lt; T, N &gt; x)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:271</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a53b547b886918dc13d4da88eeb8811d2"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a53b547b886918dc13d4da88eeb8811d2">mlx::core::simd::sum</a></div><div class="ttdeci">T sum(Simd&lt; T, N &gt; x)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:279</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a64e80f096a8baf99ba8d396414473cc7"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a64e80f096a8baf99ba8d396414473cc7">mlx::core::simd::is_complex</a></div><div class="ttdeci">constexpr bool is_complex</div><div class="ttdef"><b>Definition</b> base_simd.h:42</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a660b79a51fb439f4aba91e2aea276300"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a660b79a51fb439f4aba91e2aea276300">mlx::core::simd::conj</a></div><div class="ttdeci">Simd&lt; T, 1 &gt; conj(Simd&lt; T, 1 &gt; in)</div><div class="ttdef"><b>Definition</b> base_simd.h:84</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a66426c28a4324b9f617b7018d9354ea1"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a66426c28a4324b9f617b7018d9354ea1">mlx::core::simd::log2</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; log2(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:38</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a6fcea259041cecfd042d0c4e6afc4b8f"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a6fcea259041cecfd042d0c4e6afc4b8f">mlx::core::simd::max</a></div><div class="ttdeci">T max(Simd&lt; T, N &gt; x)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:283</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a7f7a298284e71ddbd2ba0bb6d98b0d16"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a7f7a298284e71ddbd2ba0bb6d98b0d16">mlx::core::simd::maximum</a></div><div class="ttdeci">Simd&lt; T, N &gt; maximum(Simd&lt; T, N &gt; a, Simd&lt; T, N &gt; b)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:204</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a835d71dd0bb2f9494a397d9939696ec2"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a835d71dd0bb2f9494a397d9939696ec2">mlx::core::simd::exp</a></div><div class="ttdeci">Simd&lt; T, N &gt; exp(Simd&lt; T, N &gt; in)</div><div class="ttdoc">Compute exp(x) in an optimizer friendly way as follows:</div><div class="ttdef"><b>Definition</b> math.h:28</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a8cec82f4fb15bfd31d7554c6c09ceed4"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a8cec82f4fb15bfd31d7554c6c09ceed4">mlx::core::simd::log</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; log(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:37</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a8e22c484298d9af10b6604c835e52052"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a8e22c484298d9af10b6604c835e52052">mlx::core::simd::floor</a></div><div class="ttdeci">Simd&lt; T, N &gt; floor(Simd&lt; T, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:113</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a9407980793ecff5d5eb19c9a2cbda1eb"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a9407980793ecff5d5eb19c9a2cbda1eb">mlx::core::simd::expm1</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; expm1(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:36</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a97c69b04852ccba242f1348fda17ca20"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a97c69b04852ccba242f1348fda17ca20">mlx::core::simd::imag</a></div><div class="ttdeci">auto imag(Simd&lt; T, 1 &gt; in) -&gt; Simd&lt; decltype(std::imag(in.value)), 1 &gt;</div><div class="ttdef"><b>Definition</b> base_simd.h:102</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a9c7723fc49137394fa817136a7ffb50f"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a9c7723fc49137394fa817136a7ffb50f">mlx::core::simd::asin</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; asin(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:31</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a9d968537ad5ef18630f5afce8453b30e"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a9d968537ad5ef18630f5afce8453b30e">mlx::core::simd::any</a></div><div class="ttdeci">bool any(Simd&lt; T, N &gt; x)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:275</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_a9ddc7f119cc1dc04372ec1adcaf55f70"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#a9ddc7f119cc1dc04372ec1adcaf55f70">mlx::core::simd::fma</a></div><div class="ttdeci">Simd&lt; T, N &gt; fma(Simd&lt; T, N &gt; x, Simd&lt; T, N &gt; y, U z)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:264</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_aa244fbe7456b653aa50a473108fd6a2b"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#aa244fbe7456b653aa50a473108fd6a2b">mlx::core::simd::tanh</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; tanh(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:43</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_aa7550a1210e50c996d0db84034b8a22e"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#aa7550a1210e50c996d0db84034b8a22e">mlx::core::simd::atan</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; atan(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:33</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_aaa76bdf1db09261d84da51d394837f5d"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#aaa76bdf1db09261d84da51d394837f5d">mlx::core::simd::asinh</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; asinh(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:32</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_ac66bdf1a8e86a4d350c85037bc764da5"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#ac66bdf1a8e86a4d350c85037bc764da5">mlx::core::simd::remainder</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; remainder(Simd&lt; float16_t, N &gt; x, Simd&lt; float16_t, N &gt; y)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:53</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_ac91bd36c7caafd3c7ff176e7e2f81887"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#ac91bd36c7caafd3c7ff176e7e2f81887">mlx::core::simd::max_size</a></div><div class="ttdeci">static constexpr int max_size</div><div class="ttdef"><b>Definition</b> base_simd.h:13</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_acd4196d0c66204cfae70b064c305e146"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#acd4196d0c66204cfae70b064c305e146">mlx::core::simd::min</a></div><div class="ttdeci">T min(Simd&lt; T, N &gt; x)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:287</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_acdf822b7626bbab6a495552aea3457b5"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#acdf822b7626bbab6a495552aea3457b5">mlx::core::simd::real</a></div><div class="ttdeci">auto real(Simd&lt; T, 1 &gt; in) -&gt; Simd&lt; decltype(std::real(in.value)), 1 &gt;</div><div class="ttdef"><b>Definition</b> base_simd.h:98</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_ad06680bbc041e76efe2dbff4e11b9a13"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#ad06680bbc041e76efe2dbff4e11b9a13">mlx::core::simd::log1p</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; log1p(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:40</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_ae1d5460c58c507a0104d8dfa90343f12"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#ae1d5460c58c507a0104d8dfa90343f12">mlx::core::simd::ceil</a></div><div class="ttdeci">Simd&lt; T, N &gt; ceil(Simd&lt; T, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:120</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_ae344abefc91c7d9c0a9506c868a84d61"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#ae344abefc91c7d9c0a9506c868a84d61">mlx::core::simd::recip</a></div><div class="ttdeci">Simd&lt; T, N &gt; recip(Simd&lt; T, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:131</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_ae39b8e1d1fff94947406eeb8ec6e0414"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#ae39b8e1d1fff94947406eeb8ec6e0414">mlx::core::simd::sqrt</a></div><div class="ttdeci">Simd&lt; T, N &gt; sqrt(Simd&lt; T, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:129</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_ae4be4d88cd8eba7a8c1784fd53b86edb"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#ae4be4d88cd8eba7a8c1784fd53b86edb">mlx::core::simd::clamp</a></div><div class="ttdeci">Simd&lt; T, N &gt; clamp(Simd&lt; T, N &gt; v, Simd&lt; T, N &gt; min, Simd&lt; T, N &gt; max)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:259</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_ae623449dfa7aab3031aa2f14c1b10a2d"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#ae623449dfa7aab3031aa2f14c1b10a2d">mlx::core::simd::acos</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; acos(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:29</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_aea75ddf8c696efc2e5e924667ed48e70"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#aea75ddf8c696efc2e5e924667ed48e70">mlx::core::simd::rsqrt</a></div><div class="ttdeci">Simd&lt; T, N &gt; rsqrt(Simd&lt; T, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:130</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_aedc18b6fdb820cce9125c977c02833aa"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#aedc18b6fdb820cce9125c977c02833aa">mlx::core::simd::cosh</a></div><div class="ttdeci">Simd&lt; float16_t, N &gt; cosh(Simd&lt; float16_t, N &gt; v)</div><div class="ttdef"><b>Definition</b> accelerate_fp16_simd.h:35</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_afa2236afddfdec312eb7e27b89a5316a"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#afa2236afddfdec312eb7e27b89a5316a">mlx::core::simd::store</a></div><div class="ttdeci">void store(T *dst, Simd&lt; T, N &gt; x)</div><div class="ttdef"><b>Definition</b> base_simd.h:32</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1simd_html_afb3bcbd8d8b34128cd0c8eb677a170ef"><div class="ttname"><a href="namespacemlx_1_1core_1_1simd.html#afb3bcbd8d8b34128cd0c8eb677a170ef">mlx::core::simd::select</a></div><div class="ttdeci">Simd&lt; T1, N &gt; select(Simd&lt; MaskT, N &gt; mask, Simd&lt; T1, N &gt; x, Simd&lt; T2, N &gt; y)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:231</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4_html_a14e16c6e2ef5e89135cf8e85dc9f1f1f"><div class="ttname"><a href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#a14e16c6e2ef5e89135cf8e85dc9f1f1f">mlx::core::simd::Simd&lt; T, 1 &gt;::size</a></div><div class="ttdeci">static constexpr int size</div><div class="ttdef"><b>Definition</b> base_simd.h:17</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4_html_a3f6e4a83ecf897465f44160b6fad5a7a"><div class="ttname"><a href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#a3f6e4a83ecf897465f44160b6fad5a7a">mlx::core::simd::Simd&lt; T, 1 &gt;::Simd</a></div><div class="ttdeci">Simd()</div><div class="ttdef"><b>Definition</b> base_simd.h:19</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4_html_a585bc4768c4f7e1313d7e8756fbb00cc"><div class="ttname"><a href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#a585bc4768c4f7e1313d7e8756fbb00cc">mlx::core::simd::Simd&lt; T, 1 &gt;::Simd</a></div><div class="ttdeci">Simd(Simd&lt; U, 1 &gt; v)</div><div class="ttdef"><b>Definition</b> base_simd.h:21</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4_html_ac348445fd44bce2b6ee77adeac7d82df"><div class="ttname"><a href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#ac348445fd44bce2b6ee77adeac7d82df">mlx::core::simd::Simd&lt; T, 1 &gt;::value</a></div><div class="ttdeci">T value</div><div class="ttdef"><b>Definition</b> base_simd.h:18</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4_html_acf948f7c5e8829432c0ac17fc9f911e2"><div class="ttname"><a href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html#acf948f7c5e8829432c0ac17fc9f911e2">mlx::core::simd::Simd&lt; T, 1 &gt;::Simd</a></div><div class="ttdeci">Simd(U v)</div><div class="ttdef"><b>Definition</b> base_simd.h:23</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1simd_1_1_simd_html"><div class="ttname"><a href="structmlx_1_1core_1_1simd_1_1_simd.html">mlx::core::simd::Simd</a></div><div class="ttdef"><b>Definition</b> accelerate_simd.h:55</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1simd_1_1_simd_html_a36e2b7db5ce6eb4dd456e99a4cd2c2cf"><div class="ttname"><a href="structmlx_1_1core_1_1simd_1_1_simd.html#a36e2b7db5ce6eb4dd456e99a4cd2c2cf">mlx::core::simd::Simd::value</a></div><div class="ttdeci">asd::Vector&lt; scalar_t, N &gt;::packed_t value</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:80</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="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_48c8bf40aae7e42226b4fe31ea48af19.html">cpu</a></li><li class="navelem"><a class="el" href="dir_777905fddc177f731a39846ae16b0314.html">simd</a></li><li class="navelem"><a class="el" href="base__simd_8h.html">base_simd.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.2 </li>
</ul>
</div>
</body>
</html>