mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-25 09:51:17 +08:00
485 lines
91 KiB
HTML
485 lines
91 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&dn=expat.txt MIT */
|
|
$(function() { init_search(); });
|
|
/* @license-end */
|
|
</script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">MLX
|
|
</div>
|
|
</td>
|
|
<td> <div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span>
|
|
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
|
|
</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.13.2 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() { codefold.init(0); });
|
|
/* @license-end */
|
|
</script>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function(){initNavTree('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 <stdint.h></span></div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include <algorithm></span></div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include <cmath></span></div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include <complex></span></div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include <functional></span></div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</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="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keywordtype">int</span> N></div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</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="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ac91bd36c7caafd3c7ff176e7e2f81887"> 14</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="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="foldopen" id="foldopen00017" data-start="{" data-end="};">
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1simd_1_1_simd_3_01_t_00_011_01_4.html"> 17</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><T, 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#a14e16c6e2ef5e89135cf8e85dc9f1f1f"> 18</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="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#ac348445fd44bce2b6ee77adeac7d82df"> 19</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="l00020" name="l00020"></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"> 20</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="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
|
|
<div class="line"><a id="l00022" name="l00022"></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"> 22</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<U, 1></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="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keyword">template</span> <<span class="keyword">typename</span> U></div>
|
|
<div class="line"><a id="l00024" name="l00024"></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"> 24</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="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="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keywordtype">int</span> N></div>
|
|
<div class="foldopen" id="foldopen00028" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a4041676517d96870293e5448c7e2b5a4"> 28</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, N></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="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordflow">return</span> *(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, N></a>*)x;</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> <<span class="keyword">typename</span> T, <span class="keywordtype">int</span> N></div>
|
|
<div class="foldopen" id="foldopen00033" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#afa2236afddfdec312eb7e27b89a5316a"> 33</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<T, N></a> x) {</div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="comment">// Maintain invariant that bool is either 0 or 1 as</span></div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="comment">// simd comparison ops set all bits in the result to 1</span></div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (std::is_same_v<T, bool> && <a class="code hl_variable" href="namespacemlx_1_1core_1_1simd.html#a12b1553495a0c99d52472bd2a6626ddb">N</a> > 1) {</div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> x = x & 1;</div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> }</div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> *(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, N></a>*)dst = x;</div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="keyword">template</span> <<span class="keyword">typename</span>, <span class="keyword">typename</span> = <span class="keywordtype">void</span>></div>
|
|
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a64e80f096a8baf99ba8d396414473cc7"> 43</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="l00044" name="l00044"></a><span class="lineno"> 44</span> </div>
|
|
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a29fe8445e54a61f6bccc8d50f142ca54"> 46</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<T, std::void_t<decltype(std::declval<T></a>().real())>> =</div>
|
|
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">true</span>;</div>
|
|
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
|
|
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="foldopen" id="foldopen00050" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a797196eccc3690aac5c45e5f9c804ceb"> 50</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></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<T, 1></a> in) {</div>
|
|
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</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<T></a>) {</div>
|
|
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></a>{</div>
|
|
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</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="l00054" name="l00054"></a><span class="lineno"> 54</span> } <span class="keywordflow">else</span> {</div>
|
|
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></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="l00056" name="l00056"></a><span class="lineno"> 56</span> }</div>
|
|
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> </div>
|
|
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="foldopen" id="foldopen00060" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a74ac0fd799967b0f303bfd26fc6a17cf"> 60</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></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<T, 1></a> in) {</div>
|
|
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</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="l00062" name="l00062"></a><span class="lineno"> 62</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
|
|
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="foldopen" id="foldopen00065" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#afc915aed256295475ac88fde3a736f1f"> 65</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></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<T, 1></a> in) {</div>
|
|
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">return</span> T(1.0) / in;</div>
|
|
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
|
|
<div class="foldopen" id="foldopen00069" data-start="" data-end="">
|
|
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="base__simd_8h.html#a122d6a2fa4dcfe78b221e52155419124"> 69</a></span><span class="preprocessor">#define DEFAULT_UNARY(name, op) \</span></div>
|
|
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="preprocessor"> template <typename T> \</span></div>
|
|
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="preprocessor"> Simd<T, 1> name(Simd<T, 1> in) { \</span></div>
|
|
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="preprocessor"> return op(in.value); \</span></div>
|
|
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span><span class="preprocessor"> }</span></div>
|
|
</div>
|
|
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> </div>
|
|
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a70563bcd6c28802d11199812ffef38c8"> 75</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="l00076" name="l00076"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#afaa6ce61de4d80a4b7e9b2ab7454fff4"> 76</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="l00077" name="l00077"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a1958f026f26f313d17155ac87ea6eca3"> 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#a4f3cc8b2493586e83fd65640df3b60ad">abs</a>, std::abs)</div>
|
|
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a3d4f9d08d1902e3d62c6f63d39329dbd"> 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#ae623449dfa7aab3031aa2f14c1b10a2d">acos</a>, std::acos)</div>
|
|
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a51071c8104494b5bd8097990da3bf943"> 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#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="l00080" name="l00080"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a75349994f899aecb68553c2247580163"> 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#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="l00081" name="l00081"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a9323e370f6740651ebfd51367985d0e2"> 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#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="l00082" name="l00082"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a421845a6f68f88c58f520d2c1fa15914"> 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#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="l00083" name="l00083"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a5ebae2e6cce1889513f15be3adb265ea"> 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#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="l00084" name="l00084"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a4e54bd4ceb51ec41b0f95ebabe558713"> 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#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="l00085" name="l00085"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a660b79a51fb439f4aba91e2aea276300"> 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#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="l00086" name="l00086"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ae1265896d855818d20f2de2a9ebb684a"> 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#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="l00087" name="l00087"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a8f73d1dac82177e0aeadaeda349c4f96"> 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#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="l00088" name="l00088"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#aa396efa6e9c94f4ac1f8381d5e07f069"> 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#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="l00089" name="l00089"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#abd09d3f5989558ce5156549a94d0fb04"> 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#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="l00090" name="l00090"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#af9eafa15692dec783860ddae3dd8c072"> 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#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="l00091" name="l00091"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#adf754ade6cc1dd0e0bae0e31c7b513a2"> 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#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="l00092" name="l00092"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a92fcc8037ddb767bff517814ab55c259"> 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#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="l00093" name="l00093"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a40879bf874309c0a5abef783aea2057d"> 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#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="l00094" name="l00094"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a2ba6c75c0821db3e9ac525a89b3ac859"> 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#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="l00095" name="l00095"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a5abc381a85fe8b0e9cb472f874704652"> 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#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="l00096" name="l00096"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ab80a7db8d99e3f4032e761c60216027d"> 96</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="l00097" name="l00097"></a><span class="lineno"> 97</span> </div>
|
|
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span>template <typename T></div>
|
|
<div class="foldopen" id="foldopen00099" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a4c6ed06d523db05f99df7ef21b374c41"> 99</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a><T, 1> operator~(<a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a><T, 1> in) {</div>
|
|
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordflow">return</span> ~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="l00101" name="l00101"></a><span class="lineno"> 101</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> </div>
|
|
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="foldopen" id="foldopen00104" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#acdf822b7626bbab6a495552aea3457b5"> 104</a></span><span class="keyword">auto</span> <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<T, 1></a> in) -> <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a><<span class="keyword">decltype</span>(std::real(in.value)), 1> {</div>
|
|
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordflow">return</span> std::real(in.value);</div>
|
|
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="foldopen" id="foldopen00108" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a97c69b04852ccba242f1348fda17ca20"> 108</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<T, 1></a> in) -> <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a><<span class="keyword">decltype</span>(std::imag(in.value)), 1> {</div>
|
|
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">return</span> std::imag(in.value);</div>
|
|
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="foldopen" id="foldopen00112" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ac1c6c9b8bc7f3cd32ae39fa84975194d"> 112</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<bool, 1></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<T, 1></a> in) {</div>
|
|
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</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="l00114" name="l00114"></a><span class="lineno"> 114</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> </div>
|
|
<div class="foldopen" id="foldopen00116" data-start="" data-end="">
|
|
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"><a class="line" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047"> 116</a></span><span class="preprocessor">#define DEFAULT_BINARY(OP) \</span></div>
|
|
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span><span class="preprocessor"> template <typename T1, typename T2> \</span></div>
|
|
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span><span class="preprocessor"> auto operator OP(Simd<T1, 1> a, Simd<T2, 1> b) \</span></div>
|
|
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span><span class="preprocessor"> ->Simd<decltype(a.value OP b.value), 1> { \</span></div>
|
|
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span><span class="preprocessor"> return a.value OP b.value; \</span></div>
|
|
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span><span class="preprocessor"> } \</span></div>
|
|
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span><span class="preprocessor"> template <typename T1, typename T2> \</span></div>
|
|
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span><span class="preprocessor"> auto operator OP(T1 a, Simd<T2, 1> b)->Simd<decltype(a OP b.value), 1> { \</span></div>
|
|
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span><span class="preprocessor"> return a OP b.value; \</span></div>
|
|
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span><span class="preprocessor"> } \</span></div>
|
|
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span><span class="preprocessor"> template <typename T1, typename T2> \</span></div>
|
|
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span><span class="preprocessor"> auto operator OP(Simd<T1, 1> a, T2 b)->Simd<decltype(a.value OP b), 1> { \</span></div>
|
|
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span><span class="preprocessor"> return a.value OP b; \</span></div>
|
|
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span><span class="preprocessor"> }</span></div>
|
|
</div>
|
|
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> </div>
|
|
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a27dfc3843dbefbbebed5b7137bacbb59"> 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#ab1f7f553d3a9176a70404a29cad06619"> 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#ab6a73491bcb185cd91ae4db6b0f21e49"> 133</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(*)</div>
|
|
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a1d45c3b97cecfff86a2e43ae1f7fa185"> 134</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(/)</div>
|
|
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a33232e2342d5a3e542c9428924a25830"> 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"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a1108d186d57c2010c743d3f9297befc7"> 136</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(>>)</div>
|
|
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a60805b5f57ddbbf74f700b54cd3fc4f8"> 137</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(|)</div>
|
|
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a369178519e0e91fa936c0fd4aa9ee109"> 138</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(^)</div>
|
|
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a3c42ac1dc74f6c0bb934dfa45986875b"> 139</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(&)</div>
|
|
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a82676bd32059d1172296f8074a841de6"> 140</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(&&)</div>
|
|
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a7a1c3be1c37d41e450469f2e98cd9dde"> 141</a></span><a class="code hl_define" href="base__simd_8h.html#a1d01fad7230543d56f4facf17dcc4047">DEFAULT_BINARY</a>(||)</div>
|
|
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> </div>
|
|
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span>template <typename T></div>
|
|
<div class="foldopen" id="foldopen00144" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a54c7f2f2b995eb767462b1228982967f"> 144</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a><T, 1> <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><T, 1> a_, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a><T, 1> b_) {</div>
|
|
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</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="l00146" name="l00146"></a><span class="lineno"> 146</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="l00147" name="l00147"></a><span class="lineno"> 147</span> T r;</div>
|
|
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (std::is_integral_v<T>) {</div>
|
|
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> r = a % b;</div>
|
|
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> } <span class="keywordflow">else</span> {</div>
|
|
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> r = std::remainder(a, b);</div>
|
|
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> }</div>
|
|
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (std::is_signed_v<T>) {</div>
|
|
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordflow">if</span> (r != 0 && (r < 0 != b < 0)) {</div>
|
|
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> r += b;</div>
|
|
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> }</div>
|
|
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> }</div>
|
|
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="keywordflow">return</span> r;</div>
|
|
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> </div>
|
|
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="foldopen" id="foldopen00162" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ab54ff0f073be504e8428912f8e21effd"> 162</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></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<T, 1></a> a_, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></a> b_) {</div>
|
|
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</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="l00164" name="l00164"></a><span class="lineno"> 164</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="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (!std::is_integral_v<T>) {</div>
|
|
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="keywordflow">if</span> (std::isnan(a)) {</div>
|
|
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="keywordflow">return</span> a;</div>
|
|
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> }</div>
|
|
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> }</div>
|
|
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keywordflow">return</span> (a > b) ? a : b;</div>
|
|
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> </div>
|
|
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="foldopen" id="foldopen00174" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ac836568622a3e5957c275e115e2fcaf3"> 174</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></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<T, 1></a> a_, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></a> b_) {</div>
|
|
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</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="l00176" name="l00176"></a><span class="lineno"> 176</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="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (!std::is_integral_v<T>) {</div>
|
|
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="keywordflow">if</span> (std::isnan(a)) {</div>
|
|
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <span class="keywordflow">return</span> a;</div>
|
|
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> }</div>
|
|
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> }</div>
|
|
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <span class="keywordflow">return</span> (a < b) ? a : b;</div>
|
|
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> </div>
|
|
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="foldopen" id="foldopen00186" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#afe3d50bc4a11061898aa57377fa9536d"> 186</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></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<T, 1></a> a, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></a> b) {</div>
|
|
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</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="l00188" name="l00188"></a><span class="lineno"> 188</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="l00189" name="l00189"></a><span class="lineno"> 189</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (!std::is_integral_v<T>) {</div>
|
|
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</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="l00191" name="l00191"></a><span class="lineno"> 191</span> } <span class="keywordflow">else</span> {</div>
|
|
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> T res = 1;</div>
|
|
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</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="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a835d71dd0bb2f9494a397d9939696ec2">exp</a> & 1) {</div>
|
|
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> res *= base;</div>
|
|
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> }</div>
|
|
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a835d71dd0bb2f9494a397d9939696ec2">exp</a> >>= 1;</div>
|
|
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> base *= base;</div>
|
|
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> }</div>
|
|
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keywordflow">return</span> res;</div>
|
|
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> }</div>
|
|
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> </div>
|
|
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="foldopen" id="foldopen00205" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#af5e8e8230c7d7af8201a3aaa7f491a2d"> 205</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></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<T, 1></a> a, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></a> b) {</div>
|
|
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</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="l00207" name="l00207"></a><span class="lineno"> 207</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> </div>
|
|
<div class="foldopen" id="foldopen00209" data-start="" data-end="">
|
|
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"><a class="line" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366"> 209</a></span><span class="preprocessor">#define DEFAULT_COMPARISONS(OP) \</span></div>
|
|
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span><span class="preprocessor"> template <typename T1, typename T2> \</span></div>
|
|
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span><span class="preprocessor"> Simd<bool, 1> operator OP(Simd<T1, 1> a, Simd<T2, 1> b) { \</span></div>
|
|
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span><span class="preprocessor"> return a.value OP b.value; \</span></div>
|
|
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span><span class="preprocessor"> } \</span></div>
|
|
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span><span class="preprocessor"> template <typename T1, typename T2> \</span></div>
|
|
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span><span class="preprocessor"> Simd<bool, 1> operator OP(T1 a, Simd<T2, 1> b) { \</span></div>
|
|
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span><span class="preprocessor"> return a OP b.value; \</span></div>
|
|
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span><span class="preprocessor"> } \</span></div>
|
|
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span><span class="preprocessor"> template <typename T1, typename T2> \</span></div>
|
|
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span><span class="preprocessor"> Simd<bool, 1> operator OP(Simd<T1, 1> a, T2 b) { \</span></div>
|
|
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span><span class="preprocessor"> return a.value OP b; \</span></div>
|
|
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span><span class="preprocessor"> }</span></div>
|
|
</div>
|
|
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> </div>
|
|
<div class="foldopen" id="foldopen00223" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a23b59272b0760326844fffe20db9b3e2"> 223</a></span><a class="code hl_define" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a>(>)</div>
|
|
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span><a class="code hl_define" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a>(<)</div>
|
|
</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#aec6783f79ca181d6782a810ffb267482"> 225</a></span><a class="code hl_define" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a>(>=)</div>
|
|
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span><a class="code hl_define" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a>(<=)</div>
|
|
</div>
|
|
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a7928482ed5d25932be80413c7239125c"> 227</a></span><a class="code hl_define" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a>(==)</div>
|
|
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a757838b9d56e132e797a381d3bb0dc86"> 228</a></span><a class="code hl_define" href="base__simd_8h.html#af5153f51cdd18d56d1de24b5da9f4366">DEFAULT_COMPARISONS</a>(!=)</div>
|
|
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> </div>
|
|
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span>template <typename MaskT, typename T></div>
|
|
<div class="foldopen" id="foldopen00231" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a9e3e7b35d564c70de8fa0b6150570ed8"> 231</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a><T, 1> <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><MaskT, 1> mask, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a><T, 1> x, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd</a><T, 1> y) {</div>
|
|
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="keywordflow">return</span> mask.value ? x.value : y.value;</div>
|
|
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> </div>
|
|
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
|
|
<div class="foldopen" id="foldopen00236" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a567c06bf988af03988478679055a6c45"> 236</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></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<T, 1></a> v, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></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<T, 1></a> <a class="code hl_function" href="namespacemlx_1_1core_1_1simd.html#a6fcea259041cecfd042d0c4e6afc4b8f">max</a>) {</div>
|
|
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</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="l00238" name="l00238"></a><span class="lineno"> 238</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> </div>
|
|
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span><span class="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span> U></div>
|
|
<div class="foldopen" id="foldopen00241" data-start="{" data-end="}">
|
|
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a8aa81ebff4c26f21cae2253d885fd87a"> 241</a></span><a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></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<T, 1></a> x, <a class="code hl_struct" href="structmlx_1_1core_1_1simd_1_1_simd.html">Simd<T, 1></a> y, U z) {</div>
|
|
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</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<T, 1></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="l00243" name="l00243"></a><span class="lineno"> 243</span>}</div>
|
|
</div>
|
|
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> </div>
|
|
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span><span class="comment">// Reductions</span></div>
|
|
<div class="foldopen" id="foldopen00246" data-start="" data-end="">
|
|
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"><a class="line" href="base__simd_8h.html#a0adf6d25084019eff671abc59031573e"> 246</a></span><span class="preprocessor">#define DEFAULT_REDUCTION(name, type) \</span></div>
|
|
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span><span class="preprocessor"> template <typename T> \</span></div>
|
|
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span><span class="preprocessor"> type name(Simd<T, 1> x) { \</span></div>
|
|
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span><span class="preprocessor"> return x.value; \</span></div>
|
|
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span><span class="preprocessor"> }</span></div>
|
|
</div>
|
|
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> </div>
|
|
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a312ecd0ae1c38d32147cee71fd8539d7"> 252</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="l00253" name="l00253"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a96db878d780a8da6abad19ac772d08ca"> 253</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="l00254" name="l00254"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a96ce7d90b3b8b6dddab36ef5b49fffc2"> 254</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="l00255" name="l00255"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ac27cdc630e86b25ad607ca409de2b274"> 255</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="l00256" name="l00256"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#ae3b138b4bbcee0ca70b58a3e2ebd818c"> 256</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="l00257" name="l00257"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1simd.html#a4ba3690489c2bf861e22e1175255438c"> 257</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="l00258" name="l00258"></a><span class="lineno"> 258</span> </div>
|
|
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</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:246</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:69</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:116</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:209</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 &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< bool, N > isnan(Simd< T, N > v)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:146</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< float16_t, N > sinh(Simd< float16_t, N > 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< float16_t, N > atanh(Simd< float16_t, N > 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< T, N > minimum(Simd< T, N > a, Simd< T, N > b)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:215</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< float16_t, N > pow(Simd< float16_t, N > x, Simd< float16_t, N > 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< float16_t, N > atan2(Simd< float16_t, N > x, Simd< float16_t, N > 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< T, N > x)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:297</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< float16_t, N > log10(Simd< float16_t, N > 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< T, N > rint(Simd< T, N > 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< T, N > load(const T *x)</div><div class="ttdef"><b>Definition</b> base_simd.h:28</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< float16_t, N > tan(Simd< float16_t, N > 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< T, N > abs(Simd< T, N > 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< float16_t, N > acosh(Simd< float16_t, N > 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< T, N > x)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:276</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< T, N > x)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:284</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:43</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< T, 1 > conj(Simd< T, 1 > in)</div><div class="ttdef"><b>Definition</b> base_simd.h:85</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< float16_t, N > log2(Simd< float16_t, N > 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< T, N > x)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:288</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< T, N > maximum(Simd< T, N > a, Simd< T, N > b)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:209</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< T, N > exp(Simd< T, N > 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< float16_t, N > log(Simd< float16_t, N > 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< T, N > floor(Simd< T, N > 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< float16_t, N > expm1(Simd< float16_t, N > 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< T, 1 > in) -> Simd< decltype(std::imag(in.value)), 1 ></div><div class="ttdef"><b>Definition</b> base_simd.h:108</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< float16_t, N > asin(Simd< float16_t, N > 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< T, N > x)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:280</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< T, N > fma(Simd< T, N > x, Simd< T, N > y, U z)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:269</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< float16_t, N > tanh(Simd< float16_t, N > 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< float16_t, N > atan(Simd< float16_t, N > 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< float16_t, N > asinh(Simd< float16_t, N > 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< float16_t, N > remainder(Simd< float16_t, N > x, Simd< float16_t, N > 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:14</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< T, N > x)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:292</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< T, 1 > in) -> Simd< decltype(std::real(in.value)), 1 ></div><div class="ttdef"><b>Definition</b> base_simd.h:104</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< float16_t, N > log1p(Simd< float16_t, N > 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< T, N > ceil(Simd< T, N > 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< T, N > recip(Simd< T, N > 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< T, N > sqrt(Simd< T, N > 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< T, N > clamp(Simd< T, N > v, Simd< T, N > min, Simd< T, N > max)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:264</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< float16_t, N > acos(Simd< float16_t, N > 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< T, N > rsqrt(Simd< T, N > 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< float16_t, N > cosh(Simd< float16_t, N > 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< T, N > x)</div><div class="ttdef"><b>Definition</b> base_simd.h:33</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< T1, N > select(Simd< MaskT, N > mask, Simd< T1, N > x, Simd< T2, N > y)</div><div class="ttdef"><b>Definition</b> accelerate_simd.h:236</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< T, 1 >::size</a></div><div class="ttdeci">static constexpr int size</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_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< T, 1 >::Simd</a></div><div class="ttdeci">Simd()</div><div class="ttdef"><b>Definition</b> base_simd.h:20</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< T, 1 >::Simd</a></div><div class="ttdeci">Simd(Simd< U, 1 > v)</div><div class="ttdef"><b>Definition</b> base_simd.h:22</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< T, 1 >::value</a></div><div class="ttdeci">T value</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_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< T, 1 >::Simd</a></div><div class="ttdeci">Simd(U v)</div><div class="ttdef"><b>Definition</b> base_simd.h:24</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< scalar_t, N >::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>
|