docs update

This commit is contained in:
Awni Hannun
2024-06-06 20:28:06 -07:00
committed by CircleCI Docs
parent d7a78fbe2b
commit 85f70be0e6
2046 changed files with 323202 additions and 2319 deletions

View File

@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 32ccb60ed1f11b1a97dddf5c324c5115
config: 2259e1c4c1eefaf85a17fae7f78ebba0
tags: 645f666f9bcd5a90fca523b33c5a78b7

View File

@@ -43,6 +43,7 @@ are the CPU and GPU.
usage/function_transforms
usage/compile
usage/numpy
usage/distributed
usage/using_streams
.. toctree::
@@ -69,6 +70,7 @@ are the CPU and GPU.
python/metal
python/nn
python/optimizers
python/distributed
python/tree_utils
.. toctree::

View File

@@ -186,8 +186,8 @@ should point to the path to the built metal library.
Binary Size Minimization
~~~~~~~~~~~~~~~~~~~~~~~~
To produce a smaller binary use the CMake flags `CMAKE_BUILD_TYPE=MinSizeRel`
and `BUILD_SHARED_LIBS=ON`.
To produce a smaller binary use the CMake flags ``CMAKE_BUILD_TYPE=MinSizeRel``
and ``BUILD_SHARED_LIBS=ON``.
The MLX CMake build has several additional options to make smaller binaries.
For example, if you don't need the CPU backend or support for safetensors and
@@ -203,7 +203,7 @@ GGUF, you can do:
-DMLX_BUILD_GGUF=OFF \
-DMLX_METAL_JIT=ON
THE `MLX_METAL_JIT` flag minimizes the size of the MLX Metal library which
THE ``MLX_METAL_JIT`` flag minimizes the size of the MLX Metal library which
contains pre-built GPU kernels. This substantially reduces the size of the
Metal library by run-time compiling kernels the first time they are used in MLX
on a given machine. Note run-time compilation incurs a cold-start cost which can

View File

@@ -55,6 +55,7 @@
~array.tolist
~array.transpose
~array.var
~array.view

View File

@@ -1,6 +0,0 @@
mlx.core.block\_sparse\_mm
==========================
.. currentmodule:: mlx.core
.. autofunction:: block_sparse_mm

View File

@@ -0,0 +1,25 @@
mlx.core.distributed.Group
==========================
.. currentmodule:: mlx.core.distributed
.. autoclass:: Group
.. automethod:: __init__
.. rubric:: Methods
.. autosummary::
~Group.__init__
~Group.rank
~Group.size
~Group.split

View File

@@ -0,0 +1,6 @@
mlx.core.distributed.all\_gather
================================
.. currentmodule:: mlx.core.distributed
.. autofunction:: all_gather

View File

@@ -0,0 +1,6 @@
mlx.core.distributed.all\_sum
=============================
.. currentmodule:: mlx.core.distributed
.. autofunction:: all_sum

View File

@@ -0,0 +1,6 @@
mlx.core.distributed.init
=========================
.. currentmodule:: mlx.core.distributed
.. autofunction:: init

View File

@@ -0,0 +1,6 @@
mlx.core.distributed.is\_available
==================================
.. currentmodule:: mlx.core.distributed
.. autofunction:: is_available

View File

@@ -0,0 +1,6 @@
mlx.core.view
=============
.. currentmodule:: mlx.core
.. autofunction:: view

View File

@@ -0,0 +1,19 @@
.. _distributed:
.. currentmodule:: mlx.core.distributed
Distributed Communication
==========================
MLX provides a distributed communication package using MPI. The MPI library is
loaded at runtime; if MPI is available then distributed communication is also
made available.
.. autosummary::
:toctree: _autosummary
Group
is_available
init
all_sum
all_gather

View File

@@ -0,0 +1,16 @@
mlx.nn.GLU
==========
.. currentmodule:: mlx.nn
.. autoclass:: GLU
.. rubric:: Methods
.. autosummary::

View File

@@ -0,0 +1,16 @@
mlx.nn.HardShrink
=================
.. currentmodule:: mlx.nn
.. autoclass:: HardShrink
.. rubric:: Methods
.. autosummary::

View File

@@ -0,0 +1,16 @@
mlx.nn.HardTanh
===============
.. currentmodule:: mlx.nn
.. autoclass:: HardTanh
.. rubric:: Methods
.. autosummary::

View File

@@ -0,0 +1,16 @@
mlx.nn.Hardswish
================
.. currentmodule:: mlx.nn
.. autoclass:: Hardswish
.. rubric:: Methods
.. autosummary::

View File

@@ -0,0 +1,16 @@
mlx.nn.LeakyReLU
================
.. currentmodule:: mlx.nn
.. autoclass:: LeakyReLU
.. rubric:: Methods
.. autosummary::

View File

@@ -0,0 +1,16 @@
mlx.nn.ReLU6
============
.. currentmodule:: mlx.nn
.. autoclass:: ReLU6
.. rubric:: Methods
.. autosummary::

View File

@@ -0,0 +1,16 @@
mlx.nn.Softmax
==============
.. currentmodule:: mlx.nn
.. autoclass:: Softmax
.. rubric:: Methods
.. autosummary::

View File

@@ -0,0 +1,16 @@
mlx.nn.Softmin
==============
.. currentmodule:: mlx.nn
.. autoclass:: Softmin
.. rubric:: Methods
.. autosummary::

View File

@@ -0,0 +1,16 @@
mlx.nn.Softplus
===============
.. currentmodule:: mlx.nn
.. autoclass:: Softplus
.. rubric:: Methods
.. autosummary::

View File

@@ -0,0 +1,16 @@
mlx.nn.Softsign
===============
.. currentmodule:: mlx.nn
.. autoclass:: Softsign
.. rubric:: Methods
.. autosummary::

View File

@@ -0,0 +1,16 @@
mlx.nn.Tanh
===========
.. currentmodule:: mlx.nn
.. autoclass:: Tanh
.. rubric:: Methods
.. autosummary::

View File

@@ -0,0 +1,11 @@
mlx.nn.hard\_shrink
===================
.. currentmodule:: mlx.nn
.. autoclass:: hard_shrink

View File

@@ -0,0 +1,11 @@
mlx.nn.hard\_tanh
=================
.. currentmodule:: mlx.nn
.. autoclass:: hard_tanh

View File

@@ -0,0 +1,11 @@
mlx.nn.softmin
==============
.. currentmodule:: mlx.nn
.. autoclass:: softmin

View File

@@ -17,6 +17,8 @@ simple functions.
gelu_approx
gelu_fast_approx
glu
hard_shrink
hard_tanh
hardswish
leaky_relu
log_sigmoid
@@ -29,6 +31,7 @@ simple functions.
sigmoid
silu
softmax
softmin
softplus
softshrink
step

View File

@@ -21,10 +21,15 @@ Layers
Dropout3d
Embedding
GELU
GLU
GroupNorm
GRU
HardShrink
HardTanh
Hardswish
InstanceNorm
LayerNorm
LeakyReLU
Linear
LSTM
MaxPool1d
@@ -36,13 +41,19 @@ Layers
QuantizedLinear
RMSNorm
ReLU
ReLU6
RNN
RoPE
SELU
Sequential
SiLU
SinusoidalPositionalEncoding
Softmin
Softshrink
Softsign
Softmax
Softplus
Step
Tanh
Transformer
Upsample

View File

@@ -156,6 +156,7 @@ Operations
tril
triu
var
view
where
zeros
zeros_like

View File

@@ -0,0 +1,166 @@
.. _usage_distributed:
Distributed Communication
=========================
.. currentmodule:: mlx.core.distributed
MLX utilizes `MPI <https://en.wikipedia.org/wiki/Message_Passing_Interface>`_ to
provide distributed communication operations that allow the computational cost
of training or inference to be shared across many physical machines. You can
see a list of the supported operations in the :ref:`API docs<distributed>`.
.. note::
A lot of operations may not be supported or not as fast as they should be.
We are adding more and tuning the ones we have as we are figuring out the
best way to do distributed computing on Macs using MLX.
Getting Started
---------------
MLX already comes with the ability to "talk" to MPI if it is installed on the
machine. The minimal distributed program in MLX is as simple as:
.. code:: python
import mlx.core as mx
world = mx.distributed.init()
x = mx.distributed.all_sum(mx.ones(10))
print(world.rank(), x)
The program above sums the array ``mx.ones(10)`` across all
distributed processes. If simply run with ``python``, however, only one
process is launched and no distributed communication takes place.
To launch the program in distributed mode we need to use ``mpirun`` or
``mpiexec`` depending on the MPI installation. The simplest possible way is the
following:
.. code:: shell
$ mpirun -np 2 python test.py
1 array([2, 2, 2, ..., 2, 2, 2], dtype=float32)
0 array([2, 2, 2, ..., 2, 2, 2], dtype=float32)
The above launches two processes on the same (local) machine and we can see
both standard output streams. The processes send the array of 1s to each other
and compute the sum which is printed. Launching with ``mpirun -np 4 ...`` would
print 4 etc.
Installing MPI
---------------
MPI can be installed with Homebrew, using the Anaconda package manager or
compiled from source. Most of our testing is done using ``openmpi`` installed
with the Anaconda package manager as follows:
.. code:: shell
$ conda install openmpi
Installing with Homebrew may require specifying the location of ``libmpi.dyld``
so that MLX can find it and load it at runtime. This can simply be achieved by
passing the ``DYLD_LIBRARY_PATH`` environment variable to ``mpirun``.
.. code:: shell
$ mpirun -np 2 -x DYLD_LIBRARY_PATH=/opt/homebrew/lib/ python test.py
Setting up Remote Hosts
-----------------------
MPI can automatically connect to remote hosts and set up the communication over
the network if the remote hosts can be accessed via ssh. A good checklist to
debug connectivity issues is the following:
* ``ssh hostname`` works from all machines to all machines without asking for
password or host confirmation
* ``mpirun`` is accessible on all machines. You can call ``mpirun`` using its
full path to force all machines to use a specific path.
* Ensure that the ``hostname`` used by MPI is the one that you have configured
in the ``.ssh/config`` files on all machines.
.. note::
For an example hostname ``foo.bar.com`` MPI can use only ``foo`` as
the hostname passed to ssh if the current hostname matches ``*.bar.com``.
An easy way to pass the host names to MPI is using a host file. A host file
looks like the following, where ``host1`` and ``host2`` should be the fully
qualified domain names or IPs for these hosts.
.. code::
host1 slots=1
host2 slots=1
When using MLX, it is very likely that you want to use 1 slot per host, ie one
process per host. The hostfile also needs to contain the current
host if you want to run on the local host. Passing the host file to
``mpirun`` is simply done using the ``--hostfile`` command line argument.
Training Example
----------------
In this section we will adapt an MLX training loop to support data parallel
distributed training. Namely, we will average the gradients across a set of
hosts before applying them to the model.
Our training loop looks like the following code snippet if we omit the model,
dataset and optimizer initialization.
.. code:: python
model = ...
optimizer = ...
dataset = ...
def step(model, x, y):
loss, grads = loss_grad_fn(model, x, y)
optimizer.update(model, grads)
return loss
for x, y in dataset:
loss = step(model, x, y)
mx.eval(loss, model.parameters())
All we have to do to average the gradients across machines is perform an
:func:`all_sum` and divide by the size of the :class:`Group`. Namely we
have to :func:`mlx.utils.tree_map` the gradients with following function.
.. code:: python
def all_avg(x):
return mx.distributed.all_sum(x) / mx.distributed.init().size()
Putting everything together our training loop step looks as follows with
everything else remaining the same.
.. code:: python
from mlx.utils import tree_map
def all_reduce_grads(grads):
N = mx.distributed.init()
if N == 1:
return grads
return tree_map(
lambda x: mx.distributed.all_sum(x) / N,
grads)
def step(model, x, y):
loss, grads = loss_grad_fn(model, x, y)
grads = all_reduce_grads(grads) # <--- This line was added
optimizer.update(model, grads)
return loss
Tuning All Reduce
-----------------
We are working on improving the performance of all reduce on MLX but for now
the two main things one can do to extract the most out of distributed training with MLX are:
1. Perform a few large reductions instead of many small ones to improve
bandwidth and latency
2. Pass ``--mca btl_tcp_links 4`` to ``mpirun`` to configure it to use 4 tcp
connections between each host to improve bandwidth

View File

@@ -3,7 +3,11 @@
Conversion to NumPy and Other Frameworks
========================================
MLX array implements the `Python Buffer Protocol <https://docs.python.org/3/c-api/buffer.html>`_.
MLX array supports conversion between other frameworks with either:
* The `Python Buffer Protocol <https://docs.python.org/3/c-api/buffer.html>`_.
* `DLPack <https://dmlc.github.io/dlpack/latest/>`_.
Let's convert an array to NumPy and back.
.. code-block:: python

View File

@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '0.14.0',
VERSION: '0.15.0',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',

124
docs/build/html/allocator_8h.html vendored Normal file
View File

@@ -0,0 +1,124 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/allocator.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">allocator.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;cstdlib&gt;</code><br />
</div>
<p><a href="allocator_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">mlx::core::allocator::Buffer</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">mlx::core::allocator::Allocator</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html">mlx::core::allocator::CommonAllocator</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacemlx" id="r_namespacemlx"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx.html">mlx</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1core" id="r_namespacemlx_1_1core"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html">mlx::core</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1core_1_1allocator" id="r_namespacemlx_1_1core_1_1allocator"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1allocator.html">mlx::core::allocator</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a560d10a166e3c294f3757166f9bd6801" id="r_a560d10a166e3c294f3757166f9bd6801"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1allocator.html#a560d10a166e3c294f3757166f9bd6801">mlx::core::allocator::malloc</a> (size_t size)</td></tr>
<tr class="separator:a560d10a166e3c294f3757166f9bd6801"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77f0a1215be242db6485612bcb273af5" id="r_a77f0a1215be242db6485612bcb273af5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1allocator.html#a77f0a1215be242db6485612bcb273af5">mlx::core::allocator::free</a> (<a class="el" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a> buffer)</td></tr>
<tr class="separator:a77f0a1215be242db6485612bcb273af5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86ac0a11ff78f21e717f641716c34abc" id="r_a86ac0a11ff78f21e717f641716c34abc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1allocator.html#a86ac0a11ff78f21e717f641716c34abc">mlx::core::allocator::malloc_or_wait</a> (size_t size)</td></tr>
<tr class="separator:a86ac0a11ff78f21e717f641716c34abc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa23e2f20a336d0b159c097087194634e" id="r_aa23e2f20a336d0b159c097087194634e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">Allocator</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1allocator.html#aa23e2f20a336d0b159c097087194634e">mlx::core::allocator::allocator</a> ()</td></tr>
<tr class="separator:aa23e2f20a336d0b159c097087194634e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

191
docs/build/html/allocator_8h_source.html vendored Normal file
View File

@@ -0,0 +1,191 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/allocator.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">allocator.h</div></div>
</div><!--header-->
<div class="contents">
<a href="allocator_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;cstdlib&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="foldopen" id="foldopen00007" data-start="{" data-end="}">
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"><a class="line" href="namespacemlx.html"> 7</a></span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemlx_1_1core_1_1allocator.html">mlx::core::allocator</a> {</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="comment">// Simple wrapper around buffer pointers</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// WARNING: Only Buffer objects constructed from and those that wrap</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// raw pointers from mlx::allocator are supported.</span></div>
<div class="foldopen" id="foldopen00012" data-start="{" data-end="};">
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_buffer.html"> 12</a></span><span class="keyword">class </span><a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a> {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keywordtype">void</span>* ptr_;</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">public</span>:</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#ac4fc2cc6aa1368cfb74aff329d9a1300"> 17</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#ac4fc2cc6aa1368cfb74aff329d9a1300">Buffer</a>(<span class="keywordtype">void</span>* <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94">ptr</a>) : ptr_(<a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94">ptr</a>) {};</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="comment">// Get the raw data pointer from the buffer</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a2dfe63e0b4bffeb965cdc50ad4228dbc"> 20</a></span> <span class="keywordtype">void</span>* <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a2dfe63e0b4bffeb965cdc50ad4228dbc">raw_ptr</a>();</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="comment">// Get the buffer pointer from the buffer</span></div>
<div class="foldopen" id="foldopen00023" data-start="{" data-end="}">
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94"> 23</a></span> <span class="keyword">const</span> <span class="keywordtype">void</span>* <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94">ptr</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordflow">return</span> ptr_;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> };</div>
</div>
<div class="foldopen" id="foldopen00026" data-start="{" data-end="}">
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#acb15b2f057568828ea09635ed968b62a"> 26</a></span> <span class="keywordtype">void</span>* <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#acb15b2f057568828ea09635ed968b62a">ptr</a>() {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordflow">return</span> ptr_;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> };</div>
</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"><a class="line" href="namespacemlx_1_1core_1_1allocator.html#a560d10a166e3c294f3757166f9bd6801"> 31</a></span><a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1allocator.html#a560d10a166e3c294f3757166f9bd6801">malloc</a>(<span class="keywordtype">size_t</span> size);</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1allocator.html#a77f0a1215be242db6485612bcb273af5"> 33</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="namespacemlx_1_1core_1_1allocator.html#a77f0a1215be242db6485612bcb273af5">free</a>(<a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a> buffer);</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment">// Wait for running tasks to finish and free up memory</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment">// if allocation fails</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1allocator.html#a86ac0a11ff78f21e717f641716c34abc"> 37</a></span><a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1allocator.html#a86ac0a11ff78f21e717f641716c34abc">malloc_or_wait</a>(<span class="keywordtype">size_t</span> size);</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
<div class="foldopen" id="foldopen00039" data-start="{" data-end="};">
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_allocator.html"> 39</a></span><span class="keyword">class </span><a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">Allocator</a> {</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a9a17d2c7a97772bf4a15e6c74af34ca4"> 42</a></span> <span class="keyword">virtual</span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a> <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a9a17d2c7a97772bf4a15e6c74af34ca4">malloc</a>(<span class="keywordtype">size_t</span> size, <span class="keywordtype">bool</span> allow_swap = <span class="keyword">false</span>) = 0;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#ae963d551be646ae0e13df2c16f2beefb"> 43</a></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#ae963d551be646ae0e13df2c16f2beefb">free</a>(<a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a> buffer) = 0;</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"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a5803678a418fef687fc65fa9d5c37b65"> 45</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a5803678a418fef687fc65fa9d5c37b65">Allocator</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#aa05c081ce80dc036f9d3dd8c195259d2"> 46</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#aa05c081ce80dc036f9d3dd8c195259d2">Allocator</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">Allocator</a>&amp; other) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a8e8ce346a16cf0c62847bed9289f9959"> 47</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a8e8ce346a16cf0c62847bed9289f9959">Allocator</a>(<a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">Allocator</a>&amp;&amp; other) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a027b84cddc8d476f736ac1f1a9991fe4"> 48</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">Allocator</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a027b84cddc8d476f736ac1f1a9991fe4">operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">Allocator</a>&amp; other) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a2e971b47339b1d0849a334a902a9df3c"> 49</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">Allocator</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a2e971b47339b1d0849a334a902a9df3c">operator=</a>(<a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">Allocator</a>&amp;&amp; other) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a90ad02c2e2a6ed89bb8bbf7b871efdf1"> 50</a></span> <span class="keyword">virtual</span> <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a90ad02c2e2a6ed89bb8bbf7b871efdf1">~Allocator</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span>};</div>
</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1allocator.html#aa23e2f20a336d0b159c097087194634e"> 53</a></span><a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">Allocator</a>&amp; <a class="code hl_function" href="namespacemlx_1_1core_1_1allocator.html#aa23e2f20a336d0b159c097087194634e">allocator</a>();</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
<div class="foldopen" id="foldopen00055" data-start="{" data-end="};">
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html"> 55</a></span><span class="keyword">class </span><a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html">CommonAllocator</a> : <span class="keyword">public</span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">Allocator</a> {</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html#a4f3d5de6b8c0eba22e9403b28a5ef3f0"> 58</a></span> <span class="keyword">virtual</span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a> <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html#a4f3d5de6b8c0eba22e9403b28a5ef3f0">malloc</a>(<span class="keywordtype">size_t</span> size, <span class="keywordtype">bool</span> allow_swap = <span class="keyword">false</span>) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html#a84b50d1a3cbffa12c1a6cf0ed8c71079"> 59</a></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html#a84b50d1a3cbffa12c1a6cf0ed8c71079">free</a>(<a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a> buffer) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html">CommonAllocator</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html#abf84c726a37df68345589b897b2e35f0"> 63</a></span> <span class="keyword">friend</span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">Allocator</a>&amp; <a class="code hl_friend" href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html#abf84c726a37df68345589b897b2e35f0">allocator</a>();</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span>};</div>
</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span>} <span class="comment">// namespace mlx::core::allocator</span></div>
</div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_allocator_html"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_allocator.html">mlx::core::allocator::Allocator</a></div><div class="ttdef"><b>Definition</b> allocator.h:39</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_allocator_html_a027b84cddc8d476f736ac1f1a9991fe4"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a027b84cddc8d476f736ac1f1a9991fe4">mlx::core::allocator::Allocator::operator=</a></div><div class="ttdeci">Allocator &amp; operator=(const Allocator &amp;other)=delete</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_allocator_html_a2e971b47339b1d0849a334a902a9df3c"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a2e971b47339b1d0849a334a902a9df3c">mlx::core::allocator::Allocator::operator=</a></div><div class="ttdeci">Allocator &amp; operator=(Allocator &amp;&amp;other)=delete</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_allocator_html_a5803678a418fef687fc65fa9d5c37b65"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a5803678a418fef687fc65fa9d5c37b65">mlx::core::allocator::Allocator::Allocator</a></div><div class="ttdeci">Allocator()=default</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_allocator_html_a8e8ce346a16cf0c62847bed9289f9959"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a8e8ce346a16cf0c62847bed9289f9959">mlx::core::allocator::Allocator::Allocator</a></div><div class="ttdeci">Allocator(Allocator &amp;&amp;other)=delete</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_allocator_html_a90ad02c2e2a6ed89bb8bbf7b871efdf1"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a90ad02c2e2a6ed89bb8bbf7b871efdf1">mlx::core::allocator::Allocator::~Allocator</a></div><div class="ttdeci">virtual ~Allocator()=default</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_allocator_html_a9a17d2c7a97772bf4a15e6c74af34ca4"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_allocator.html#a9a17d2c7a97772bf4a15e6c74af34ca4">mlx::core::allocator::Allocator::malloc</a></div><div class="ttdeci">virtual Buffer malloc(size_t size, bool allow_swap=false)=0</div><div class="ttdoc">Abstract base class for a memory allocator.</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_allocator_html_aa05c081ce80dc036f9d3dd8c195259d2"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_allocator.html#aa05c081ce80dc036f9d3dd8c195259d2">mlx::core::allocator::Allocator::Allocator</a></div><div class="ttdeci">Allocator(const Allocator &amp;other)=delete</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_allocator_html_ae963d551be646ae0e13df2c16f2beefb"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_allocator.html#ae963d551be646ae0e13df2c16f2beefb">mlx::core::allocator::Allocator::free</a></div><div class="ttdeci">virtual void free(Buffer buffer)=0</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_buffer_html"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_buffer.html">mlx::core::allocator::Buffer</a></div><div class="ttdef"><b>Definition</b> allocator.h:12</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_buffer_html_a2dfe63e0b4bffeb965cdc50ad4228dbc"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a2dfe63e0b4bffeb965cdc50ad4228dbc">mlx::core::allocator::Buffer::raw_ptr</a></div><div class="ttdeci">void * raw_ptr()</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_buffer_html_a990643feac06961c5599aac098c17b94"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94">mlx::core::allocator::Buffer::ptr</a></div><div class="ttdeci">const void * ptr() const</div><div class="ttdef"><b>Definition</b> allocator.h:23</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_buffer_html_ac4fc2cc6aa1368cfb74aff329d9a1300"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_buffer.html#ac4fc2cc6aa1368cfb74aff329d9a1300">mlx::core::allocator::Buffer::Buffer</a></div><div class="ttdeci">Buffer(void *ptr)</div><div class="ttdef"><b>Definition</b> allocator.h:17</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_buffer_html_acb15b2f057568828ea09635ed968b62a"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_buffer.html#acb15b2f057568828ea09635ed968b62a">mlx::core::allocator::Buffer::ptr</a></div><div class="ttdeci">void * ptr()</div><div class="ttdef"><b>Definition</b> allocator.h:26</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_common_allocator_html"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html">mlx::core::allocator::CommonAllocator</a></div><div class="ttdef"><b>Definition</b> allocator.h:55</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_common_allocator_html_a4f3d5de6b8c0eba22e9403b28a5ef3f0"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html#a4f3d5de6b8c0eba22e9403b28a5ef3f0">mlx::core::allocator::CommonAllocator::malloc</a></div><div class="ttdeci">virtual Buffer malloc(size_t size, bool allow_swap=false) override</div><div class="ttdoc">A general CPU allocator.</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_common_allocator_html_a84b50d1a3cbffa12c1a6cf0ed8c71079"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html#a84b50d1a3cbffa12c1a6cf0ed8c71079">mlx::core::allocator::CommonAllocator::free</a></div><div class="ttdeci">virtual void free(Buffer buffer) override</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_common_allocator_html_abf84c726a37df68345589b897b2e35f0"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html#abf84c726a37df68345589b897b2e35f0">mlx::core::allocator::CommonAllocator::allocator</a></div><div class="ttdeci">friend Allocator &amp; allocator()</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1allocator_html"><div class="ttname"><a href="namespacemlx_1_1core_1_1allocator.html">mlx::core::allocator</a></div><div class="ttdef"><b>Definition</b> allocator.h:7</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1allocator_html_a560d10a166e3c294f3757166f9bd6801"><div class="ttname"><a href="namespacemlx_1_1core_1_1allocator.html#a560d10a166e3c294f3757166f9bd6801">mlx::core::allocator::malloc</a></div><div class="ttdeci">Buffer malloc(size_t size)</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1allocator_html_a77f0a1215be242db6485612bcb273af5"><div class="ttname"><a href="namespacemlx_1_1core_1_1allocator.html#a77f0a1215be242db6485612bcb273af5">mlx::core::allocator::free</a></div><div class="ttdeci">void free(Buffer buffer)</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1allocator_html_a86ac0a11ff78f21e717f641716c34abc"><div class="ttname"><a href="namespacemlx_1_1core_1_1allocator.html#a86ac0a11ff78f21e717f641716c34abc">mlx::core::allocator::malloc_or_wait</a></div><div class="ttdeci">Buffer malloc_or_wait(size_t size)</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1allocator_html_aa23e2f20a336d0b159c097087194634e"><div class="ttname"><a href="namespacemlx_1_1core_1_1allocator.html#aa23e2f20a336d0b159c097087194634e">mlx::core::allocator::allocator</a></div><div class="ttdeci">Allocator &amp; allocator()</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

469
docs/build/html/annotated.html vendored Normal file
View File

@@ -0,0 +1,469 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: Class List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- 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">Class List</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><div class="directory">
<div class="levels">[detail level <span onclick="javascript:dynsection.toggleLevel(1);">1</span><span onclick="javascript:dynsection.toggleLevel(2);">2</span><span onclick="javascript:dynsection.toggleLevel(3);">3</span><span onclick="javascript:dynsection.toggleLevel(4);">4</span><span onclick="javascript:dynsection.toggleLevel(5);">5</span>]</div><table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="dynsection.toggleFolder('0_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacemetal.html" target="_self">metal</a></td><td class="desc"></td></tr>
<tr id="row_0_0_" class="odd" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html" target="_self">_numeric_limits_impl&lt; bfloat16_t &gt;</a></td><td class="desc"></td></tr>
<tr id="row_1_" class="odd"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_1_" class="arrow" onclick="dynsection.toggleFolder('1_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacemlx.html" target="_self">mlx</a></td><td class="desc"></td></tr>
<tr id="row_1_0_" class="even" style="display:none;"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_1_0_" class="arrow" onclick="dynsection.toggleFolder('1_0_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacemlx_1_1core.html" target="_self">core</a></td><td class="desc"></td></tr>
<tr id="row_1_0_0_" class="even" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_1_0_0_" class="arrow" onclick="dynsection.toggleFolder('1_0_0_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacemlx_1_1core_1_1allocator.html" target="_self">allocator</a></td><td class="desc"></td></tr>
<tr id="row_1_0_0_0_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1allocator_1_1_allocator.html" target="_self">Allocator</a></td><td class="desc"></td></tr>
<tr id="row_1_0_0_1_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1allocator_1_1_buffer.html" target="_self">Buffer</a></td><td class="desc"></td></tr>
<tr id="row_1_0_0_2_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1allocator_1_1_common_allocator.html" target="_self">CommonAllocator</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_" class="even" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_1_0_1_" class="arrow" onclick="dynsection.toggleFolder('1_0_1_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacemlx_1_1core_1_1detail.html" target="_self">detail</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_0_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_abs.html" target="_self">Abs</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_1_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_add.html" target="_self">Add</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_2_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_cos.html" target="_self">ArcCos</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_3_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_cosh.html" target="_self">ArcCosh</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_4_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_sin.html" target="_self">ArcSin</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_5_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_sinh.html" target="_self">ArcSinh</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_6_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_tan.html" target="_self">ArcTan</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_7_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_tan2.html" target="_self">ArcTan2</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_8_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_tanh.html" target="_self">ArcTanh</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_9_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_bitwise_and.html" target="_self">BitwiseAnd</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_10_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_bitwise_or.html" target="_self">BitwiseOr</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_11_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_bitwise_xor.html" target="_self">BitwiseXor</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_12_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_ceil.html" target="_self">Ceil</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_13_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_conjugate.html" target="_self">Conjugate</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_14_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_cos.html" target="_self">Cos</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_15_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_cosh.html" target="_self">Cosh</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_16_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_divide.html" target="_self">Divide</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_17_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_equal.html" target="_self">Equal</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_18_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_erf.html" target="_self">Erf</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_19_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_erf_inv.html" target="_self">ErfInv</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_20_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_exp.html" target="_self">Exp</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_21_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_expm1.html" target="_self">Expm1</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_22_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_floor.html" target="_self">Floor</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_23_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_greater.html" target="_self">Greater</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_24_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_greater_equal.html" target="_self">GreaterEqual</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_25_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="unionmlx_1_1core_1_1detail_1_1_int_or_float.html" target="_self">IntOrFloat</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_26_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_in_tracing.html" target="_self">InTracing</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_27_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_left_shift.html" target="_self">LeftShift</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_28_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_less.html" target="_self">Less</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_29_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_less_equal.html" target="_self">LessEqual</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_30_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_log.html" target="_self">Log</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_31_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_log10.html" target="_self">Log10</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_32_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_log1p.html" target="_self">Log1p</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_33_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_log2.html" target="_self">Log2</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_34_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_log_add_exp.html" target="_self">LogAddExp</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_35_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_logical_and.html" target="_self">LogicalAnd</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_36_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_logical_not.html" target="_self">LogicalNot</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_37_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_logical_or.html" target="_self">LogicalOr</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_38_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_maximum.html" target="_self">Maximum</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_39_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_minimum.html" target="_self">Minimum</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_40_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_multiply.html" target="_self">Multiply</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_41_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_na_n_equal.html" target="_self">NaNEqual</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_42_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_negative.html" target="_self">Negative</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_43_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_not_equal.html" target="_self">NotEqual</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_44_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_power.html" target="_self">Power</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_45_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_remainder.html" target="_self">Remainder</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_46_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_right_shift.html" target="_self">RightShift</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_47_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_round.html" target="_self">Round</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_48_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_rsqrt.html" target="_self">Rsqrt</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_49_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_select.html" target="_self">Select</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_50_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_sigmoid.html" target="_self">Sigmoid</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_51_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_sign.html" target="_self">Sign</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_52_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_sin.html" target="_self">Sin</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_53_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_sinh.html" target="_self">Sinh</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_54_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_sqrt.html" target="_self">Sqrt</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_55_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_square.html" target="_self">Square</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_56_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_subtract.html" target="_self">Subtract</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_57_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_tan.html" target="_self">Tan</a></td><td class="desc"></td></tr>
<tr id="row_1_0_1_58_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1detail_1_1_tanh.html" target="_self">Tanh</a></td><td class="desc"></td></tr>
<tr id="row_1_0_2_" class="even" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_1_0_2_" class="arrow" onclick="dynsection.toggleFolder('1_0_2_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacemlx_1_1core_1_1distributed.html" target="_self">distributed</a></td><td class="desc"></td></tr>
<tr id="row_1_0_2_0_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1distributed_1_1_all_gather.html" target="_self">AllGather</a></td><td class="desc"></td></tr>
<tr id="row_1_0_2_1_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1distributed_1_1_all_reduce.html" target="_self">AllReduce</a></td><td class="desc"></td></tr>
<tr id="row_1_0_2_2_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1distributed_1_1_dist_primitive.html" target="_self">DistPrimitive</a></td><td class="desc"></td></tr>
<tr id="row_1_0_2_3_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1distributed_1_1_group.html" target="_self">Group</a></td><td class="desc">A <a class="el" href="structmlx_1_1core_1_1distributed_1_1_group.html" title="A distributed::Group represents a group of independent mlx processes that can communicate.">distributed::Group</a> represents a group of independent mlx processes that can communicate </td></tr>
<tr id="row_1_0_3_" class="even" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_1_0_3_" class="arrow" onclick="dynsection.toggleFolder('1_0_3_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacemlx_1_1core_1_1fast.html" target="_self">fast</a></td><td class="desc"></td></tr>
<tr id="row_1_0_3_0_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1fast_1_1_custom.html" target="_self">Custom</a></td><td class="desc"></td></tr>
<tr id="row_1_0_3_1_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1fast_1_1_layer_norm.html" target="_self">LayerNorm</a></td><td class="desc"></td></tr>
<tr id="row_1_0_3_2_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1fast_1_1_layer_norm_v_j_p.html" target="_self">LayerNormVJP</a></td><td class="desc"></td></tr>
<tr id="row_1_0_3_3_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1fast_1_1_r_m_s_norm.html" target="_self">RMSNorm</a></td><td class="desc"></td></tr>
<tr id="row_1_0_3_4_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1fast_1_1_r_m_s_norm_v_j_p.html" target="_self">RMSNormVJP</a></td><td class="desc"></td></tr>
<tr id="row_1_0_3_5_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1fast_1_1_ro_p_e.html" target="_self">RoPE</a></td><td class="desc"></td></tr>
<tr id="row_1_0_3_6_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1fast_1_1_scaled_dot_product_attention.html" target="_self">ScaledDotProductAttention</a></td><td class="desc"></td></tr>
<tr id="row_1_0_4_" class="even" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_1_0_4_" class="arrow" onclick="dynsection.toggleFolder('1_0_4_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacemlx_1_1core_1_1io.html" target="_self">io</a></td><td class="desc"></td></tr>
<tr id="row_1_0_4_0_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1io_1_1_file_reader.html" target="_self">FileReader</a></td><td class="desc"></td></tr>
<tr id="row_1_0_4_1_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1io_1_1_file_writer.html" target="_self">FileWriter</a></td><td class="desc"></td></tr>
<tr id="row_1_0_4_2_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1io_1_1_reader.html" target="_self">Reader</a></td><td class="desc"></td></tr>
<tr id="row_1_0_4_3_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1io_1_1_writer.html" target="_self">Writer</a></td><td class="desc"></td></tr>
<tr id="row_1_0_5_" class="even" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_1_0_5_" class="arrow" onclick="dynsection.toggleFolder('1_0_5_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacemlx_1_1core_1_1metal.html" target="_self">metal</a></td><td class="desc"></td></tr>
<tr id="row_1_0_5_0_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span id="arr_1_0_5_0_" class="arrow" onclick="dynsection.toggleFolder('1_0_5_0_')">&#9658;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html" target="_self">CommandEncoder</a></td><td class="desc"></td></tr>
<tr id="row_1_0_5_0_0_" class="even" style="display:none;"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html" target="_self">ConcurrentContext</a></td><td class="desc"></td></tr>
<tr id="row_1_0_5_1_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1metal_1_1_device.html" target="_self">Device</a></td><td class="desc"></td></tr>
<tr id="row_1_0_5_2_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html" target="_self">MetalAllocator</a></td><td class="desc"></td></tr>
<tr id="row_1_0_6_" class="even" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_1_0_6_" class="arrow" onclick="dynsection.toggleFolder('1_0_6_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacemlx_1_1core_1_1random.html" target="_self">random</a></td><td class="desc"></td></tr>
<tr id="row_1_0_6_0_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1random_1_1_key_sequence.html" target="_self">KeySequence</a></td><td class="desc"></td></tr>
<tr id="row_1_0_7_" class="even" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_1_0_7_" class="arrow" onclick="dynsection.toggleFolder('1_0_7_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacemlx_1_1core_1_1scheduler.html" target="_self">scheduler</a></td><td class="desc"></td></tr>
<tr id="row_1_0_7_0_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1scheduler_1_1_scheduler.html" target="_self">Scheduler</a></td><td class="desc"></td></tr>
<tr id="row_1_0_7_1_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1scheduler_1_1_stream_thread.html" target="_self">StreamThread</a></td><td class="desc"></td></tr>
<tr id="row_1_0_8_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1___m_l_x___b_float16.html" target="_self">_MLX_BFloat16</a></td><td class="desc"></td></tr>
<tr id="row_1_0_9_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1___m_l_x___float16.html" target="_self">_MLX_Float16</a></td><td class="desc"></td></tr>
<tr id="row_1_0_10_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_abs.html" target="_self">Abs</a></td><td class="desc"></td></tr>
<tr id="row_1_0_11_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_add.html" target="_self">Add</a></td><td class="desc"></td></tr>
<tr id="row_1_0_12_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_add_m_m.html" target="_self">AddMM</a></td><td class="desc"></td></tr>
<tr id="row_1_0_13_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_arange.html" target="_self">Arange</a></td><td class="desc"></td></tr>
<tr id="row_1_0_14_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_arc_cos.html" target="_self">ArcCos</a></td><td class="desc"></td></tr>
<tr id="row_1_0_15_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_arc_cosh.html" target="_self">ArcCosh</a></td><td class="desc"></td></tr>
<tr id="row_1_0_16_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_arc_sin.html" target="_self">ArcSin</a></td><td class="desc"></td></tr>
<tr id="row_1_0_17_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_arc_sinh.html" target="_self">ArcSinh</a></td><td class="desc"></td></tr>
<tr id="row_1_0_18_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_arc_tan.html" target="_self">ArcTan</a></td><td class="desc"></td></tr>
<tr id="row_1_0_19_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_arc_tan2.html" target="_self">ArcTan2</a></td><td class="desc"></td></tr>
<tr id="row_1_0_20_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_arc_tanh.html" target="_self">ArcTanh</a></td><td class="desc"></td></tr>
<tr id="row_1_0_21_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_arg_partition.html" target="_self">ArgPartition</a></td><td class="desc"></td></tr>
<tr id="row_1_0_22_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_arg_reduce.html" target="_self">ArgReduce</a></td><td class="desc"></td></tr>
<tr id="row_1_0_23_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_arg_sort.html" target="_self">ArgSort</a></td><td class="desc"></td></tr>
<tr id="row_1_0_24_" class="even" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_1_0_24_" class="arrow" onclick="dynsection.toggleFolder('1_0_24_')">&#9658;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1array.html" target="_self">array</a></td><td class="desc"></td></tr>
<tr id="row_1_0_24_0_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1array_1_1_array_iterator.html" target="_self">ArrayIterator</a></td><td class="desc"></td></tr>
<tr id="row_1_0_24_1_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1array_1_1_data.html" target="_self">Data</a></td><td class="desc"></td></tr>
<tr id="row_1_0_24_2_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1array_1_1_flags.html" target="_self">Flags</a></td><td class="desc"></td></tr>
<tr id="row_1_0_25_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_as_strided.html" target="_self">AsStrided</a></td><td class="desc"></td></tr>
<tr id="row_1_0_26_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_as_type.html" target="_self">AsType</a></td><td class="desc"></td></tr>
<tr id="row_1_0_27_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_bitwise_binary.html" target="_self">BitwiseBinary</a></td><td class="desc"></td></tr>
<tr id="row_1_0_28_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_block_masked_m_m.html" target="_self">BlockMaskedMM</a></td><td class="desc"></td></tr>
<tr id="row_1_0_29_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_broadcast.html" target="_self">Broadcast</a></td><td class="desc"></td></tr>
<tr id="row_1_0_30_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_ceil.html" target="_self">Ceil</a></td><td class="desc"></td></tr>
<tr id="row_1_0_31_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_cholesky.html" target="_self">Cholesky</a></td><td class="desc"></td></tr>
<tr id="row_1_0_32_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_compiled.html" target="_self">Compiled</a></td><td class="desc"></td></tr>
<tr id="row_1_0_33_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1complex128__t.html" target="_self">complex128_t</a></td><td class="desc"></td></tr>
<tr id="row_1_0_34_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1complex64__t.html" target="_self">complex64_t</a></td><td class="desc"></td></tr>
<tr id="row_1_0_35_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_concatenate.html" target="_self">Concatenate</a></td><td class="desc"></td></tr>
<tr id="row_1_0_36_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_conjugate.html" target="_self">Conjugate</a></td><td class="desc"></td></tr>
<tr id="row_1_0_37_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_convolution.html" target="_self">Convolution</a></td><td class="desc"></td></tr>
<tr id="row_1_0_38_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_copy.html" target="_self">Copy</a></td><td class="desc"></td></tr>
<tr id="row_1_0_39_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_cos.html" target="_self">Cos</a></td><td class="desc"></td></tr>
<tr id="row_1_0_40_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_cosh.html" target="_self">Cosh</a></td><td class="desc"></td></tr>
<tr id="row_1_0_41_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_custom_v_j_p.html" target="_self">CustomVJP</a></td><td class="desc"></td></tr>
<tr id="row_1_0_42_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_depends.html" target="_self">Depends</a></td><td class="desc"></td></tr>
<tr id="row_1_0_43_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1_device.html" target="_self">Device</a></td><td class="desc"></td></tr>
<tr id="row_1_0_44_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_divide.html" target="_self">Divide</a></td><td class="desc"></td></tr>
<tr id="row_1_0_45_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_div_mod.html" target="_self">DivMod</a></td><td class="desc"></td></tr>
<tr id="row_1_0_46_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1_dtype.html" target="_self">Dtype</a></td><td class="desc"></td></tr>
<tr id="row_1_0_47_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_equal.html" target="_self">Equal</a></td><td class="desc"></td></tr>
<tr id="row_1_0_48_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_erf.html" target="_self">Erf</a></td><td class="desc"></td></tr>
<tr id="row_1_0_49_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_erf_inv.html" target="_self">ErfInv</a></td><td class="desc"></td></tr>
<tr id="row_1_0_50_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_event.html" target="_self">Event</a></td><td class="desc"></td></tr>
<tr id="row_1_0_51_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_exp.html" target="_self">Exp</a></td><td class="desc"></td></tr>
<tr id="row_1_0_52_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_expm1.html" target="_self">Expm1</a></td><td class="desc"></td></tr>
<tr id="row_1_0_53_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_f_f_t.html" target="_self">FFT</a></td><td class="desc"></td></tr>
<tr id="row_1_0_54_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_floor.html" target="_self">Floor</a></td><td class="desc"></td></tr>
<tr id="row_1_0_55_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_full.html" target="_self">Full</a></td><td class="desc"></td></tr>
<tr id="row_1_0_56_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_gather.html" target="_self">Gather</a></td><td class="desc"></td></tr>
<tr id="row_1_0_57_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_gather_m_m.html" target="_self">GatherMM</a></td><td class="desc"></td></tr>
<tr id="row_1_0_58_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_gather_q_m_m.html" target="_self">GatherQMM</a></td><td class="desc"></td></tr>
<tr id="row_1_0_59_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_greater.html" target="_self">Greater</a></td><td class="desc"></td></tr>
<tr id="row_1_0_60_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_greater_equal.html" target="_self">GreaterEqual</a></td><td class="desc"></td></tr>
<tr id="row_1_0_61_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_inverse.html" target="_self">Inverse</a></td><td class="desc"></td></tr>
<tr id="row_1_0_62_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_less.html" target="_self">Less</a></td><td class="desc"></td></tr>
<tr id="row_1_0_63_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_less_equal.html" target="_self">LessEqual</a></td><td class="desc"></td></tr>
<tr id="row_1_0_64_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_load.html" target="_self">Load</a></td><td class="desc"></td></tr>
<tr id="row_1_0_65_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_log.html" target="_self">Log</a></td><td class="desc"></td></tr>
<tr id="row_1_0_66_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_log1p.html" target="_self">Log1p</a></td><td class="desc"></td></tr>
<tr id="row_1_0_67_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_log_add_exp.html" target="_self">LogAddExp</a></td><td class="desc"></td></tr>
<tr id="row_1_0_68_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_logical_and.html" target="_self">LogicalAnd</a></td><td class="desc"></td></tr>
<tr id="row_1_0_69_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_logical_not.html" target="_self">LogicalNot</a></td><td class="desc"></td></tr>
<tr id="row_1_0_70_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_logical_or.html" target="_self">LogicalOr</a></td><td class="desc"></td></tr>
<tr id="row_1_0_71_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_matmul.html" target="_self">Matmul</a></td><td class="desc"></td></tr>
<tr id="row_1_0_72_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_maximum.html" target="_self">Maximum</a></td><td class="desc"></td></tr>
<tr id="row_1_0_73_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_minimum.html" target="_self">Minimum</a></td><td class="desc"></td></tr>
<tr id="row_1_0_74_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_multiply.html" target="_self">Multiply</a></td><td class="desc"></td></tr>
<tr id="row_1_0_75_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_negative.html" target="_self">Negative</a></td><td class="desc"></td></tr>
<tr id="row_1_0_76_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1_node_namer.html" target="_self">NodeNamer</a></td><td class="desc"></td></tr>
<tr id="row_1_0_77_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_not_equal.html" target="_self">NotEqual</a></td><td class="desc"></td></tr>
<tr id="row_1_0_78_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_number_of_elements.html" target="_self">NumberOfElements</a></td><td class="desc"></td></tr>
<tr id="row_1_0_79_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_pad.html" target="_self">Pad</a></td><td class="desc"></td></tr>
<tr id="row_1_0_80_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_partition.html" target="_self">Partition</a></td><td class="desc"></td></tr>
<tr id="row_1_0_81_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_power.html" target="_self">Power</a></td><td class="desc"></td></tr>
<tr id="row_1_0_82_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_primitive.html" target="_self">Primitive</a></td><td class="desc"></td></tr>
<tr id="row_1_0_83_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1_print_formatter.html" target="_self">PrintFormatter</a></td><td class="desc"></td></tr>
<tr id="row_1_0_84_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_q_r_f.html" target="_self">QRF</a></td><td class="desc"></td></tr>
<tr id="row_1_0_85_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_quantized_matmul.html" target="_self">QuantizedMatmul</a></td><td class="desc"></td></tr>
<tr id="row_1_0_86_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_random_bits.html" target="_self">RandomBits</a></td><td class="desc"></td></tr>
<tr id="row_1_0_87_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_reduce.html" target="_self">Reduce</a></td><td class="desc"></td></tr>
<tr id="row_1_0_88_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1_reduction_plan.html" target="_self">ReductionPlan</a></td><td class="desc"></td></tr>
<tr id="row_1_0_89_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_remainder.html" target="_self">Remainder</a></td><td class="desc"></td></tr>
<tr id="row_1_0_90_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_reshape.html" target="_self">Reshape</a></td><td class="desc"></td></tr>
<tr id="row_1_0_91_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_round.html" target="_self">Round</a></td><td class="desc"></td></tr>
<tr id="row_1_0_92_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_scan.html" target="_self">Scan</a></td><td class="desc"></td></tr>
<tr id="row_1_0_93_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_scatter.html" target="_self">Scatter</a></td><td class="desc"></td></tr>
<tr id="row_1_0_94_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_select.html" target="_self">Select</a></td><td class="desc"></td></tr>
<tr id="row_1_0_95_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_sigmoid.html" target="_self">Sigmoid</a></td><td class="desc"></td></tr>
<tr id="row_1_0_96_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_sign.html" target="_self">Sign</a></td><td class="desc"></td></tr>
<tr id="row_1_0_97_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_sin.html" target="_self">Sin</a></td><td class="desc"></td></tr>
<tr id="row_1_0_98_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_sinh.html" target="_self">Sinh</a></td><td class="desc"></td></tr>
<tr id="row_1_0_99_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_slice.html" target="_self">Slice</a></td><td class="desc"></td></tr>
<tr id="row_1_0_100_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_slice_update.html" target="_self">SliceUpdate</a></td><td class="desc"></td></tr>
<tr id="row_1_0_101_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_softmax.html" target="_self">Softmax</a></td><td class="desc"></td></tr>
<tr id="row_1_0_102_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_sort.html" target="_self">Sort</a></td><td class="desc"></td></tr>
<tr id="row_1_0_103_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_split.html" target="_self">Split</a></td><td class="desc"></td></tr>
<tr id="row_1_0_104_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_sqrt.html" target="_self">Sqrt</a></td><td class="desc"></td></tr>
<tr id="row_1_0_105_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_square.html" target="_self">Square</a></td><td class="desc"></td></tr>
<tr id="row_1_0_106_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_stop_gradient.html" target="_self">StopGradient</a></td><td class="desc"></td></tr>
<tr id="row_1_0_107_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1_stream.html" target="_self">Stream</a></td><td class="desc"></td></tr>
<tr id="row_1_0_108_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1_stream_context.html" target="_self">StreamContext</a></td><td class="desc"></td></tr>
<tr id="row_1_0_109_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_subtract.html" target="_self">Subtract</a></td><td class="desc"></td></tr>
<tr id="row_1_0_110_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_s_v_d.html" target="_self">SVD</a></td><td class="desc"></td></tr>
<tr id="row_1_0_111_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_tan.html" target="_self">Tan</a></td><td class="desc"></td></tr>
<tr id="row_1_0_112_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_tanh.html" target="_self">Tanh</a></td><td class="desc"></td></tr>
<tr id="row_1_0_113_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_transpose.html" target="_self">Transpose</a></td><td class="desc"></td></tr>
<tr id="row_1_0_114_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1core_1_1_type_to_dtype.html" target="_self">TypeToDtype</a></td><td class="desc"></td></tr>
<tr id="row_1_0_115_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html" target="_self">UnaryPrimitive</a></td><td class="desc"></td></tr>
<tr id="row_1_0_116_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_uniform.html" target="_self">Uniform</a></td><td class="desc"></td></tr>
<tr id="row_1_0_117_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classmlx_1_1core_1_1_view.html" target="_self">View</a></td><td class="desc"></td></tr>
<tr id="row_1_1_" class="even" style="display:none;"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_1_1_" class="arrow" onclick="dynsection.toggleFolder('1_1_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacemlx_1_1steel.html" target="_self">steel</a></td><td class="desc"></td></tr>
<tr id="row_1_1_0_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_accum_helper.html" target="_self">AccumHelper</a></td><td class="desc"></td></tr>
<tr id="row_1_1_1_" class="even" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_1_1_1_" class="arrow" onclick="dynsection.toggleFolder('1_1_1_')">&#9658;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_block_loader.html" target="_self">BlockLoader</a></td><td class="desc"></td></tr>
<tr id="row_1_1_1_0_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_block_loader_1_1_read_vector.html" target="_self">ReadVector</a></td><td class="desc"></td></tr>
<tr id="row_1_1_2_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_block_m_m_a.html" target="_self">BlockMMA</a></td><td class="desc"></td></tr>
<tr id="row_1_1_3_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_block_swizzle.html" target="_self">BlockSwizzle</a></td><td class="desc"></td></tr>
<tr id="row_1_1_4_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_channel_helper.html" target="_self">ChannelHelper</a></td><td class="desc"></td></tr>
<tr id="row_1_1_5_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_channel_helper_3_011_01_4.html" target="_self">ChannelHelper&lt; 1 &gt;</a></td><td class="desc"></td></tr>
<tr id="row_1_1_6_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_channel_helper_3_012_01_4.html" target="_self">ChannelHelper&lt; 2 &gt;</a></td><td class="desc"></td></tr>
<tr id="row_1_1_7_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_channel_helper_3_013_01_4.html" target="_self">ChannelHelper&lt; 3 &gt;</a></td><td class="desc"></td></tr>
<tr id="row_1_1_8_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_channel_helper_3_014_01_4.html" target="_self">ChannelHelper&lt; 4 &gt;</a></td><td class="desc"></td></tr>
<tr id="row_1_1_9_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_conv2_d_general_base_info.html" target="_self">Conv2DGeneralBaseInfo</a></td><td class="desc"></td></tr>
<tr id="row_1_1_10_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_conv2_d_general_jump_params.html" target="_self">Conv2DGeneralJumpParams</a></td><td class="desc"></td></tr>
<tr id="row_1_1_11_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_conv2_d_input_block_loader_general.html" target="_self">Conv2DInputBlockLoaderGeneral</a></td><td class="desc"></td></tr>
<tr id="row_1_1_12_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_conv2_d_input_block_loader_large_filter.html" target="_self">Conv2DInputBlockLoaderLargeFilter</a></td><td class="desc"></td></tr>
<tr id="row_1_1_13_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_conv2_d_input_block_loader_small_channels.html" target="_self">Conv2DInputBlockLoaderSmallChannels</a></td><td class="desc"></td></tr>
<tr id="row_1_1_14_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_conv2_d_input_block_loader_small_filter.html" target="_self">Conv2DInputBlockLoaderSmallFilter</a></td><td class="desc"></td></tr>
<tr id="row_1_1_15_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_conv2_d_weight_block_loader.html" target="_self">Conv2DWeightBlockLoader</a></td><td class="desc"></td></tr>
<tr id="row_1_1_16_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_conv2_d_weight_block_loader_general.html" target="_self">Conv2DWeightBlockLoaderGeneral</a></td><td class="desc"></td></tr>
<tr id="row_1_1_17_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_conv2_d_weight_block_loader_small_channels.html" target="_self">Conv2DWeightBlockLoaderSmallChannels</a></td><td class="desc"></td></tr>
<tr id="row_1_1_18_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_g_e_m_m_add_m_m_params.html" target="_self">GEMMAddMMParams</a></td><td class="desc"></td></tr>
<tr id="row_1_1_19_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_g_e_m_m_kernel.html" target="_self">GEMMKernel</a></td><td class="desc"></td></tr>
<tr id="row_1_1_20_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_g_e_m_m_params.html" target="_self">GEMMParams</a></td><td class="desc"></td></tr>
<tr id="row_1_1_21_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_g_e_m_m_spilt_k_params.html" target="_self">GEMMSpiltKParams</a></td><td class="desc"></td></tr>
<tr id="row_1_1_22_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_implicit_gemm_conv2_d_params.html" target="_self">ImplicitGemmConv2DParams</a></td><td class="desc"></td></tr>
<tr id="row_1_1_23_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_loop_alignment.html" target="_self">LoopAlignment</a></td><td class="desc"></td></tr>
<tr id="row_1_1_24_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_transform_add.html" target="_self">TransformAdd</a></td><td class="desc"></td></tr>
<tr id="row_1_1_25_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_transform_axpby.html" target="_self">TransformAxpby</a></td><td class="desc"></td></tr>
<tr id="row_1_1_26_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx_1_1steel_1_1_transform_none.html" target="_self">TransformNone</a></td><td class="desc"></td></tr>
<tr id="row_2_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_2_" class="arrow" onclick="dynsection.toggleFolder('2_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespace_m_p_s.html" target="_self">MPS</a></td><td class="desc"></td></tr>
<tr id="row_2_0_" class="odd" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_m_p_s_1_1_kernel.html" target="_self">Kernel</a></td><td class="desc"></td></tr>
<tr id="row_2_1_" class="odd" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_m_p_s_1_1_matrix.html" target="_self">Matrix</a></td><td class="desc"></td></tr>
<tr id="row_2_2_" class="odd" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_m_p_s_1_1_matrix_descriptor.html" target="_self">MatrixDescriptor</a></td><td class="desc"></td></tr>
<tr id="row_2_3_" class="odd" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html" target="_self">MatrixMultiplication</a></td><td class="desc"></td></tr>
<tr id="row_2_4_" class="odd" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html" target="_self">MatrixVectorMultiplication</a></td><td class="desc"></td></tr>
<tr id="row_2_5_" class="odd" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_m_p_s_1_1_vector.html" target="_self">Vector</a></td><td class="desc"></td></tr>
<tr id="row_2_6_" class="odd" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_m_p_s_1_1_vector_descriptor.html" target="_self">VectorDescriptor</a></td><td class="desc"></td></tr>
<tr id="row_3_" class="odd"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_3_" class="arrow" onclick="dynsection.toggleFolder('3_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacepocketfft.html" target="_self">pocketfft</a></td><td class="desc"></td></tr>
<tr id="row_3_0_" class="even" style="display:none;"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_3_0_" class="arrow" onclick="dynsection.toggleFolder('3_0_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacepocketfft_1_1detail.html" target="_self">detail</a></td><td class="desc"></td></tr>
<tr id="row_3_0_0_" class="even" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_3_0_0_" class="arrow" onclick="dynsection.toggleFolder('3_0_0_')">&#9658;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespacepocketfft_1_1detail_1_1threading.html" target="_self">threading</a></td><td class="desc"></td></tr>
<tr id="row_3_0_0_0_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structpocketfft_1_1detail_1_1threading_1_1aligned__allocator.html" target="_self">aligned_allocator</a></td><td class="desc"></td></tr>
<tr id="row_3_0_0_1_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1threading_1_1concurrent__queue.html" target="_self">concurrent_queue</a></td><td class="desc"></td></tr>
<tr id="row_3_0_0_2_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1threading_1_1latch.html" target="_self">latch</a></td><td class="desc"></td></tr>
<tr id="row_3_0_0_3_" class="even" style="display:none;"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1threading_1_1thread__pool.html" target="_self">thread_pool</a></td><td class="desc"></td></tr>
<tr id="row_3_0_1_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structpocketfft_1_1detail_1_1add__vec.html" target="_self">add_vec</a></td><td class="desc"></td></tr>
<tr id="row_3_0_2_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structpocketfft_1_1detail_1_1add__vec_3_01cmplx_3_01_t_01_4_01_4.html" target="_self">add_vec&lt; cmplx&lt; T &gt; &gt;</a></td><td class="desc"></td></tr>
<tr id="row_3_0_3_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1arr.html" target="_self">arr</a></td><td class="desc"></td></tr>
<tr id="row_3_0_4_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1arr__info.html" target="_self">arr_info</a></td><td class="desc"></td></tr>
<tr id="row_3_0_5_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1cfftp.html" target="_self">cfftp</a></td><td class="desc"></td></tr>
<tr id="row_3_0_6_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structpocketfft_1_1detail_1_1cmplx.html" target="_self">cmplx</a></td><td class="desc"></td></tr>
<tr id="row_3_0_7_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1cndarr.html" target="_self">cndarr</a></td><td class="desc"></td></tr>
<tr id="row_3_0_8_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structpocketfft_1_1detail_1_1_exec_c2_c.html" target="_self">ExecC2C</a></td><td class="desc"></td></tr>
<tr id="row_3_0_9_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structpocketfft_1_1detail_1_1_exec_dcst.html" target="_self">ExecDcst</a></td><td class="desc"></td></tr>
<tr id="row_3_0_10_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structpocketfft_1_1detail_1_1_exec_hartley.html" target="_self">ExecHartley</a></td><td class="desc"></td></tr>
<tr id="row_3_0_11_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structpocketfft_1_1detail_1_1_exec_r2_r.html" target="_self">ExecR2R</a></td><td class="desc"></td></tr>
<tr id="row_3_0_12_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1fftblue.html" target="_self">fftblue</a></td><td class="desc"></td></tr>
<tr id="row_3_0_13_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1multi__iter.html" target="_self">multi_iter</a></td><td class="desc"></td></tr>
<tr id="row_3_0_14_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1ndarr.html" target="_self">ndarr</a></td><td class="desc"></td></tr>
<tr id="row_3_0_15_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1pocketfft__c.html" target="_self">pocketfft_c</a></td><td class="desc"></td></tr>
<tr id="row_3_0_16_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1pocketfft__r.html" target="_self">pocketfft_r</a></td><td class="desc"></td></tr>
<tr id="row_3_0_17_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1rev__iter.html" target="_self">rev_iter</a></td><td class="desc"></td></tr>
<tr id="row_3_0_18_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1rfftp.html" target="_self">rfftp</a></td><td class="desc"></td></tr>
<tr id="row_3_0_19_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1simple__iter.html" target="_self">simple_iter</a></td><td class="desc"></td></tr>
<tr id="row_3_0_20_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1sincos__2pibyn.html" target="_self">sincos_2pibyn</a></td><td class="desc"></td></tr>
<tr id="row_3_0_21_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1_t__dcst23.html" target="_self">T_dcst23</a></td><td class="desc"></td></tr>
<tr id="row_3_0_22_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1_t__dcst4.html" target="_self">T_dcst4</a></td><td class="desc"></td></tr>
<tr id="row_3_0_23_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1_t__dct1.html" target="_self">T_dct1</a></td><td class="desc"></td></tr>
<tr id="row_3_0_24_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classpocketfft_1_1detail_1_1_t__dst1.html" target="_self">T_dst1</a></td><td class="desc"></td></tr>
<tr id="row_3_0_25_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structpocketfft_1_1detail_1_1util.html" target="_self">util</a></td><td class="desc"></td></tr>
<tr id="row_3_0_26_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structpocketfft_1_1detail_1_1_v_l_e_n.html" target="_self">VLEN</a></td><td class="desc"></td></tr>
<tr id="row_3_0_27_" class="even" style="display:none;"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structpocketfft_1_1detail_1_1_v_t_y_p_e.html" target="_self">VTYPE</a></td><td class="desc"></td></tr>
<tr id="row_4_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_4_" class="arrow" onclick="dynsection.toggleFolder('4_')">&#9658;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct___m_l_x___b_float16.html" target="_self">_MLX_BFloat16</a></td><td class="desc"></td></tr>
<tr id="row_4_0_" class="odd" style="display:none;"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct___m_l_x___b_float16_1_1bits__to__bfloat__struct.html" target="_self">bits_to_bfloat_struct</a></td><td class="desc"></td></tr>
<tr id="row_5_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct___no_mask.html" target="_self">_NoMask</a></td><td class="desc"></td></tr>
<tr id="row_6_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_abs.html" target="_self">Abs</a></td><td class="desc"></td></tr>
<tr id="row_7_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_add.html" target="_self">Add</a></td><td class="desc"></td></tr>
<tr id="row_8_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_and.html" target="_self">And</a></td><td class="desc"></td></tr>
<tr id="row_9_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_arc_cos.html" target="_self">ArcCos</a></td><td class="desc"></td></tr>
<tr id="row_10_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_arc_cosh.html" target="_self">ArcCosh</a></td><td class="desc"></td></tr>
<tr id="row_11_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_arc_sin.html" target="_self">ArcSin</a></td><td class="desc"></td></tr>
<tr id="row_12_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_arc_sinh.html" target="_self">ArcSinh</a></td><td class="desc"></td></tr>
<tr id="row_13_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_arc_tan.html" target="_self">ArcTan</a></td><td class="desc"></td></tr>
<tr id="row_14_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_arc_tan2.html" target="_self">ArcTan2</a></td><td class="desc"></td></tr>
<tr id="row_15_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_arc_tanh.html" target="_self">ArcTanh</a></td><td class="desc"></td></tr>
<tr id="row_16_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_bitwise_and.html" target="_self">BitwiseAnd</a></td><td class="desc"></td></tr>
<tr id="row_17_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_bitwise_or.html" target="_self">BitwiseOr</a></td><td class="desc"></td></tr>
<tr id="row_18_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_bitwise_xor.html" target="_self">BitwiseXor</a></td><td class="desc"></td></tr>
<tr id="row_19_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_block_merge_sort.html" target="_self">BlockMergeSort</a></td><td class="desc"></td></tr>
<tr id="row_20_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="unionbool4__or__uint.html" target="_self">bool4_or_uint</a></td><td class="desc"></td></tr>
<tr id="row_21_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_ceil.html" target="_self">Ceil</a></td><td class="desc"></td></tr>
<tr id="row_22_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structcomplex64__t.html" target="_self">complex64_t</a></td><td class="desc"></td></tr>
<tr id="row_23_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_conjugate.html" target="_self">Conjugate</a></td><td class="desc"></td></tr>
<tr id="row_24_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_cos.html" target="_self">Cos</a></td><td class="desc"></td></tr>
<tr id="row_25_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_cosh.html" target="_self">Cosh</a></td><td class="desc"></td></tr>
<tr id="row_26_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_cum_max.html" target="_self">CumMax</a></td><td class="desc"></td></tr>
<tr id="row_27_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_cum_min.html" target="_self">CumMin</a></td><td class="desc"></td></tr>
<tr id="row_28_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_cum_prod.html" target="_self">CumProd</a></td><td class="desc"></td></tr>
<tr id="row_29_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_cum_prod_3_01bool_01_4.html" target="_self">CumProd&lt; bool &gt;</a></td><td class="desc"></td></tr>
<tr id="row_30_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_cum_sum.html" target="_self">CumSum</a></td><td class="desc"></td></tr>
<tr id="row_31_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_divide.html" target="_self">Divide</a></td><td class="desc"></td></tr>
<tr id="row_32_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_div_mod.html" target="_self">DivMod</a></td><td class="desc"></td></tr>
<tr id="row_33_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_equal.html" target="_self">Equal</a></td><td class="desc"></td></tr>
<tr id="row_34_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_erf.html" target="_self">Erf</a></td><td class="desc"></td></tr>
<tr id="row_35_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_erf_inv.html" target="_self">ErfInv</a></td><td class="desc"></td></tr>
<tr id="row_36_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_exp.html" target="_self">Exp</a></td><td class="desc"></td></tr>
<tr id="row_37_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_expm1.html" target="_self">Expm1</a></td><td class="desc"></td></tr>
<tr id="row_38_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_floor.html" target="_self">Floor</a></td><td class="desc"></td></tr>
<tr id="row_39_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_floor_divide.html" target="_self">FloorDivide</a></td><td class="desc"></td></tr>
<tr id="row_40_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_greater.html" target="_self">Greater</a></td><td class="desc"></td></tr>
<tr id="row_41_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_greater_equal.html" target="_self">GreaterEqual</a></td><td class="desc"></td></tr>
<tr id="row_42_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_indices.html" target="_self">Indices</a></td><td class="desc"></td></tr>
<tr id="row_43_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_kernel_merge_sort.html" target="_self">KernelMergeSort</a></td><td class="desc"></td></tr>
<tr id="row_44_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_kernel_multi_block_merge_sort.html" target="_self">KernelMultiBlockMergeSort</a></td><td class="desc"></td></tr>
<tr id="row_45_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_left_shift.html" target="_self">LeftShift</a></td><td class="desc"></td></tr>
<tr id="row_46_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_less.html" target="_self">Less</a></td><td class="desc"></td></tr>
<tr id="row_47_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_less_equal.html" target="_self">LessEqual</a></td><td class="desc"></td></tr>
<tr id="row_48_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_less_than.html" target="_self">LessThan</a></td><td class="desc"></td></tr>
<tr id="row_49_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits.html" target="_self">Limits</a></td><td class="desc"></td></tr>
<tr id="row_50_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits_3_01bfloat16__t_01_4.html" target="_self">Limits&lt; bfloat16_t &gt;</a></td><td class="desc"></td></tr>
<tr id="row_51_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits_3_01bool_01_4.html" target="_self">Limits&lt; bool &gt;</a></td><td class="desc"></td></tr>
<tr id="row_52_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits_3_01float_01_4.html" target="_self">Limits&lt; float &gt;</a></td><td class="desc"></td></tr>
<tr id="row_53_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits_3_01half_01_4.html" target="_self">Limits&lt; half &gt;</a></td><td class="desc"></td></tr>
<tr id="row_54_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits_3_01int16__t_01_4.html" target="_self">Limits&lt; int16_t &gt;</a></td><td class="desc"></td></tr>
<tr id="row_55_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits_3_01int32__t_01_4.html" target="_self">Limits&lt; int32_t &gt;</a></td><td class="desc"></td></tr>
<tr id="row_56_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits_3_01int64__t_01_4.html" target="_self">Limits&lt; int64_t &gt;</a></td><td class="desc"></td></tr>
<tr id="row_57_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits_3_01int8__t_01_4.html" target="_self">Limits&lt; int8_t &gt;</a></td><td class="desc"></td></tr>
<tr id="row_58_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits_3_01uint16__t_01_4.html" target="_self">Limits&lt; uint16_t &gt;</a></td><td class="desc"></td></tr>
<tr id="row_59_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits_3_01uint32__t_01_4.html" target="_self">Limits&lt; uint32_t &gt;</a></td><td class="desc"></td></tr>
<tr id="row_60_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits_3_01uint64__t_01_4.html" target="_self">Limits&lt; uint64_t &gt;</a></td><td class="desc"></td></tr>
<tr id="row_61_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_limits_3_01uint8__t_01_4.html" target="_self">Limits&lt; uint8_t &gt;</a></td><td class="desc"></td></tr>
<tr id="row_62_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_log.html" target="_self">Log</a></td><td class="desc"></td></tr>
<tr id="row_63_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_log10.html" target="_self">Log10</a></td><td class="desc"></td></tr>
<tr id="row_64_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_log1p.html" target="_self">Log1p</a></td><td class="desc"></td></tr>
<tr id="row_65_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_log2.html" target="_self">Log2</a></td><td class="desc"></td></tr>
<tr id="row_66_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_log_add_exp.html" target="_self">LogAddExp</a></td><td class="desc"></td></tr>
<tr id="row_67_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_logical_and.html" target="_self">LogicalAnd</a></td><td class="desc"></td></tr>
<tr id="row_68_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_logical_not.html" target="_self">LogicalNot</a></td><td class="desc"></td></tr>
<tr id="row_69_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_logical_or.html" target="_self">LogicalOr</a></td><td class="desc"></td></tr>
<tr id="row_70_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_max.html" target="_self">Max</a></td><td class="desc"></td></tr>
<tr id="row_71_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_maximum.html" target="_self">Maximum</a></td><td class="desc"></td></tr>
<tr id="row_72_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_min.html" target="_self">Min</a></td><td class="desc"></td></tr>
<tr id="row_73_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_minimum.html" target="_self">Minimum</a></td><td class="desc"></td></tr>
<tr id="row_74_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx__atomic.html" target="_self">mlx_atomic</a></td><td class="desc"></td></tr>
<tr id="row_75_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmlx__atomic_3_01_t_00_01enable__if__t_3_01is__metal__atomic_3_01_t_01_4_01_4_01_4.html" target="_self">mlx_atomic&lt; T, enable_if_t&lt; is_metal_atomic&lt; T &gt; &gt; &gt;</a></td><td class="desc"></td></tr>
<tr id="row_76_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_m_l_x_conv_params.html" target="_self">MLXConvParams</a></td><td class="desc"></td></tr>
<tr id="row_77_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_m_l_x_fast_attention_params.html" target="_self">MLXFastAttentionParams</a></td><td class="desc"></td></tr>
<tr id="row_78_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_m_l_x_scaled_dot_product_attention_params.html" target="_self">MLXScaledDotProductAttentionParams</a></td><td class="desc"></td></tr>
<tr id="row_79_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_multiply.html" target="_self">Multiply</a></td><td class="desc"></td></tr>
<tr id="row_80_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_na_n_equal.html" target="_self">NaNEqual</a></td><td class="desc"></td></tr>
<tr id="row_81_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_negative.html" target="_self">Negative</a></td><td class="desc"></td></tr>
<tr id="row_82_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_none.html" target="_self">None</a></td><td class="desc"></td></tr>
<tr id="row_83_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_not_equal.html" target="_self">NotEqual</a></td><td class="desc"></td></tr>
<tr id="row_84_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_or.html" target="_self">Or</a></td><td class="desc"></td></tr>
<tr id="row_85_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_power.html" target="_self">Power</a></td><td class="desc"></td></tr>
<tr id="row_86_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_prod.html" target="_self">Prod</a></td><td class="desc"></td></tr>
<tr id="row_87_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_read_writer.html" target="_self">ReadWriter</a></td><td class="desc"></td></tr>
<tr id="row_88_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_remainder.html" target="_self">Remainder</a></td><td class="desc"></td></tr>
<tr id="row_89_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_right_shift.html" target="_self">RightShift</a></td><td class="desc"></td></tr>
<tr id="row_90_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_round.html" target="_self">Round</a></td><td class="desc"></td></tr>
<tr id="row_91_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_rsqrt.html" target="_self">Rsqrt</a></td><td class="desc"></td></tr>
<tr id="row_92_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_scale_op.html" target="_self">ScaleOp</a></td><td class="desc"></td></tr>
<tr id="row_93_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_select.html" target="_self">Select</a></td><td class="desc"></td></tr>
<tr id="row_94_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sigmoid.html" target="_self">Sigmoid</a></td><td class="desc"></td></tr>
<tr id="row_95_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sign.html" target="_self">Sign</a></td><td class="desc"></td></tr>
<tr id="row_96_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sin.html" target="_self">Sin</a></td><td class="desc"></td></tr>
<tr id="row_97_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sinh.html" target="_self">Sinh</a></td><td class="desc"></td></tr>
<tr id="row_98_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sqrt.html" target="_self">Sqrt</a></td><td class="desc"></td></tr>
<tr id="row_99_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_square.html" target="_self">Square</a></td><td class="desc"></td></tr>
<tr id="row_100_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_subtract.html" target="_self">Subtract</a></td><td class="desc"></td></tr>
<tr id="row_101_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sum.html" target="_self">Sum</a></td><td class="desc"></td></tr>
<tr id="row_102_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_tan.html" target="_self">Tan</a></td><td class="desc"></td></tr>
<tr id="row_103_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_tanh.html" target="_self">Tanh</a></td><td class="desc"></td></tr>
<tr id="row_104_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_thread_sort.html" target="_self">ThreadSort</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

138
docs/build/html/array_8h.html vendored Normal file
View File

@@ -0,0 +1,138 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/array.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#var-members">Variables</a> </div>
<div class="headertitle"><div class="title">array.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;algorithm&gt;</code><br />
<code>#include &lt;cstdint&gt;</code><br />
<code>#include &lt;functional&gt;</code><br />
<code>#include &lt;memory&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
<code>#include &quot;<a class="el" href="allocator_8h_source.html">mlx/allocator.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="dtype_8h_source.html">mlx/dtype.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="event_8h_source.html">mlx/event.h</a>&quot;</code><br />
</div>
<p><a href="array_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1array.html">mlx::core::array</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1array_1_1_array_iterator.html">mlx::core::array::ArrayIterator</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1array_1_1_data.html">mlx::core::array::Data</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1array_1_1_flags.html">mlx::core::array::Flags</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacemlx" id="r_namespacemlx"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx.html">mlx</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1core" id="r_namespacemlx_1_1core"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html">mlx::core</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a1e6cec03ebd80fd2d6b12b288367bfa8" id="r_a1e6cec03ebd80fd2d6b12b288367bfa8"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html#a1e6cec03ebd80fd2d6b12b288367bfa8">mlx::core::deleter_t</a> = std::function&lt;void(<a class="el" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">allocator::Buffer</a>)&gt;</td></tr>
<tr class="separator:a1e6cec03ebd80fd2d6b12b288367bfa8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af89751d79339f3e4d9318ea97d64d114" id="r_af89751d79339f3e4d9318ea97d64d114"><td class="memTemplParams" colspan="2">template&lt;typename... T&gt; </td></tr>
<tr class="memitem:af89751d79339f3e4d9318ea97d64d114"><td class="memTemplItemLeft" align="right" valign="top">using&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html#af89751d79339f3e4d9318ea97d64d114">mlx::core::enable_for_arrays_t</a> = typename std::enable_if_t&lt;<a class="el" href="namespacemlx_1_1core.html#a94c1057929b390e5613304afa16dfbda">is_arrays_v</a>&lt;T...&gt;&gt;</td></tr>
<tr class="separator:af89751d79339f3e4d9318ea97d64d114"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a01b0d64a75dfa2e95d6c7b5c53d708af" id="r_a01b0d64a75dfa2e95d6c7b5c53d708af"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a01b0d64a75dfa2e95d6c7b5c53d708af"><td class="memTemplItemLeft" align="right" valign="top">constexpr bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html#a01b0d64a75dfa2e95d6c7b5c53d708af">mlx::core::is_array_v</a></td></tr>
<tr class="separator:a01b0d64a75dfa2e95d6c7b5c53d708af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94c1057929b390e5613304afa16dfbda" id="r_a94c1057929b390e5613304afa16dfbda"><td class="memTemplParams" colspan="2">template&lt;typename... T&gt; </td></tr>
<tr class="memitem:a94c1057929b390e5613304afa16dfbda"><td class="memTemplItemLeft" align="right" valign="top">constexpr bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html#a94c1057929b390e5613304afa16dfbda">mlx::core::is_arrays_v</a> = (<a class="el" href="namespacemlx_1_1core.html#a01b0d64a75dfa2e95d6c7b5c53d708af">is_array_v</a>&lt;T&gt; &amp;&amp; ...)</td></tr>
<tr class="separator:a94c1057929b390e5613304afa16dfbda"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

842
docs/build/html/array_8h_source.html vendored Normal file
View File

@@ -0,0 +1,842 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/array.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">array.h</div></div>
</div><!--header-->
<div class="contents">
<a href="array_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</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;cstdint&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;<a class="code" href="allocator_8h.html">mlx/allocator.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;<a class="code" href="dtype_8h.html">mlx/dtype.h</a>&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &quot;<a class="code" href="event_8h.html">mlx/event.h</a>&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemlx_1_1core.html">mlx::core</a> {</div>
<div class="line"><a id="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="comment">// Forward declaration</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="keyword">class </span>Primitive;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a1e6cec03ebd80fd2d6b12b288367bfa8"> 18</a></span><span class="keyword">using </span><a class="code hl_typedef" href="namespacemlx_1_1core.html#a1e6cec03ebd80fd2d6b12b288367bfa8">deleter_t</a> = std::function&lt;void(<a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">allocator::Buffer</a>)&gt;;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
<div class="foldopen" id="foldopen00020" data-start="{" data-end="};">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html"> 20</a></span><span class="keyword">class </span><a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a> {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="comment">/* An array is really a node in a graph. It contains a shared ArrayDesc</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment"> * object */</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keyword">public</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&gt;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keyword">explicit</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a75fac72da3ce214fa3737df92a64b232">array</a>(T val, <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a> = <a class="code hl_struct" href="structmlx_1_1core_1_1_type_to_dtype.html">TypeToDtype&lt;T&gt;</a>());</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="comment">/* Special case since std::complex can&#39;t be implicitly converted to other</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="comment"> * types. */</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a6db4b8c28c767cc16ad2785ece496dca"> 31</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a6db4b8c28c767cc16ad2785ece496dca">array</a>(<span class="keyword">const</span> std::complex&lt;float&gt;&amp; val, <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a> = <a class="code hl_variable" href="namespacemlx_1_1core.html#af99db87e0078bfcdb383f5689bc874d4">complex64</a>);</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> It&gt;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a75fac72da3ce214fa3737df92a64b232">array</a>(</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> It <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>,</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> std::vector&lt;int&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a4a2a2c8a4a5beafd723fc13f2055d55d">shape</a>,</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a> =</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_1_type_to_dtype.html">TypeToDtype</a>&lt;<span class="keyword">typename</span> std::iterator_traits&lt;It&gt;::value_type&gt;());</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a75fac72da3ce214fa3737df92a64b232">array</a>(std::initializer_list&lt;T&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>, <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a> = <a class="code hl_struct" href="structmlx_1_1core_1_1_type_to_dtype.html">TypeToDtype&lt;T&gt;</a>());</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="comment">/* Special case so empty lists default to float32. */</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a46642301da11e3eb4312c37349fbc9d7"> 44</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a46642301da11e3eb4312c37349fbc9d7">array</a>(std::initializer_list&lt;float&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>);</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="comment">/* Special case so array({}, type) is an empty array. */</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a5e1812029394bfb1a706c83611286f49"> 47</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a5e1812029394bfb1a706c83611286f49">array</a>(std::initializer_list&lt;int&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>, <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a>);</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> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a75fac72da3ce214fa3737df92a64b232">array</a>(</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> std::initializer_list&lt;T&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>,</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> std::vector&lt;int&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a4a2a2c8a4a5beafd723fc13f2055d55d">shape</a>,</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a> = <a class="code hl_struct" href="structmlx_1_1core_1_1_type_to_dtype.html">TypeToDtype&lt;T&gt;</a>());</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="comment">/* Build an array from a buffer */</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a5b5f562ff14c150842cb61628e531663"> 56</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a5b5f562ff14c150842cb61628e531663">array</a>(</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">allocator::Buffer</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>,</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> std::vector&lt;int&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a4a2a2c8a4a5beafd723fc13f2055d55d">shape</a>,</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a>,</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <a class="code hl_typedef" href="namespacemlx_1_1core.html#a1e6cec03ebd80fd2d6b12b288367bfa8">deleter_t</a> deleter = <a class="code hl_function" href="namespacemlx_1_1core_1_1allocator.html#a77f0a1215be242db6485612bcb273af5">allocator::free</a>);</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a8acf2b4c75f9b7f79da6675dbc36cf36"> 63</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a8acf2b4c75f9b7f79da6675dbc36cf36">operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; other) &amp;&amp; = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a5c89c2406a610b32943955f9a5060fbd"> 64</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a5c89c2406a610b32943955f9a5060fbd">operator=</a>(<a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp;&amp; other) &amp;&amp; = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#ad3277ff68f1336aa217f9cbe40181479"> 67</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ad3277ff68f1336aa217f9cbe40181479">operator=</a>(<a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp;&amp; other) &amp; = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a297df274e2da5cb884257bbeffd6b187"> 68</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a297df274e2da5cb884257bbeffd6b187">array</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; other) = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#ab6cbccbba66cc54acda4390b19f0397c"> 69</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ab6cbccbba66cc54acda4390b19f0397c">array</a>(<a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp;&amp; other) = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
<div class="foldopen" id="foldopen00071" data-start="{" data-end="}">
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a5da41aabecf4c8055b7515341bf57147"> 71</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a5da41aabecf4c8055b7515341bf57147">operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; other) &amp; {</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">if</span> (this-&gt;<span class="keywordtype">id</span>() != other.id()) {</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> this-&gt;array_desc_ = other.array_desc_;</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"> 75</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> };</div>
</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="foldopen" id="foldopen00079" data-start="{" data-end="}">
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#af329d9432c92de87cbaa2de8454eefc0"> 79</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#af329d9432c92de87cbaa2de8454eefc0">itemsize</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemlx_1_1core.html#add4794cc0ffe5d717fc146084a235d95">size_of</a>(<a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a>());</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> };</div>
</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
<div class="foldopen" id="foldopen00084" data-start="{" data-end="}">
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6"> 84</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">return</span> array_desc_-&gt;size;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> };</div>
</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
<div class="foldopen" id="foldopen00089" data-start="{" data-end="}">
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a387b67cd3ef5cfc1e749c371766c4a05"> 89</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a387b67cd3ef5cfc1e749c371766c4a05">nbytes</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>() * <a class="code hl_function" href="classmlx_1_1core_1_1array.html#af329d9432c92de87cbaa2de8454eefc0">itemsize</a>();</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> };</div>
</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
<div class="foldopen" id="foldopen00094" data-start="{" data-end="}">
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a53006e77d13d9d88b525ef577748939f"> 94</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a53006e77d13d9d88b525ef577748939f">ndim</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordflow">return</span> array_desc_-&gt;shape.size();</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> };</div>
</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> </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="classmlx_1_1core_1_1array.html#a4a2a2c8a4a5beafd723fc13f2055d55d"> 99</a></span> <span class="keyword">const</span> std::vector&lt;int&gt;&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a4a2a2c8a4a5beafd723fc13f2055d55d">shape</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordflow">return</span> array_desc_-&gt;shape;</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="foldopen" id="foldopen00108" data-start="{" data-end="}">
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a51ed0c45666264dc172d06fba159eb8f"> 108</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a51ed0c45666264dc172d06fba159eb8f">shape</a>(<span class="keywordtype">int</span> dim)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a4a2a2c8a4a5beafd723fc13f2055d55d">shape</a>().at(dim &lt; 0 ? dim + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a53006e77d13d9d88b525ef577748939f">ndim</a>() : dim);</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> </div>
<div class="foldopen" id="foldopen00113" data-start="{" data-end="}">
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a186cf2648da92584d5c1c8b24e69629b"> 113</a></span> <span class="keyword">const</span> std::vector&lt;size_t&gt;&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a186cf2648da92584d5c1c8b24e69629b">strides</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keywordflow">return</span> array_desc_-&gt;strides;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> };</div>
</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> </div>
<div class="foldopen" id="foldopen00122" data-start="{" data-end="}">
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a919f850ca087d1c40aa68f854cb30be2"> 122</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a919f850ca087d1c40aa68f854cb30be2">strides</a>(<span class="keywordtype">int</span> dim)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a186cf2648da92584d5c1c8b24e69629b">strides</a>().at(dim &lt; 0 ? dim + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a53006e77d13d9d88b525ef577748939f">ndim</a>() : dim);</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> };</div>
</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> </div>
<div class="foldopen" id="foldopen00127" data-start="{" data-end="}">
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd"> 127</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordflow">return</span> array_desc_-&gt;dtype;</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> };</div>
</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a2820c45188071a22175e9fa42e10a49a"> 132</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2820c45188071a22175e9fa42e10a49a">eval</a>();</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> T <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a90c5afddc2fa3028c0f8099bd64c8a99">item</a>();</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> </div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> T <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a90c5afddc2fa3028c0f8099bd64c8a99">item</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
<div class="foldopen" id="foldopen00141" data-start="{" data-end="};">
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_array_iterator.html"> 141</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_array_iterator.html">ArrayIterator</a> {</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a2cbf481e39164245668b3be6cbcc614d"> 142</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a2cbf481e39164245668b3be6cbcc614d">iterator_category</a> = std::random_access_iterator_tag;</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#adcee44c77980fc2370a2c31e203aead5"> 143</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#adcee44c77980fc2370a2c31e203aead5">difference_type</a> = size_t;</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#ae24fe304397e961687d0d4c7012b8ae4"> 144</a></span> <span class="keyword">using </span><a class="code hl_class" href="classmlx_1_1core_1_1array.html">value_type</a> = <span class="keyword">const</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a75fac72da3ce214fa3737df92a64b232">array</a>;</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a44e2e1f29191c20ec4390de4fa0bd59f"> 145</a></span> <span class="keyword">using </span><a class="code hl_class" href="classmlx_1_1core_1_1array.html">reference</a> = <a class="code hl_typedef" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#ae24fe304397e961687d0d4c7012b8ae4">value_type</a>;</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"><a class="line" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#ad3afcb24c6db7642bbc06835f7f3e27a"> 147</a></span> <span class="keyword">explicit</span> <a class="code hl_function" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#ad3afcb24c6db7642bbc06835f7f3e27a">ArrayIterator</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; arr, <span class="keywordtype">int</span> idx = 0);</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a153756072fda6d3e53bcca11b46a1238"> 149</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">reference</a> <a class="code hl_function" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a153756072fda6d3e53bcca11b46a1238">operator*</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> </div>
<div class="foldopen" id="foldopen00151" data-start="{" data-end="}">
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#ae2adde594b5a4853f6bc78263a957d85"> 151</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_array_iterator.html">ArrayIterator</a>&amp; <a class="code hl_function" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#ae2adde594b5a4853f6bc78263a957d85">operator+</a>(<a class="code hl_typedef" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#adcee44c77980fc2370a2c31e203aead5">difference_type</a> diff) {</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> idx += diff;</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> }</div>
</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> </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="structmlx_1_1core_1_1array_1_1_array_iterator.html#a3efe69356a84d0d4438f033992fcbd9d"> 156</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_array_iterator.html">ArrayIterator</a>&amp; <a class="code hl_function" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a3efe69356a84d0d4438f033992fcbd9d">operator++</a>() {</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> idx++;</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</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="foldopen" id="foldopen00161" data-start="{" data-end="};">
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a1afd6d2a19a2b0d712063f221ab4eba7"> 161</a></span> <span class="keyword">friend</span> <span class="keywordtype">bool</span> <a class="code hl_friend" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a1afd6d2a19a2b0d712063f221ab4eba7">operator==</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_array_iterator.html">ArrayIterator</a>&amp; a, <span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_array_iterator.html">ArrayIterator</a>&amp; b) {</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="keywordflow">return</span> a.arr.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#adfa53f3f26bb0f942fb1c67ec8cd5380">id</a>() == b.arr.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#adfa53f3f26bb0f942fb1c67ec8cd5380">id</a>() &amp;&amp; a.idx == b.idx;</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> };</div>
</div>
<div class="foldopen" id="foldopen00164" data-start="{" data-end="};">
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a971aa511ab2e7ae1caae09556643a0bd"> 164</a></span> <span class="keyword">friend</span> <span class="keywordtype">bool</span> <a class="code hl_friend" href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a971aa511ab2e7ae1caae09556643a0bd">operator!=</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_array_iterator.html">ArrayIterator</a>&amp; a, <span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_array_iterator.html">ArrayIterator</a>&amp; b) {</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keywordflow">return</span> !(a == b);</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> };</div>
</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; arr;</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keywordtype">int</span> idx;</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="foldopen" id="foldopen00173" data-start="{" data-end="}">
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a76b258b169d7d73419ebbf85340fb914"> 173</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_array_iterator.html">ArrayIterator</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a76b258b169d7d73419ebbf85340fb914">begin</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_array_iterator.html">ArrayIterator</a>(*<span class="keyword">this</span>);</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> }</div>
</div>
<div class="foldopen" id="foldopen00176" data-start="{" data-end="}">
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a5daf64552fb450825c9b382f3a5fa2d4"> 176</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_array_iterator.html">ArrayIterator</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a5daf64552fb450825c9b382f3a5fa2d4">end</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_array_iterator.html">ArrayIterator</a>(*<span class="keyword">this</span>, <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a4a2a2c8a4a5beafd723fc13f2055d55d">shape</a>(0));</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> }</div>
</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> </div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#adaade8f4bb7f8ecc0ba07efb17cd2620"> 186</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#adaade8f4bb7f8ecc0ba07efb17cd2620">array</a>(</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> std::vector&lt;int&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a4a2a2c8a4a5beafd723fc13f2055d55d">shape</a>,</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a>,</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> std::shared_ptr&lt;Primitive&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a790548666511d8c6d9f92ee79d2ce14c">primitive</a>,</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> std::vector&lt;array&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2913abcdf71826827c8457f529825fff">inputs</a>);</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> </div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a1173db4e23f5a8230911cb8fba45d5e6"> 192</a></span> <span class="keyword">static</span> std::vector&lt;array&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a1173db4e23f5a8230911cb8fba45d5e6">make_arrays</a>(</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> std::vector&lt;std::vector&lt;int&gt;&gt; shapes,</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="keyword">const</span> std::vector&lt;Dtype&gt;&amp; dtypes,</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <span class="keyword">const</span> std::shared_ptr&lt;Primitive&gt;&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a790548666511d8c6d9f92ee79d2ce14c">primitive</a>,</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="keyword">const</span> std::vector&lt;array&gt;&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2913abcdf71826827c8457f529825fff">inputs</a>);</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> </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="classmlx_1_1core_1_1array.html#adfa53f3f26bb0f942fb1c67ec8cd5380"> 199</a></span> std::uintptr_t <a class="code hl_function" href="classmlx_1_1core_1_1array.html#adfa53f3f26bb0f942fb1c67ec8cd5380">id</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keywordflow">return</span> <span class="keyword">reinterpret_cast&lt;</span>std::uintptr_t<span class="keyword">&gt;</span>(array_desc_.get());</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="foldopen00204" data-start="{" data-end="}">
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#af5ad83605d4eea81561246873bee1d7c"> 204</a></span> std::uintptr_t <a class="code hl_function" href="classmlx_1_1core_1_1array.html#af5ad83605d4eea81561246873bee1d7c">primitive_id</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> <span class="keywordflow">return</span> <span class="keyword">reinterpret_cast&lt;</span>std::uintptr_t<span class="keyword">&gt;</span>(array_desc_-&gt;primitive.get());</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> }</div>
</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> </div>
<div class="foldopen" id="foldopen00208" data-start="{" data-end="};">
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_data.html"> 208</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_data.html">Data</a> {</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_data.html#a9a51e2d12ba505027cc0fca86bdd39ad"> 209</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">allocator::Buffer</a> <a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_data.html#a9a51e2d12ba505027cc0fca86bdd39ad">buffer</a>;</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_data.html#a25f52ac67912a49bb6e2b6715aa65311"> 210</a></span> <a class="code hl_typedef" href="namespacemlx_1_1core.html#a1e6cec03ebd80fd2d6b12b288367bfa8">deleter_t</a> <a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_data.html#a25f52ac67912a49bb6e2b6715aa65311">d</a>;</div>
<div class="foldopen" id="foldopen00211" data-start="{" data-end="}">
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_data.html#a77e2ea35fac1d54e4062468a432e1482"> 211</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1array_1_1_data.html#a77e2ea35fac1d54e4062468a432e1482">Data</a>(<a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">allocator::Buffer</a> <a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_data.html#a9a51e2d12ba505027cc0fca86bdd39ad">buffer</a>, <a class="code hl_typedef" href="namespacemlx_1_1core.html#a1e6cec03ebd80fd2d6b12b288367bfa8">deleter_t</a> <a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_data.html#a25f52ac67912a49bb6e2b6715aa65311">d</a> = <a class="code hl_function" href="namespacemlx_1_1core_1_1allocator.html#a77f0a1215be242db6485612bcb273af5">allocator::free</a>)</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> : <a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_data.html#a9a51e2d12ba505027cc0fca86bdd39ad">buffer</a>(<a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_data.html#a9a51e2d12ba505027cc0fca86bdd39ad">buffer</a>), <a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_data.html#a25f52ac67912a49bb6e2b6715aa65311">d</a>(<a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_data.html#a25f52ac67912a49bb6e2b6715aa65311">d</a>) {};</div>
</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> <span class="comment">// Not copyable</span></div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_data.html#a50f242040b123052e48e18c244ff70fc"> 214</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1array_1_1_data.html#a50f242040b123052e48e18c244ff70fc">Data</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_data.html">Data</a>&amp; <a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_data.html#a25f52ac67912a49bb6e2b6715aa65311">d</a>) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_data.html#a68e9417954fe811b5e41e6317a526748"> 215</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_data.html">Data</a>&amp; <a class="code hl_function" href="structmlx_1_1core_1_1array_1_1_data.html#a68e9417954fe811b5e41e6317a526748">operator=</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_data.html">Data</a>&amp; <a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_data.html#a25f52ac67912a49bb6e2b6715aa65311">d</a>) = <span class="keyword">delete</span>;</div>
<div class="foldopen" id="foldopen00216" data-start="{" data-end="}">
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_data.html#a1cf69d9709206578c4e87e9c1daad5e1"> 216</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1array_1_1_data.html#a1cf69d9709206578c4e87e9c1daad5e1">~Data</a>() {</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> <a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_data.html#a25f52ac67912a49bb6e2b6715aa65311">d</a>(<a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_data.html#a9a51e2d12ba505027cc0fca86bdd39ad">buffer</a>);</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> }</div>
</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> };</div>
</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> </div>
<div class="foldopen" id="foldopen00221" data-start="{" data-end="};">
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_flags.html"> 221</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_flags.html">Flags</a> {</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <span class="comment">// True if there are no gaps in the underlying data. Each item</span></div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> <span class="comment">// in the underlying data buffer belongs to at least one index.</span></div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_flags.html#afd0ab11e7a486a2a8e50ee84b971ac8a"> 224</a></span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_flags.html#afd0ab11e7a486a2a8e50ee84b971ac8a">contiguous</a> : 1;</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> </div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_flags.html#a3170fa381dc7a90f6eabcc029bdf9bfd"> 226</a></span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_flags.html#a3170fa381dc7a90f6eabcc029bdf9bfd">row_contiguous</a> : 1;</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1array_1_1_flags.html#ae24709026598d635e6b5c24a15f8a802"> 227</a></span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_flags.html#ae24709026598d635e6b5c24a15f8a802">col_contiguous</a> : 1;</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> };</div>
</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> </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="classmlx_1_1core_1_1array.html#a790548666511d8c6d9f92ee79d2ce14c"> 231</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1_primitive.html">Primitive</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a790548666511d8c6d9f92ee79d2ce14c">primitive</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="keywordflow">return</span> *(array_desc_-&gt;primitive);</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="foldopen" id="foldopen00236" data-start="{" data-end="}">
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a5119cd616ec3c05d65878944b8889469"> 236</a></span> std::shared_ptr&lt;Primitive&gt;&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a5119cd616ec3c05d65878944b8889469">primitive_ptr</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> <span class="keywordflow">return</span> array_desc_-&gt;primitive;</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="foldopen" id="foldopen00241" data-start="{" data-end="}">
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#aa5aceab15241e7826cbaf8b8a41440c1"> 241</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#aa5aceab15241e7826cbaf8b8a41440c1">has_primitive</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> <span class="keywordflow">return</span> array_desc_-&gt;primitive != <span class="keyword">nullptr</span>;</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="foldopen" id="foldopen00246" data-start="{" data-end="}">
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a2913abcdf71826827c8457f529825fff"> 246</a></span> <span class="keyword">const</span> std::vector&lt;array&gt;&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2913abcdf71826827c8457f529825fff">inputs</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> <span class="keywordflow">return</span> array_desc_-&gt;inputs;</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> };</div>
</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> </div>
<div class="foldopen" id="foldopen00250" data-start="{" data-end="}">
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#acffb082177f9b78f0c52e406adff972f"> 250</a></span> std::vector&lt;array&gt;&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#acffb082177f9b78f0c52e406adff972f">inputs</a>() {</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> <span class="keywordflow">return</span> array_desc_-&gt;inputs;</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> }</div>
</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> </div>
<div class="foldopen" id="foldopen00255" data-start="{" data-end="}">
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a4677a404b5d191af20b52649225de087"> 255</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a4677a404b5d191af20b52649225de087">is_donatable</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> <span class="keywordflow">return</span> array_desc_.use_count() == 1 &amp;&amp; (array_desc_-&gt;data.use_count() == 1);</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> }</div>
</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> </div>
<div class="foldopen" id="foldopen00260" data-start="{" data-end="}">
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#acf80fde8f743f65ad5b4be69fcb7a74d"> 260</a></span> <span class="keyword">const</span> std::vector&lt;array&gt;&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#acf80fde8f743f65ad5b4be69fcb7a74d">siblings</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> <span class="keywordflow">return</span> array_desc_-&gt;siblings;</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> };</div>
</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> </div>
<div class="foldopen" id="foldopen00265" data-start="{" data-end="}">
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a7263f23e70a580a9bc2129fbcde36e6c"> 265</a></span> std::vector&lt;array&gt;&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a7263f23e70a580a9bc2129fbcde36e6c">siblings</a>() {</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> <span class="keywordflow">return</span> array_desc_-&gt;siblings;</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> };</div>
</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> </div>
<div class="foldopen" id="foldopen00269" data-start="{" data-end="}">
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a8fccbe7a4edfd8cca168161124e263b1"> 269</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a8fccbe7a4edfd8cca168161124e263b1">set_siblings</a>(std::vector&lt;array&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#acf80fde8f743f65ad5b4be69fcb7a74d">siblings</a>, uint16_t position) {</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> array_desc_-&gt;siblings = std::move(<a class="code hl_function" href="classmlx_1_1core_1_1array.html#acf80fde8f743f65ad5b4be69fcb7a74d">siblings</a>);</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> array_desc_-&gt;position = position;</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> }</div>
</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> </div>
<div class="foldopen" id="foldopen00276" data-start="{" data-end="}">
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a2c186fd527f984f0589d4183b4976289"> 276</a></span> std::vector&lt;array&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2c186fd527f984f0589d4183b4976289">outputs</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> <span class="keyword">auto</span> idx = array_desc_-&gt;position;</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> std::vector&lt;array&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2c186fd527f984f0589d4183b4976289">outputs</a>;</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2c186fd527f984f0589d4183b4976289">outputs</a>.reserve(<a class="code hl_function" href="classmlx_1_1core_1_1array.html#acf80fde8f743f65ad5b4be69fcb7a74d">siblings</a>().<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>() + 1);</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2c186fd527f984f0589d4183b4976289">outputs</a>.insert(<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2c186fd527f984f0589d4183b4976289">outputs</a>.end(), <a class="code hl_function" href="classmlx_1_1core_1_1array.html#acf80fde8f743f65ad5b4be69fcb7a74d">siblings</a>().<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a76b258b169d7d73419ebbf85340fb914">begin</a>(), <a class="code hl_function" href="classmlx_1_1core_1_1array.html#acf80fde8f743f65ad5b4be69fcb7a74d">siblings</a>().<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a76b258b169d7d73419ebbf85340fb914">begin</a>() + idx);</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2c186fd527f984f0589d4183b4976289">outputs</a>.push_back(*<span class="keyword">this</span>);</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2c186fd527f984f0589d4183b4976289">outputs</a>.insert(<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2c186fd527f984f0589d4183b4976289">outputs</a>.end(), <a class="code hl_function" href="classmlx_1_1core_1_1array.html#acf80fde8f743f65ad5b4be69fcb7a74d">siblings</a>().<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a76b258b169d7d73419ebbf85340fb914">begin</a>() + idx, <a class="code hl_function" href="classmlx_1_1core_1_1array.html#acf80fde8f743f65ad5b4be69fcb7a74d">siblings</a>().<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a5daf64552fb450825c9b382f3a5fa2d4">end</a>());</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2c186fd527f984f0589d4183b4976289">outputs</a>;</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> };</div>
</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> </div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a84948c29df8c957904919c8602692bd2"> 287</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a84948c29df8c957904919c8602692bd2">detach</a>();</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> </div>
<div class="foldopen" id="foldopen00290" data-start="{" data-end="}">
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a0a20a6065ae71b64c1e3aa22a45fd8a1"> 290</a></span> <span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_flags.html">Flags</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a0a20a6065ae71b64c1e3aa22a45fd8a1">flags</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> <span class="keywordflow">return</span> array_desc_-&gt;flags;</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> };</div>
</div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> </div>
<div class="foldopen" id="foldopen00295" data-start="{" data-end="}">
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#afaf2a370fa35d96af1b27a4b814e3bfd"> 295</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#afaf2a370fa35d96af1b27a4b814e3bfd">data_size</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> <span class="keywordflow">return</span> array_desc_-&gt;data_size;</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> };</div>
</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> </div>
<div class="foldopen" id="foldopen00299" data-start="{" data-end="}">
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08"> 299</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">allocator::Buffer</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08">buffer</a>() {</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> <span class="keywordflow">return</span> array_desc_-&gt;data-&gt;buffer;</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> };</div>
</div>
<div class="foldopen" id="foldopen00302" data-start="{" data-end="}">
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a634466ce661485394f2fdc3bd6796bcd"> 302</a></span> <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">allocator::Buffer</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a634466ce661485394f2fdc3bd6796bcd">buffer</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> <span class="keywordflow">return</span> array_desc_-&gt;data-&gt;buffer;</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> };</div>
</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> </div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> <span class="comment">// Return a copy of the shared pointer</span></div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> <span class="comment">// to the array::Data struct</span></div>
<div class="foldopen" id="foldopen00308" data-start="{" data-end="}">
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#ab84c792117e29cdf90ef3433303f6141"> 308</a></span> std::shared_ptr&lt;Data&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ab84c792117e29cdf90ef3433303f6141">data_shared_ptr</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> <span class="keywordflow">return</span> array_desc_-&gt;data;</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> }</div>
</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> <span class="comment">// Return a raw pointer to the arrays data</span></div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00313" data-start="{" data-end="}">
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95"> 313</a></span> T* <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>() {</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T*<span class="keyword">&gt;</span>(array_desc_-&gt;data_ptr);</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> };</div>
</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> </div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00318" data-start="{" data-end="}">
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a99fb28eeab39b9f429373f8bd7557676"> 318</a></span> <span class="keyword">const</span> T* <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a99fb28eeab39b9f429373f8bd7557676">data</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T*<span class="keyword">&gt;</span>(array_desc_-&gt;data_ptr);</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> };</div>
</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> </div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078a308bd3e5bf976888b120dd36d0c2d2ae"> 322</a></span> <span class="keyword">enum</span> <a class="code hl_enumeration" href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078">Status</a> { <a class="code hl_enumvalue" href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078ae8a9988458b0355001674020a45656fb">unscheduled</a>, <a class="code hl_enumvalue" href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078af8a6f8eed2395ab89a758dec434393ae">scheduled</a>, <a class="code hl_enumvalue" href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078a308bd3e5bf976888b120dd36d0c2d2ae">available</a> };</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> </div>
<div class="foldopen" id="foldopen00324" data-start="{" data-end="}">
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#aebed1f37c19197be76105161102a8a40"> 324</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#aebed1f37c19197be76105161102a8a40">is_available</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#add41975ba47933af8e74dde0cc646ec4">status</a>() == <a class="code hl_enumvalue" href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078a308bd3e5bf976888b120dd36d0c2d2ae">Status::available</a>;</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> }</div>
</div>
<div class="foldopen" id="foldopen00327" data-start="{" data-end="}">
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#add41975ba47933af8e74dde0cc646ec4"> 327</a></span> <span class="keyword">const</span> <a class="code hl_enumeration" href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078">Status</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#add41975ba47933af8e74dde0cc646ec4">status</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> <span class="keywordflow">return</span> array_desc_-&gt;status;</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> }</div>
</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</span> </div>
<div class="foldopen" id="foldopen00331" data-start="{" data-end="}">
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a63598018999b49f1340b183cb303f05c"> 331</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a63598018999b49f1340b183cb303f05c">set_status</a>(<a class="code hl_enumeration" href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078">Status</a> s)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span> array_desc_-&gt;status = s;</div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"> 333</span> }</div>
</div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span> </div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> <span class="comment">// Get the array&#39;s shared event</span></div>
<div class="foldopen" id="foldopen00336" data-start="{" data-end="}">
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a0a8e4d6e67e739a712876bb36f88f9bf"> 336</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1_event.html">Event</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a0a8e4d6e67e739a712876bb36f88f9bf">event</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> <span class="keywordflow">return</span> array_desc_-&gt;event;</div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> }</div>
</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> </div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span> <span class="comment">// Attach an event to a not yet evaluated array</span></div>
<div class="foldopen" id="foldopen00341" data-start="{" data-end="}">
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a000c3cfe13cb378bf0523b62816190da"> 341</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a000c3cfe13cb378bf0523b62816190da">attach_event</a>(<a class="code hl_class" href="classmlx_1_1core_1_1_event.html">Event</a> e)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span> array_desc_-&gt;event = std::move(e);</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> }</div>
</div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span> </div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span> <span class="comment">// Mark the array as a tracer array (true) or not.</span></div>
<div class="foldopen" id="foldopen00346" data-start="{" data-end="}">
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#af26e6be1a9e6239471a4c24310c0c7c8"> 346</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#af26e6be1a9e6239471a4c24310c0c7c8">set_tracer</a>(<span class="keywordtype">bool</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#af9acb115019b995354d366c4ac6b968c">is_tracer</a>) {</div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno"> 347</span> array_desc_-&gt;is_tracer = <a class="code hl_function" href="classmlx_1_1core_1_1array.html#af9acb115019b995354d366c4ac6b968c">is_tracer</a>;</div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno"> 348</span> }</div>
</div>
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno"> 349</span> <span class="comment">// Check if the array is a tracer array</span></div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#af9acb115019b995354d366c4ac6b968c"> 350</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#af9acb115019b995354d366c4ac6b968c">is_tracer</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"> 351</span> </div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a631acd8e318189640b8338f9ae1a554d"> 352</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a631acd8e318189640b8338f9ae1a554d">set_data</a>(<a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">allocator::Buffer</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08">buffer</a>, <a class="code hl_typedef" href="namespacemlx_1_1core.html#a1e6cec03ebd80fd2d6b12b288367bfa8">deleter_t</a> d = <a class="code hl_function" href="namespacemlx_1_1core_1_1allocator.html#a77f0a1215be242db6485612bcb273af5">allocator::free</a>);</div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span> </div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a2112af5fba37b3135cd2e6ac9e851606"> 354</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2112af5fba37b3135cd2e6ac9e851606">set_data</a>(</div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">allocator::Buffer</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08">buffer</a>,</div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"> 356</span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#afaf2a370fa35d96af1b27a4b814e3bfd">data_size</a>,</div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span> std::vector&lt;size_t&gt; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a186cf2648da92584d5c1c8b24e69629b">strides</a>,</div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_flags.html">Flags</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a0a20a6065ae71b64c1e3aa22a45fd8a1">flags</a>,</div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"> 359</span> <a class="code hl_typedef" href="namespacemlx_1_1core.html#a1e6cec03ebd80fd2d6b12b288367bfa8">deleter_t</a> d = <a class="code hl_function" href="namespacemlx_1_1core_1_1allocator.html#a77f0a1215be242db6485612bcb273af5">allocator::free</a>);</div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"> 360</span> </div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a28df7a333d90a311c49bc4bce7a1ad6d"> 361</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a28df7a333d90a311c49bc4bce7a1ad6d">copy_shared_buffer</a>(</div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"> 362</span> <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; other,</div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno"> 363</span> <span class="keyword">const</span> std::vector&lt;size_t&gt;&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a186cf2648da92584d5c1c8b24e69629b">strides</a>,</div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno"> 364</span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_flags.html">Flags</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a0a20a6065ae71b64c1e3aa22a45fd8a1">flags</a>,</div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno"> 365</span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#afaf2a370fa35d96af1b27a4b814e3bfd">data_size</a>,</div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno"> 366</span> <span class="keywordtype">size_t</span> offset = 0);</div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno"> 367</span> </div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a92974c656c35a972ad241f80584bbd29"> 368</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a92974c656c35a972ad241f80584bbd29">copy_shared_buffer</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; other);</div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno"> 369</span> </div>
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#acce00db63e0f3d80f797b02397ade836"> 370</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#acce00db63e0f3d80f797b02397ade836">move_shared_buffer</a>(</div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno"> 371</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a> other,</div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno"> 372</span> <span class="keyword">const</span> std::vector&lt;size_t&gt;&amp; <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a186cf2648da92584d5c1c8b24e69629b">strides</a>,</div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno"> 373</span> <a class="code hl_struct" href="structmlx_1_1core_1_1array_1_1_flags.html">Flags</a> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a0a20a6065ae71b64c1e3aa22a45fd8a1">flags</a>,</div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno"> 374</span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#afaf2a370fa35d96af1b27a4b814e3bfd">data_size</a>,</div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno"> 375</span> <span class="keywordtype">size_t</span> offset = 0);</div>
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno"> 376</span> </div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a38d7ad605f8282e5e49d0c09e0555c78"> 377</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a38d7ad605f8282e5e49d0c09e0555c78">move_shared_buffer</a>(<a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a> other);</div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span> </div>
<div class="foldopen" id="foldopen00379" data-start="{" data-end="}">
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a95e6b156c8e05439f076b85c05079387"> 379</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a95e6b156c8e05439f076b85c05079387">overwrite_descriptor</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; other) {</div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno"> 380</span> array_desc_ = other.array_desc_;</div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"> 381</span> }</div>
</div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno"> 382</span> </div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a2f16c1ef8ee248d2fba95520c86dfad2"> 383</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2f16c1ef8ee248d2fba95520c86dfad2">~array</a>();</div>
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno"> 384</span> </div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno"> 385</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno"> 386</span> <span class="comment">// Initialize the arrays data</span></div>
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno"> 387</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> It&gt;</div>
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno"> 388</span> <span class="keywordtype">void</span> init(<span class="keyword">const</span> It src);</div>
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno"> 389</span> </div>
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno"> 390</span> <span class="keyword">struct </span>ArrayDesc {</div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"> 391</span> std::vector&lt;int&gt; shape;</div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno"> 392</span> std::vector&lt;size_t&gt; strides;</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> <span class="keywordtype">size_t</span> size;</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> dtype;</div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno"> 395</span> std::shared_ptr&lt;Primitive&gt; primitive;</div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno"> 396</span> </div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno"> 397</span> <a class="code hl_enumeration" href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078">Status</a> status;</div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno"> 398</span> </div>
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno"> 399</span> <span class="comment">// An event on the array used for synchronization</span></div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno"> 400</span> <a class="code hl_class" href="classmlx_1_1core_1_1_event.html">Event</a> event;</div>
<div class="line"><a id="l00401" name="l00401"></a><span class="lineno"> 401</span> </div>
<div class="line"><a id="l00402" name="l00402"></a><span class="lineno"> 402</span> <span class="comment">// Indicates an array is being used in a graph transform</span></div>
<div class="line"><a id="l00403" name="l00403"></a><span class="lineno"> 403</span> <span class="comment">// and should not be detached from the graph</span></div>
<div class="line"><a id="l00404" name="l00404"></a><span class="lineno"> 404</span> <span class="keywordtype">bool</span> is_tracer{<span class="keyword">false</span>};</div>
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno"> 405</span> </div>
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno"> 406</span> <span class="comment">// This is a shared pointer so that *different* arrays</span></div>
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno"> 407</span> <span class="comment">// can share the underlying data buffer.</span></div>
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno"> 408</span> std::shared_ptr&lt;Data&gt; data;</div>
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno"> 409</span> </div>
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno"> 410</span> <span class="comment">// Properly offset data pointer</span></div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno"> 411</span> <span class="keywordtype">void</span>* data_ptr{<span class="keyword">nullptr</span>};</div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno"> 412</span> </div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno"> 413</span> <span class="comment">// The size in elements of the data buffer the array accesses</span></div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"> 414</span> <span class="comment">// This can be different than the actual size of the array if it</span></div>
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> <span class="comment">// has been broadcast or irregularly strided.</span></div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno"> 416</span> <span class="keywordtype">size_t</span> data_size;</div>
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno"> 417</span> </div>
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno"> 418</span> <span class="comment">// Contains useful meta data about the array</span></div>
<div class="line"><a id="l00419" name="l00419"></a><span class="lineno"> 419</span> Flags flags;</div>
<div class="line"><a id="l00420" name="l00420"></a><span class="lineno"> 420</span> </div>
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno"> 421</span> std::vector&lt;array&gt; inputs;</div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno"> 422</span> <span class="comment">// An array to keep track of the siblings from a multi-output</span></div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno"> 423</span> <span class="comment">// primitive.</span></div>
<div class="line"><a id="l00424" name="l00424"></a><span class="lineno"> 424</span> std::vector&lt;array&gt; siblings;</div>
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno"> 425</span> <span class="comment">// The arrays position in the output list</span></div>
<div class="line"><a id="l00426" name="l00426"></a><span class="lineno"> 426</span> uint32_t position{0};</div>
<div class="line"><a id="l00427" name="l00427"></a><span class="lineno"> 427</span> </div>
<div class="line"><a id="l00428" name="l00428"></a><span class="lineno"> 428</span> <span class="keyword">explicit</span> ArrayDesc(std::vector&lt;int&gt; shape, Dtype dtype);</div>
<div class="line"><a id="l00429" name="l00429"></a><span class="lineno"> 429</span> </div>
<div class="line"><a id="l00430" name="l00430"></a><span class="lineno"> 430</span> <span class="keyword">explicit</span> ArrayDesc(</div>
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno"> 431</span> std::vector&lt;int&gt; shape,</div>
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno"> 432</span> Dtype dtype,</div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno"> 433</span> std::shared_ptr&lt;Primitive&gt; primitive,</div>
<div class="line"><a id="l00434" name="l00434"></a><span class="lineno"> 434</span> std::vector&lt;array&gt; inputs);</div>
<div class="line"><a id="l00435" name="l00435"></a><span class="lineno"> 435</span> </div>
<div class="line"><a id="l00436" name="l00436"></a><span class="lineno"> 436</span> ~ArrayDesc();</div>
<div class="line"><a id="l00437" name="l00437"></a><span class="lineno"> 437</span> </div>
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno"> 438</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno"> 439</span> <span class="comment">// Initialize size, strides, and other metadata</span></div>
<div class="line"><a id="l00440" name="l00440"></a><span class="lineno"> 440</span> <span class="keywordtype">void</span> init();</div>
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno"> 441</span> };</div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"> 442</span> </div>
<div class="line"><a id="l00443" name="l00443"></a><span class="lineno"> 443</span> <span class="comment">// The ArrayDesc contains the details of the materialized array including the</span></div>
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno"> 444</span> <span class="comment">// shape, strides, the data type. It also includes</span></div>
<div class="line"><a id="l00445" name="l00445"></a><span class="lineno"> 445</span> <span class="comment">// the primitive which knows how to compute the array&#39;s data from its inputs</span></div>
<div class="line"><a id="l00446" name="l00446"></a><span class="lineno"> 446</span> <span class="comment">// and the list of array&#39;s inputs for the primitive.</span></div>
<div class="line"><a id="l00447" name="l00447"></a><span class="lineno"> 447</span> std::shared_ptr&lt;ArrayDesc&gt; array_desc_;</div>
<div class="line"><a id="l00448" name="l00448"></a><span class="lineno"> 448</span>};</div>
</div>
<div class="line"><a id="l00449" name="l00449"></a><span class="lineno"> 449</span> </div>
<div class="line"><a id="l00450" name="l00450"></a><span class="lineno"> 450</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00451" data-start="{" data-end="}">
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a75fac72da3ce214fa3737df92a64b232"> 451</a></span><a class="code hl_function" href="classmlx_1_1core_1_1array.html#a75fac72da3ce214fa3737df92a64b232">array::array</a>(T val, <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> dtype <span class="comment">/* = TypeToDtype&lt;T&gt;() */</span>)</div>
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno"> 452</span> : array_desc_(<a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::make_shared&lt;ArrayDesc&gt;(<a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::vector&lt;int&gt;{}, dtype)) {</div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno"> 453</span> init(&amp;val);</div>
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno"> 454</span>}</div>
</div>
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno"> 455</span> </div>
<div class="line"><a id="l00456" name="l00456"></a><span class="lineno"> 456</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> It&gt;</div>
<div class="foldopen" id="foldopen00457" data-start="{" data-end="}">
<div class="line"><a id="l00457" name="l00457"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a3e506a53b9c7567448f7809dda680210"> 457</a></span><a class="code hl_function" href="classmlx_1_1core_1_1array.html#a75fac72da3ce214fa3737df92a64b232">array::array</a>(</div>
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno"> 458</span> It data,</div>
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno"> 459</span> std::vector&lt;int&gt; shape,</div>
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno"> 460</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> dtype <span class="comment">/* = TypeToDtype&lt;typename std::iterator_traits&lt;It&gt;::value_type&gt;() */</span>) :</div>
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno"> 461</span> array_desc_(<a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::make_shared&lt;ArrayDesc&gt;(<a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::move(shape), dtype)) {</div>
<div class="line"><a id="l00462" name="l00462"></a><span class="lineno"> 462</span> init(<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>);</div>
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno"> 463</span>}</div>
</div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno"> 464</span> </div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno"> 465</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00466" data-start="{" data-end="}">
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a87f170384f4fb93decf2b80ae7280f00"> 466</a></span><a class="code hl_function" href="classmlx_1_1core_1_1array.html#a75fac72da3ce214fa3737df92a64b232">array::array</a>(</div>
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno"> 467</span> std::initializer_list&lt;T&gt; data,</div>
<div class="line"><a id="l00468" name="l00468"></a><span class="lineno"> 468</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> dtype <span class="comment">/* = TypeToDtype&lt;T&gt;() */</span>)</div>
<div class="line"><a id="l00469" name="l00469"></a><span class="lineno"> 469</span> : array_desc_(<a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::make_shared&lt;ArrayDesc&gt;(</div>
<div class="line"><a id="l00470" name="l00470"></a><span class="lineno"> 470</span> <a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::vector&lt;int&gt;{<span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>.size())},</div>
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno"> 471</span> dtype)) {</div>
<div class="line"><a id="l00472" name="l00472"></a><span class="lineno"> 472</span> init(<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>.begin());</div>
<div class="line"><a id="l00473" name="l00473"></a><span class="lineno"> 473</span>}</div>
</div>
<div class="line"><a id="l00474" name="l00474"></a><span class="lineno"> 474</span> </div>
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno"> 475</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00476" data-start="{" data-end="}">
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a44e57a41819321e0d796e08cb9a06e4b"> 476</a></span><a class="code hl_function" href="classmlx_1_1core_1_1array.html#a75fac72da3ce214fa3737df92a64b232">array::array</a>(</div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno"> 477</span> std::initializer_list&lt;T&gt; data,</div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"> 478</span> std::vector&lt;int&gt; shape,</div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno"> 479</span> <a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> dtype <span class="comment">/* = TypeToDtype&lt;T&gt;() */</span>)</div>
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno"> 480</span> : array_desc_(<a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::make_shared&lt;ArrayDesc&gt;(<a class="code hl_function" href="group__ops.html#ga2a466024f8061febc0a64be557644cb0">std</a>::move(shape), dtype)) {</div>
<div class="line"><a id="l00481" name="l00481"></a><span class="lineno"> 481</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>.size() != <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>()) {</div>
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno"> 482</span> <span class="keywordflow">throw</span> std::invalid_argument(</div>
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno"> 483</span> <span class="stringliteral">&quot;Data size and provided shape mismatch in array construction.&quot;</span>);</div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno"> 484</span> }</div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno"> 485</span> init(<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>.begin());</div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno"> 486</span>}</div>
</div>
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno"> 487</span> </div>
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno"> 488</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00489" data-start="{" data-end="}">
<div class="line"><a id="l00489" name="l00489"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a90c5afddc2fa3028c0f8099bd64c8a99"> 489</a></span>T <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a90c5afddc2fa3028c0f8099bd64c8a99">array::item</a>() {</div>
<div class="line"><a id="l00490" name="l00490"></a><span class="lineno"> 490</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>() != 1) {</div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno"> 491</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;item can only be called on arrays of size 1.&quot;</span>);</div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno"> 492</span> }</div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno"> 493</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2820c45188071a22175e9fa42e10a49a">eval</a>();</div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno"> 494</span> <span class="keywordflow">return</span> *data&lt;T&gt;();</div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno"> 495</span>}</div>
</div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno"> 496</span> </div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno"> 497</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00498" data-start="{" data-end="}">
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1array.html#a8650a99a6b7549bc823b03ad92590ff7"> 498</a></span>T <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a90c5afddc2fa3028c0f8099bd64c8a99">array::item</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno"> 499</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>() != 1) {</div>
<div class="line"><a id="l00500" name="l00500"></a><span class="lineno"> 500</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;item can only be called on arrays of size 1.&quot;</span>);</div>
<div class="line"><a id="l00501" name="l00501"></a><span class="lineno"> 501</span> }</div>
<div class="line"><a id="l00502" name="l00502"></a><span class="lineno"> 502</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="classmlx_1_1core_1_1array.html#add41975ba47933af8e74dde0cc646ec4">status</a>() == <a class="code hl_enumvalue" href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078ae8a9988458b0355001674020a45656fb">Status::unscheduled</a>) {</div>
<div class="line"><a id="l00503" name="l00503"></a><span class="lineno"> 503</span> <span class="keywordflow">throw</span> std::invalid_argument(</div>
<div class="line"><a id="l00504" name="l00504"></a><span class="lineno"> 504</span> <span class="stringliteral">&quot;item() const can only be called on evaled arrays&quot;</span>);</div>
<div class="line"><a id="l00505" name="l00505"></a><span class="lineno"> 505</span> }</div>
<div class="line"><a id="l00506" name="l00506"></a><span class="lineno"> 506</span> <span class="keyword">const_cast&lt;</span><a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>*<span class="keyword">&gt;</span>(<span class="keyword">this</span>)-&gt;<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a2820c45188071a22175e9fa42e10a49a">eval</a>();</div>
<div class="line"><a id="l00507" name="l00507"></a><span class="lineno"> 507</span> <span class="keywordflow">return</span> *data&lt;T&gt;();</div>
<div class="line"><a id="l00508" name="l00508"></a><span class="lineno"> 508</span>}</div>
</div>
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno"> 509</span> </div>
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno"> 510</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> It&gt;</div>
<div class="line"><a id="l00511" name="l00511"></a><span class="lineno"> 511</span><span class="keywordtype">void</span> array::init(It src) {</div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno"> 512</span> <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a631acd8e318189640b8338f9ae1a554d">set_data</a>(<a class="code hl_function" href="namespacemlx_1_1core_1_1allocator.html#a560d10a166e3c294f3757166f9bd6801">allocator::malloc</a>(<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>() * <a class="code hl_function" href="namespacemlx_1_1core.html#add4794cc0ffe5d717fc146084a235d95">size_of</a>(<a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a>())));</div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno"> 513</span> <span class="keywordflow">switch</span> (<a class="code hl_function" href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">dtype</a>()) {</div>
<div class="line"><a id="l00514" name="l00514"></a><span class="lineno"> 514</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a113d2bac7e4aa6a4cb4a5c3242527b82">bool_</a>:</div>
<div class="line"><a id="l00515" name="l00515"></a><span class="lineno"> 515</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;bool&gt;());</div>
<div class="line"><a id="l00516" name="l00516"></a><span class="lineno"> 516</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00517" name="l00517"></a><span class="lineno"> 517</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a9778d50afbf456b0bd738751243b3b68">uint8</a>:</div>
<div class="line"><a id="l00518" name="l00518"></a><span class="lineno"> 518</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;uint8_t&gt;());</div>
<div class="line"><a id="l00519" name="l00519"></a><span class="lineno"> 519</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00520" name="l00520"></a><span class="lineno"> 520</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a312a70c487366968af5e6cbf5038c812">uint16</a>:</div>
<div class="line"><a id="l00521" name="l00521"></a><span class="lineno"> 521</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;uint16_t&gt;());</div>
<div class="line"><a id="l00522" name="l00522"></a><span class="lineno"> 522</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00523" name="l00523"></a><span class="lineno"> 523</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#ac63820d6fe10545907c33faf466a929e">uint32</a>:</div>
<div class="line"><a id="l00524" name="l00524"></a><span class="lineno"> 524</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;uint32_t&gt;());</div>
<div class="line"><a id="l00525" name="l00525"></a><span class="lineno"> 525</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00526" name="l00526"></a><span class="lineno"> 526</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a1f42e3dd4787d2ecec7114a12daefec8">uint64</a>:</div>
<div class="line"><a id="l00527" name="l00527"></a><span class="lineno"> 527</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;uint64_t&gt;());</div>
<div class="line"><a id="l00528" name="l00528"></a><span class="lineno"> 528</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00529" name="l00529"></a><span class="lineno"> 529</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a892e934e146dd938d144cee8813ca672">int8</a>:</div>
<div class="line"><a id="l00530" name="l00530"></a><span class="lineno"> 530</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;int8_t&gt;());</div>
<div class="line"><a id="l00531" name="l00531"></a><span class="lineno"> 531</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00532" name="l00532"></a><span class="lineno"> 532</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a71ebba4ad1afa730962f0692c4f42f07">int16</a>:</div>
<div class="line"><a id="l00533" name="l00533"></a><span class="lineno"> 533</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;int16_t&gt;());</div>
<div class="line"><a id="l00534" name="l00534"></a><span class="lineno"> 534</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00535" name="l00535"></a><span class="lineno"> 535</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a5d6373aad1444edc9de1eb07bfe5cad3">int32</a>:</div>
<div class="line"><a id="l00536" name="l00536"></a><span class="lineno"> 536</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;int32_t&gt;());</div>
<div class="line"><a id="l00537" name="l00537"></a><span class="lineno"> 537</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00538" name="l00538"></a><span class="lineno"> 538</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a9019bdc191054ada0a502c7c34cef5b8">int64</a>:</div>
<div class="line"><a id="l00539" name="l00539"></a><span class="lineno"> 539</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;int64_t&gt;());</div>
<div class="line"><a id="l00540" name="l00540"></a><span class="lineno"> 540</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00541" name="l00541"></a><span class="lineno"> 541</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#abf228ee9d8ec48c03bb15adcc4e1f3ec">float16</a>:</div>
<div class="line"><a id="l00542" name="l00542"></a><span class="lineno"> 542</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;float16_t&gt;());</div>
<div class="line"><a id="l00543" name="l00543"></a><span class="lineno"> 543</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00544" name="l00544"></a><span class="lineno"> 544</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a6894543b340321193dfb8052c438a319">float32</a>:</div>
<div class="line"><a id="l00545" name="l00545"></a><span class="lineno"> 545</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;float&gt;());</div>
<div class="line"><a id="l00546" name="l00546"></a><span class="lineno"> 546</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00547" name="l00547"></a><span class="lineno"> 547</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a514cf8b4e6f0a6af3a867e752f4338f7">bfloat16</a>:</div>
<div class="line"><a id="l00548" name="l00548"></a><span class="lineno"> 548</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;bfloat16_t&gt;());</div>
<div class="line"><a id="l00549" name="l00549"></a><span class="lineno"> 549</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00550" name="l00550"></a><span class="lineno"> 550</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#af99db87e0078bfcdb383f5689bc874d4">complex64</a>:</div>
<div class="line"><a id="l00551" name="l00551"></a><span class="lineno"> 551</span> std::copy(src, src + <a class="code hl_function" href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">size</a>(), data&lt;complex64_t&gt;());</div>
<div class="line"><a id="l00552" name="l00552"></a><span class="lineno"> 552</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00553" name="l00553"></a><span class="lineno"> 553</span> }</div>
<div class="line"><a id="l00554" name="l00554"></a><span class="lineno"> 554</span>}</div>
<div class="line"><a id="l00555" name="l00555"></a><span class="lineno"> 555</span> </div>
<div class="line"><a id="l00556" name="l00556"></a><span class="lineno"> 556</span><span class="comment">/* Utilities for determining whether a template parameter is array. */</span></div>
<div class="line"><a id="l00557" name="l00557"></a><span class="lineno"> 557</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00558" name="l00558"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a01b0d64a75dfa2e95d6c7b5c53d708af"> 558</a></span><span class="keyword">inline</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a01b0d64a75dfa2e95d6c7b5c53d708af">is_array_v</a> =</div>
<div class="line"><a id="l00559" name="l00559"></a><span class="lineno"> 559</span> std::is_same_v&lt;std::remove_cv_t&lt;std::remove_reference_t&lt;T&gt;&gt;, <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&gt;;</div>
<div class="line"><a id="l00560" name="l00560"></a><span class="lineno"> 560</span> </div>
<div class="line"><a id="l00561" name="l00561"></a><span class="lineno"> 561</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span>... T&gt;</div>
<div class="line"><a id="l00562" name="l00562"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a94c1057929b390e5613304afa16dfbda"> 562</a></span><span class="keyword">inline</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a94c1057929b390e5613304afa16dfbda">is_arrays_v</a> = (is_array_v&lt;T&gt; &amp;&amp; ...);</div>
<div class="line"><a id="l00563" name="l00563"></a><span class="lineno"> 563</span> </div>
<div class="line"><a id="l00564" name="l00564"></a><span class="lineno"> 564</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span>... T&gt;</div>
<div class="line"><a id="l00565" name="l00565"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#af89751d79339f3e4d9318ea97d64d114"> 565</a></span><span class="keyword">using </span><a class="code hl_typedef" href="namespacemlx_1_1core.html#af89751d79339f3e4d9318ea97d64d114">enable_for_arrays_t</a> = <span class="keyword">typename</span> std::enable_if_t&lt;<a class="code hl_variable" href="namespacemlx_1_1core.html#a94c1057929b390e5613304afa16dfbda">is_arrays_v</a>&lt;T...&gt;&gt;;</div>
<div class="line"><a id="l00566" name="l00566"></a><span class="lineno"> 566</span> </div>
<div class="line"><a id="l00567" name="l00567"></a><span class="lineno"> 567</span>} <span class="comment">// namespace mlx::core</span></div>
<div class="ttc" id="aallocator_8h_html"><div class="ttname"><a href="allocator_8h.html">allocator.h</a></div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1_event_html"><div class="ttname"><a href="classmlx_1_1core_1_1_event.html">mlx::core::Event</a></div><div class="ttdef"><b>Definition</b> event.h:11</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1_primitive_html"><div class="ttname"><a href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></div><div class="ttdef"><b>Definition</b> primitives.h:48</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_buffer_html"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_buffer.html">mlx::core::allocator::Buffer</a></div><div class="ttdef"><b>Definition</b> allocator.h:12</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html"><div class="ttname"><a href="classmlx_1_1core_1_1array.html">mlx::core::array</a></div><div class="ttdef"><b>Definition</b> array.h:20</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a000c3cfe13cb378bf0523b62816190da"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a000c3cfe13cb378bf0523b62816190da">mlx::core::array::attach_event</a></div><div class="ttdeci">void attach_event(Event e) const</div><div class="ttdef"><b>Definition</b> array.h:341</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a0a20a6065ae71b64c1e3aa22a45fd8a1"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a0a20a6065ae71b64c1e3aa22a45fd8a1">mlx::core::array::flags</a></div><div class="ttdeci">const Flags &amp; flags() const</div><div class="ttdoc">Get the Flags bit-field.</div><div class="ttdef"><b>Definition</b> array.h:290</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a0a8e4d6e67e739a712876bb36f88f9bf"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a0a8e4d6e67e739a712876bb36f88f9bf">mlx::core::array::event</a></div><div class="ttdeci">Event &amp; event() const</div><div class="ttdef"><b>Definition</b> array.h:336</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a1173db4e23f5a8230911cb8fba45d5e6"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a1173db4e23f5a8230911cb8fba45d5e6">mlx::core::array::make_arrays</a></div><div class="ttdeci">static std::vector&lt; array &gt; make_arrays(std::vector&lt; std::vector&lt; int &gt; &gt; shapes, const std::vector&lt; Dtype &gt; &amp;dtypes, const std::shared_ptr&lt; Primitive &gt; &amp;primitive, const std::vector&lt; array &gt; &amp;inputs)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a186cf2648da92584d5c1c8b24e69629b"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a186cf2648da92584d5c1c8b24e69629b">mlx::core::array::strides</a></div><div class="ttdeci">const std::vector&lt; size_t &gt; &amp; strides() const</div><div class="ttdoc">The strides of the array.</div><div class="ttdef"><b>Definition</b> array.h:113</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a199726612fa8a4bcd5c2d05eadad7078"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078">mlx::core::array::Status</a></div><div class="ttdeci">Status</div><div class="ttdef"><b>Definition</b> array.h:322</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a199726612fa8a4bcd5c2d05eadad7078a308bd3e5bf976888b120dd36d0c2d2ae"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078a308bd3e5bf976888b120dd36d0c2d2ae">mlx::core::array::available</a></div><div class="ttdeci">@ available</div><div class="ttdef"><b>Definition</b> array.h:322</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a199726612fa8a4bcd5c2d05eadad7078ae8a9988458b0355001674020a45656fb"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078ae8a9988458b0355001674020a45656fb">mlx::core::array::unscheduled</a></div><div class="ttdeci">@ unscheduled</div><div class="ttdef"><b>Definition</b> array.h:322</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a199726612fa8a4bcd5c2d05eadad7078af8a6f8eed2395ab89a758dec434393ae"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a199726612fa8a4bcd5c2d05eadad7078af8a6f8eed2395ab89a758dec434393ae">mlx::core::array::scheduled</a></div><div class="ttdeci">@ scheduled</div><div class="ttdef"><b>Definition</b> array.h:322</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a2112af5fba37b3135cd2e6ac9e851606"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a2112af5fba37b3135cd2e6ac9e851606">mlx::core::array::set_data</a></div><div class="ttdeci">void set_data(allocator::Buffer buffer, size_t data_size, std::vector&lt; size_t &gt; strides, Flags flags, deleter_t d=allocator::free)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a2820c45188071a22175e9fa42e10a49a"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a2820c45188071a22175e9fa42e10a49a">mlx::core::array::eval</a></div><div class="ttdeci">void eval()</div><div class="ttdoc">Evaluate the array.</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a28df7a333d90a311c49bc4bce7a1ad6d"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a28df7a333d90a311c49bc4bce7a1ad6d">mlx::core::array::copy_shared_buffer</a></div><div class="ttdeci">void copy_shared_buffer(const array &amp;other, const std::vector&lt; size_t &gt; &amp;strides, Flags flags, size_t data_size, size_t offset=0)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a2913abcdf71826827c8457f529825fff"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a2913abcdf71826827c8457f529825fff">mlx::core::array::inputs</a></div><div class="ttdeci">const std::vector&lt; array &gt; &amp; inputs() const</div><div class="ttdoc">The array's inputs.</div><div class="ttdef"><b>Definition</b> array.h:246</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a297df274e2da5cb884257bbeffd6b187"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a297df274e2da5cb884257bbeffd6b187">mlx::core::array::array</a></div><div class="ttdeci">array(const array &amp;other)=default</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a2c186fd527f984f0589d4183b4976289"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a2c186fd527f984f0589d4183b4976289">mlx::core::array::outputs</a></div><div class="ttdeci">std::vector&lt; array &gt; outputs() const</div><div class="ttdoc">The outputs of the array's primitive (i.e.</div><div class="ttdef"><b>Definition</b> array.h:276</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a2f16c1ef8ee248d2fba95520c86dfad2"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a2f16c1ef8ee248d2fba95520c86dfad2">mlx::core::array::~array</a></div><div class="ttdeci">~array()</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a387b67cd3ef5cfc1e749c371766c4a05"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a387b67cd3ef5cfc1e749c371766c4a05">mlx::core::array::nbytes</a></div><div class="ttdeci">size_t nbytes() const</div><div class="ttdoc">The number of bytes in the array.</div><div class="ttdef"><b>Definition</b> array.h:89</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a38d7ad605f8282e5e49d0c09e0555c78"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a38d7ad605f8282e5e49d0c09e0555c78">mlx::core::array::move_shared_buffer</a></div><div class="ttdeci">void move_shared_buffer(array other)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a46642301da11e3eb4312c37349fbc9d7"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a46642301da11e3eb4312c37349fbc9d7">mlx::core::array::array</a></div><div class="ttdeci">array(std::initializer_list&lt; float &gt; data)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a4677a404b5d191af20b52649225de087"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a4677a404b5d191af20b52649225de087">mlx::core::array::is_donatable</a></div><div class="ttdeci">bool is_donatable() const</div><div class="ttdoc">True indicates the arrays buffer is safe to reuse.</div><div class="ttdef"><b>Definition</b> array.h:255</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a4a2a2c8a4a5beafd723fc13f2055d55d"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a4a2a2c8a4a5beafd723fc13f2055d55d">mlx::core::array::shape</a></div><div class="ttdeci">const std::vector&lt; int &gt; &amp; shape() const</div><div class="ttdoc">The shape of the array as a vector of integers.</div><div class="ttdef"><b>Definition</b> array.h:99</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a5119cd616ec3c05d65878944b8889469"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a5119cd616ec3c05d65878944b8889469">mlx::core::array::primitive_ptr</a></div><div class="ttdeci">std::shared_ptr&lt; Primitive &gt; &amp; primitive_ptr() const</div><div class="ttdoc">A shared pointer to the array's primitive.</div><div class="ttdef"><b>Definition</b> array.h:236</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a51ed0c45666264dc172d06fba159eb8f"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a51ed0c45666264dc172d06fba159eb8f">mlx::core::array::shape</a></div><div class="ttdeci">int shape(int dim) const</div><div class="ttdoc">Get the size of the corresponding dimension.</div><div class="ttdef"><b>Definition</b> array.h:108</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a53006e77d13d9d88b525ef577748939f"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a53006e77d13d9d88b525ef577748939f">mlx::core::array::ndim</a></div><div class="ttdeci">size_t ndim() const</div><div class="ttdoc">The number of dimensions of the array.</div><div class="ttdef"><b>Definition</b> array.h:94</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a598f87161926d9e0b516860f0ea2c8f6"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a598f87161926d9e0b516860f0ea2c8f6">mlx::core::array::size</a></div><div class="ttdeci">size_t size() const</div><div class="ttdoc">The number of elements in the array.</div><div class="ttdef"><b>Definition</b> array.h:84</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a5b5f562ff14c150842cb61628e531663"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a5b5f562ff14c150842cb61628e531663">mlx::core::array::array</a></div><div class="ttdeci">array(allocator::Buffer data, std::vector&lt; int &gt; shape, Dtype dtype, deleter_t deleter=allocator::free)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a5c89c2406a610b32943955f9a5060fbd"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a5c89c2406a610b32943955f9a5060fbd">mlx::core::array::operator=</a></div><div class="ttdeci">array &amp; operator=(array &amp;&amp;other) &amp;&amp;=delete</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a5da41aabecf4c8055b7515341bf57147"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a5da41aabecf4c8055b7515341bf57147">mlx::core::array::operator=</a></div><div class="ttdeci">array &amp; operator=(const array &amp;other) &amp;</div><div class="ttdef"><b>Definition</b> array.h:71</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a5daf64552fb450825c9b382f3a5fa2d4"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a5daf64552fb450825c9b382f3a5fa2d4">mlx::core::array::end</a></div><div class="ttdeci">ArrayIterator end() const</div><div class="ttdef"><b>Definition</b> array.h:176</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a5e1812029394bfb1a706c83611286f49"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a5e1812029394bfb1a706c83611286f49">mlx::core::array::array</a></div><div class="ttdeci">array(std::initializer_list&lt; int &gt; data, Dtype dtype)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a631acd8e318189640b8338f9ae1a554d"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a631acd8e318189640b8338f9ae1a554d">mlx::core::array::set_data</a></div><div class="ttdeci">void set_data(allocator::Buffer buffer, deleter_t d=allocator::free)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a634466ce661485394f2fdc3bd6796bcd"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a634466ce661485394f2fdc3bd6796bcd">mlx::core::array::buffer</a></div><div class="ttdeci">const allocator::Buffer &amp; buffer() const</div><div class="ttdef"><b>Definition</b> array.h:302</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a63598018999b49f1340b183cb303f05c"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a63598018999b49f1340b183cb303f05c">mlx::core::array::set_status</a></div><div class="ttdeci">void set_status(Status s) const</div><div class="ttdef"><b>Definition</b> array.h:331</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a6db4b8c28c767cc16ad2785ece496dca"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a6db4b8c28c767cc16ad2785ece496dca">mlx::core::array::array</a></div><div class="ttdeci">array(const std::complex&lt; float &gt; &amp;val, Dtype dtype=complex64)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a7263f23e70a580a9bc2129fbcde36e6c"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a7263f23e70a580a9bc2129fbcde36e6c">mlx::core::array::siblings</a></div><div class="ttdeci">std::vector&lt; array &gt; &amp; siblings()</div><div class="ttdoc">The array's siblings.</div><div class="ttdef"><b>Definition</b> array.h:265</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a72e3ce6c03fefe272cadf214bd127b95"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">mlx::core::array::data</a></div><div class="ttdeci">T * data()</div><div class="ttdef"><b>Definition</b> array.h:313</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a75fac72da3ce214fa3737df92a64b232"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a75fac72da3ce214fa3737df92a64b232">mlx::core::array::array</a></div><div class="ttdeci">array(T val, Dtype dtype=TypeToDtype&lt; T &gt;())</div><div class="ttdoc">Construct a scalar array with zero dimensions.</div><div class="ttdef"><b>Definition</b> array.h:451</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a76b258b169d7d73419ebbf85340fb914"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a76b258b169d7d73419ebbf85340fb914">mlx::core::array::begin</a></div><div class="ttdeci">ArrayIterator begin() const</div><div class="ttdef"><b>Definition</b> array.h:173</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a790548666511d8c6d9f92ee79d2ce14c"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a790548666511d8c6d9f92ee79d2ce14c">mlx::core::array::primitive</a></div><div class="ttdeci">Primitive &amp; primitive() const</div><div class="ttdoc">The array's primitive.</div><div class="ttdef"><b>Definition</b> array.h:231</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a84948c29df8c957904919c8602692bd2"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a84948c29df8c957904919c8602692bd2">mlx::core::array::detach</a></div><div class="ttdeci">void detach()</div><div class="ttdoc">Detach the array from the graph.</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a8acf2b4c75f9b7f79da6675dbc36cf36"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a8acf2b4c75f9b7f79da6675dbc36cf36">mlx::core::array::operator=</a></div><div class="ttdeci">array &amp; operator=(const array &amp;other) &amp;&amp;=delete</div><div class="ttdoc">Assignment to rvalue does not compile.</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a8fccbe7a4edfd8cca168161124e263b1"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a8fccbe7a4edfd8cca168161124e263b1">mlx::core::array::set_siblings</a></div><div class="ttdeci">void set_siblings(std::vector&lt; array &gt; siblings, uint16_t position)</div><div class="ttdef"><b>Definition</b> array.h:269</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a90c5afddc2fa3028c0f8099bd64c8a99"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a90c5afddc2fa3028c0f8099bd64c8a99">mlx::core::array::item</a></div><div class="ttdeci">T item()</div><div class="ttdoc">Get the value from a scalar array.</div><div class="ttdef"><b>Definition</b> array.h:489</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a919f850ca087d1c40aa68f854cb30be2"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a919f850ca087d1c40aa68f854cb30be2">mlx::core::array::strides</a></div><div class="ttdeci">size_t strides(int dim) const</div><div class="ttdoc">Get the stride of the corresponding dimension.</div><div class="ttdef"><b>Definition</b> array.h:122</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a92974c656c35a972ad241f80584bbd29"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a92974c656c35a972ad241f80584bbd29">mlx::core::array::copy_shared_buffer</a></div><div class="ttdeci">void copy_shared_buffer(const array &amp;other)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a95e6b156c8e05439f076b85c05079387"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a95e6b156c8e05439f076b85c05079387">mlx::core::array::overwrite_descriptor</a></div><div class="ttdeci">void overwrite_descriptor(const array &amp;other)</div><div class="ttdef"><b>Definition</b> array.h:379</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a99fb28eeab39b9f429373f8bd7557676"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a99fb28eeab39b9f429373f8bd7557676">mlx::core::array::data</a></div><div class="ttdeci">const T * data() const</div><div class="ttdef"><b>Definition</b> array.h:318</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_aa5aceab15241e7826cbaf8b8a41440c1"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#aa5aceab15241e7826cbaf8b8a41440c1">mlx::core::array::has_primitive</a></div><div class="ttdeci">bool has_primitive() const</div><div class="ttdoc">Check if the array has an attached primitive or is a leaf node.</div><div class="ttdef"><b>Definition</b> array.h:241</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_ab3daf04c27c4593d9d73c397b8484a08"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08">mlx::core::array::buffer</a></div><div class="ttdeci">allocator::Buffer &amp; buffer()</div><div class="ttdef"><b>Definition</b> array.h:299</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_ab6cbccbba66cc54acda4390b19f0397c"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#ab6cbccbba66cc54acda4390b19f0397c">mlx::core::array::array</a></div><div class="ttdeci">array(array &amp;&amp;other)=default</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_ab84c792117e29cdf90ef3433303f6141"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#ab84c792117e29cdf90ef3433303f6141">mlx::core::array::data_shared_ptr</a></div><div class="ttdeci">std::shared_ptr&lt; Data &gt; data_shared_ptr() const</div><div class="ttdef"><b>Definition</b> array.h:308</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_acce00db63e0f3d80f797b02397ade836"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#acce00db63e0f3d80f797b02397ade836">mlx::core::array::move_shared_buffer</a></div><div class="ttdeci">void move_shared_buffer(array other, const std::vector&lt; size_t &gt; &amp;strides, Flags flags, size_t data_size, size_t offset=0)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_acf80fde8f743f65ad5b4be69fcb7a74d"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#acf80fde8f743f65ad5b4be69fcb7a74d">mlx::core::array::siblings</a></div><div class="ttdeci">const std::vector&lt; array &gt; &amp; siblings() const</div><div class="ttdoc">The array's siblings.</div><div class="ttdef"><b>Definition</b> array.h:260</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_acffb082177f9b78f0c52e406adff972f"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#acffb082177f9b78f0c52e406adff972f">mlx::core::array::inputs</a></div><div class="ttdeci">std::vector&lt; array &gt; &amp; inputs()</div><div class="ttdef"><b>Definition</b> array.h:250</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_ad3277ff68f1336aa217f9cbe40181479"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#ad3277ff68f1336aa217f9cbe40181479">mlx::core::array::operator=</a></div><div class="ttdeci">array &amp; operator=(array &amp;&amp;other) &amp;=default</div><div class="ttdoc">Default copy and move constructors otherwise.</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_adaade8f4bb7f8ecc0ba07efb17cd2620"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#adaade8f4bb7f8ecc0ba07efb17cd2620">mlx::core::array::array</a></div><div class="ttdeci">array(std::vector&lt; int &gt; shape, Dtype dtype, std::shared_ptr&lt; Primitive &gt; primitive, std::vector&lt; array &gt; inputs)</div><div class="ttdoc">The following methods should be used with caution.</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_add41975ba47933af8e74dde0cc646ec4"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#add41975ba47933af8e74dde0cc646ec4">mlx::core::array::status</a></div><div class="ttdeci">const Status status() const</div><div class="ttdef"><b>Definition</b> array.h:327</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_adfa53f3f26bb0f942fb1c67ec8cd5380"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#adfa53f3f26bb0f942fb1c67ec8cd5380">mlx::core::array::id</a></div><div class="ttdeci">std::uintptr_t id() const</div><div class="ttdoc">A unique identifier for an array.</div><div class="ttdef"><b>Definition</b> array.h:199</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_ae29e7d6fbfbea1e5e321a8d1ea3cfacd"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#ae29e7d6fbfbea1e5e321a8d1ea3cfacd">mlx::core::array::dtype</a></div><div class="ttdeci">Dtype dtype() const</div><div class="ttdoc">Get the arrays data type.</div><div class="ttdef"><b>Definition</b> array.h:127</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_aebed1f37c19197be76105161102a8a40"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#aebed1f37c19197be76105161102a8a40">mlx::core::array::is_available</a></div><div class="ttdeci">bool is_available() const</div><div class="ttdef"><b>Definition</b> array.h:324</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_af26e6be1a9e6239471a4c24310c0c7c8"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#af26e6be1a9e6239471a4c24310c0c7c8">mlx::core::array::set_tracer</a></div><div class="ttdeci">void set_tracer(bool is_tracer)</div><div class="ttdef"><b>Definition</b> array.h:346</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_af329d9432c92de87cbaa2de8454eefc0"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#af329d9432c92de87cbaa2de8454eefc0">mlx::core::array::itemsize</a></div><div class="ttdeci">size_t itemsize() const</div><div class="ttdoc">The size of the array's datatype in bytes.</div><div class="ttdef"><b>Definition</b> array.h:79</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_af5ad83605d4eea81561246873bee1d7c"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#af5ad83605d4eea81561246873bee1d7c">mlx::core::array::primitive_id</a></div><div class="ttdeci">std::uintptr_t primitive_id() const</div><div class="ttdoc">A unique identifier for an arrays primitive.</div><div class="ttdef"><b>Definition</b> array.h:204</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_af9acb115019b995354d366c4ac6b968c"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#af9acb115019b995354d366c4ac6b968c">mlx::core::array::is_tracer</a></div><div class="ttdeci">bool is_tracer() const</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_afaf2a370fa35d96af1b27a4b814e3bfd"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#afaf2a370fa35d96af1b27a4b814e3bfd">mlx::core::array::data_size</a></div><div class="ttdeci">size_t data_size() const</div><div class="ttdoc">The size (in elements) of the underlying buffer the array points to.</div><div class="ttdef"><b>Definition</b> array.h:295</div></div>
<div class="ttc" id="adtype_8h_html"><div class="ttname"><a href="dtype_8h.html">dtype.h</a></div></div>
<div class="ttc" id="aevent_8h_html"><div class="ttname"><a href="event_8h.html">event.h</a></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_1allocator_html_a560d10a166e3c294f3757166f9bd6801"><div class="ttname"><a href="namespacemlx_1_1core_1_1allocator.html#a560d10a166e3c294f3757166f9bd6801">mlx::core::allocator::malloc</a></div><div class="ttdeci">Buffer malloc(size_t size)</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1allocator_html_a77f0a1215be242db6485612bcb273af5"><div class="ttname"><a href="namespacemlx_1_1core_1_1allocator.html#a77f0a1215be242db6485612bcb273af5">mlx::core::allocator::free</a></div><div class="ttdeci">void free(Buffer buffer)</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html"><div class="ttname"><a href="namespacemlx_1_1core.html">mlx::core</a></div><div class="ttdef"><b>Definition</b> allocator.h:7</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a01b0d64a75dfa2e95d6c7b5c53d708af"><div class="ttname"><a href="namespacemlx_1_1core.html#a01b0d64a75dfa2e95d6c7b5c53d708af">mlx::core::is_array_v</a></div><div class="ttdeci">constexpr bool is_array_v</div><div class="ttdef"><b>Definition</b> array.h:558</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a113d2bac7e4aa6a4cb4a5c3242527b82"><div class="ttname"><a href="namespacemlx_1_1core.html#a113d2bac7e4aa6a4cb4a5c3242527b82">mlx::core::bool_</a></div><div class="ttdeci">constexpr Dtype bool_</div><div class="ttdef"><b>Definition</b> dtype.h:60</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a1e6cec03ebd80fd2d6b12b288367bfa8"><div class="ttname"><a href="namespacemlx_1_1core.html#a1e6cec03ebd80fd2d6b12b288367bfa8">mlx::core::deleter_t</a></div><div class="ttdeci">std::function&lt; void(allocator::Buffer)&gt; deleter_t</div><div class="ttdef"><b>Definition</b> array.h:18</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a1f42e3dd4787d2ecec7114a12daefec8"><div class="ttname"><a href="namespacemlx_1_1core.html#a1f42e3dd4787d2ecec7114a12daefec8">mlx::core::uint64</a></div><div class="ttdeci">constexpr Dtype uint64</div><div class="ttdef"><b>Definition</b> dtype.h:65</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a312a70c487366968af5e6cbf5038c812"><div class="ttname"><a href="namespacemlx_1_1core.html#a312a70c487366968af5e6cbf5038c812">mlx::core::uint16</a></div><div class="ttdeci">constexpr Dtype uint16</div><div class="ttdef"><b>Definition</b> dtype.h:63</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a514cf8b4e6f0a6af3a867e752f4338f7"><div class="ttname"><a href="namespacemlx_1_1core.html#a514cf8b4e6f0a6af3a867e752f4338f7">mlx::core::bfloat16</a></div><div class="ttdeci">constexpr Dtype bfloat16</div><div class="ttdef"><b>Definition</b> dtype.h:74</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a5d6373aad1444edc9de1eb07bfe5cad3"><div class="ttname"><a href="namespacemlx_1_1core.html#a5d6373aad1444edc9de1eb07bfe5cad3">mlx::core::int32</a></div><div class="ttdeci">constexpr Dtype int32</div><div class="ttdef"><b>Definition</b> dtype.h:69</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a6894543b340321193dfb8052c438a319"><div class="ttname"><a href="namespacemlx_1_1core.html#a6894543b340321193dfb8052c438a319">mlx::core::float32</a></div><div class="ttdeci">constexpr Dtype float32</div><div class="ttdef"><b>Definition</b> dtype.h:73</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a71ebba4ad1afa730962f0692c4f42f07"><div class="ttname"><a href="namespacemlx_1_1core.html#a71ebba4ad1afa730962f0692c4f42f07">mlx::core::int16</a></div><div class="ttdeci">constexpr Dtype int16</div><div class="ttdef"><b>Definition</b> dtype.h:68</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a892e934e146dd938d144cee8813ca672"><div class="ttname"><a href="namespacemlx_1_1core.html#a892e934e146dd938d144cee8813ca672">mlx::core::int8</a></div><div class="ttdeci">constexpr Dtype int8</div><div class="ttdef"><b>Definition</b> dtype.h:67</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a9019bdc191054ada0a502c7c34cef5b8"><div class="ttname"><a href="namespacemlx_1_1core.html#a9019bdc191054ada0a502c7c34cef5b8">mlx::core::int64</a></div><div class="ttdeci">constexpr Dtype int64</div><div class="ttdef"><b>Definition</b> dtype.h:70</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a94c1057929b390e5613304afa16dfbda"><div class="ttname"><a href="namespacemlx_1_1core.html#a94c1057929b390e5613304afa16dfbda">mlx::core::is_arrays_v</a></div><div class="ttdeci">constexpr bool is_arrays_v</div><div class="ttdef"><b>Definition</b> array.h:562</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a9778d50afbf456b0bd738751243b3b68"><div class="ttname"><a href="namespacemlx_1_1core.html#a9778d50afbf456b0bd738751243b3b68">mlx::core::uint8</a></div><div class="ttdeci">constexpr Dtype uint8</div><div class="ttdef"><b>Definition</b> dtype.h:62</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_abf228ee9d8ec48c03bb15adcc4e1f3ec"><div class="ttname"><a href="namespacemlx_1_1core.html#abf228ee9d8ec48c03bb15adcc4e1f3ec">mlx::core::float16</a></div><div class="ttdeci">constexpr Dtype float16</div><div class="ttdef"><b>Definition</b> dtype.h:72</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_ac63820d6fe10545907c33faf466a929e"><div class="ttname"><a href="namespacemlx_1_1core.html#ac63820d6fe10545907c33faf466a929e">mlx::core::uint32</a></div><div class="ttdeci">constexpr Dtype uint32</div><div class="ttdef"><b>Definition</b> dtype.h:64</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_add4794cc0ffe5d717fc146084a235d95"><div class="ttname"><a href="namespacemlx_1_1core.html#add4794cc0ffe5d717fc146084a235d95">mlx::core::size_of</a></div><div class="ttdeci">uint8_t size_of(const Dtype &amp;t)</div><div class="ttdef"><b>Definition</b> dtype.h:95</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_af89751d79339f3e4d9318ea97d64d114"><div class="ttname"><a href="namespacemlx_1_1core.html#af89751d79339f3e4d9318ea97d64d114">mlx::core::enable_for_arrays_t</a></div><div class="ttdeci">typename std::enable_if_t&lt; is_arrays_v&lt; T... &gt; &gt; enable_for_arrays_t</div><div class="ttdef"><b>Definition</b> array.h:565</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_af99db87e0078bfcdb383f5689bc874d4"><div class="ttname"><a href="namespacemlx_1_1core.html#af99db87e0078bfcdb383f5689bc874d4">mlx::core::complex64</a></div><div class="ttdeci">constexpr Dtype complex64</div><div class="ttdef"><b>Definition</b> dtype.h:75</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_dtype_html"><div class="ttname"><a href="structmlx_1_1core_1_1_dtype.html">mlx::core::Dtype</a></div><div class="ttdef"><b>Definition</b> dtype.h:15</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_type_to_dtype_html"><div class="ttname"><a href="structmlx_1_1core_1_1_type_to_dtype.html">mlx::core::TypeToDtype</a></div><div class="ttdef"><b>Definition</b> dtype.h:102</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_array_iterator_html"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_array_iterator.html">mlx::core::array::ArrayIterator</a></div><div class="ttdef"><b>Definition</b> array.h:141</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_array_iterator_html_a153756072fda6d3e53bcca11b46a1238"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a153756072fda6d3e53bcca11b46a1238">mlx::core::array::ArrayIterator::operator*</a></div><div class="ttdeci">reference operator*() const</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_array_iterator_html_a1afd6d2a19a2b0d712063f221ab4eba7"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a1afd6d2a19a2b0d712063f221ab4eba7">mlx::core::array::ArrayIterator::operator==</a></div><div class="ttdeci">friend bool operator==(const ArrayIterator &amp;a, const ArrayIterator &amp;b)</div><div class="ttdef"><b>Definition</b> array.h:161</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_array_iterator_html_a2cbf481e39164245668b3be6cbcc614d"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a2cbf481e39164245668b3be6cbcc614d">mlx::core::array::ArrayIterator::iterator_category</a></div><div class="ttdeci">std::random_access_iterator_tag iterator_category</div><div class="ttdef"><b>Definition</b> array.h:142</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_array_iterator_html_a3efe69356a84d0d4438f033992fcbd9d"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a3efe69356a84d0d4438f033992fcbd9d">mlx::core::array::ArrayIterator::operator++</a></div><div class="ttdeci">ArrayIterator &amp; operator++()</div><div class="ttdef"><b>Definition</b> array.h:156</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_array_iterator_html_a971aa511ab2e7ae1caae09556643a0bd"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_array_iterator.html#a971aa511ab2e7ae1caae09556643a0bd">mlx::core::array::ArrayIterator::operator!=</a></div><div class="ttdeci">friend bool operator!=(const ArrayIterator &amp;a, const ArrayIterator &amp;b)</div><div class="ttdef"><b>Definition</b> array.h:164</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_array_iterator_html_ad3afcb24c6db7642bbc06835f7f3e27a"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_array_iterator.html#ad3afcb24c6db7642bbc06835f7f3e27a">mlx::core::array::ArrayIterator::ArrayIterator</a></div><div class="ttdeci">ArrayIterator(const array &amp;arr, int idx=0)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_array_iterator_html_adcee44c77980fc2370a2c31e203aead5"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_array_iterator.html#adcee44c77980fc2370a2c31e203aead5">mlx::core::array::ArrayIterator::difference_type</a></div><div class="ttdeci">size_t difference_type</div><div class="ttdef"><b>Definition</b> array.h:143</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_array_iterator_html_ae24fe304397e961687d0d4c7012b8ae4"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_array_iterator.html#ae24fe304397e961687d0d4c7012b8ae4">mlx::core::array::ArrayIterator::value_type</a></div><div class="ttdeci">const array value_type</div><div class="ttdef"><b>Definition</b> array.h:144</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_array_iterator_html_ae2adde594b5a4853f6bc78263a957d85"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_array_iterator.html#ae2adde594b5a4853f6bc78263a957d85">mlx::core::array::ArrayIterator::operator+</a></div><div class="ttdeci">ArrayIterator &amp; operator+(difference_type diff)</div><div class="ttdef"><b>Definition</b> array.h:151</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_data_html"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_data.html">mlx::core::array::Data</a></div><div class="ttdef"><b>Definition</b> array.h:208</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_data_html_a1cf69d9709206578c4e87e9c1daad5e1"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_data.html#a1cf69d9709206578c4e87e9c1daad5e1">mlx::core::array::Data::~Data</a></div><div class="ttdeci">~Data()</div><div class="ttdef"><b>Definition</b> array.h:216</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_data_html_a25f52ac67912a49bb6e2b6715aa65311"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_data.html#a25f52ac67912a49bb6e2b6715aa65311">mlx::core::array::Data::d</a></div><div class="ttdeci">deleter_t d</div><div class="ttdef"><b>Definition</b> array.h:210</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_data_html_a50f242040b123052e48e18c244ff70fc"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_data.html#a50f242040b123052e48e18c244ff70fc">mlx::core::array::Data::Data</a></div><div class="ttdeci">Data(const Data &amp;d)=delete</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_data_html_a68e9417954fe811b5e41e6317a526748"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_data.html#a68e9417954fe811b5e41e6317a526748">mlx::core::array::Data::operator=</a></div><div class="ttdeci">Data &amp; operator=(const Data &amp;d)=delete</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_data_html_a77e2ea35fac1d54e4062468a432e1482"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_data.html#a77e2ea35fac1d54e4062468a432e1482">mlx::core::array::Data::Data</a></div><div class="ttdeci">Data(allocator::Buffer buffer, deleter_t d=allocator::free)</div><div class="ttdef"><b>Definition</b> array.h:211</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_data_html_a9a51e2d12ba505027cc0fca86bdd39ad"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_data.html#a9a51e2d12ba505027cc0fca86bdd39ad">mlx::core::array::Data::buffer</a></div><div class="ttdeci">allocator::Buffer buffer</div><div class="ttdef"><b>Definition</b> array.h:209</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_flags_html"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_flags.html">mlx::core::array::Flags</a></div><div class="ttdef"><b>Definition</b> array.h:221</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_flags_html_a3170fa381dc7a90f6eabcc029bdf9bfd"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_flags.html#a3170fa381dc7a90f6eabcc029bdf9bfd">mlx::core::array::Flags::row_contiguous</a></div><div class="ttdeci">bool row_contiguous</div><div class="ttdef"><b>Definition</b> array.h:226</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_flags_html_ae24709026598d635e6b5c24a15f8a802"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_flags.html#ae24709026598d635e6b5c24a15f8a802">mlx::core::array::Flags::col_contiguous</a></div><div class="ttdeci">bool col_contiguous</div><div class="ttdef"><b>Definition</b> array.h:227</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_flags_html_afd0ab11e7a486a2a8e50ee84b971ac8a"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_flags.html#afd0ab11e7a486a2a8e50ee84b971ac8a">mlx::core::array::Flags::contiguous</a></div><div class="ttdeci">bool contiguous</div><div class="ttdef"><b>Definition</b> array.h:224</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

520
docs/build/html/atomic_8h.html vendored Normal file
View File

@@ -0,0 +1,520 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/atomic.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a> </div>
<div class="headertitle"><div class="title">atomic.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;metal_atomic&gt;</code><br />
<code>#include &lt;metal_stdlib&gt;</code><br />
</div>
<p><a href="atomic_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx__atomic.html">mlx_atomic&lt; T, typename &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx__atomic_3_01_t_00_01enable__if__t_3_01is__metal__atomic_3_01_t_01_4_01_4_01_4.html">mlx_atomic&lt; T, enable_if_t&lt; is_metal_atomic&lt; T &gt; &gt; &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a802615a5c326e8dd4ab13fefa0231d4e" id="r_a802615a5c326e8dd4ab13fefa0231d4e"><td class="memTemplParams" colspan="2">template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </td></tr>
<tr class="memitem:a802615a5c326e8dd4ab13fefa0231d4e"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a802615a5c326e8dd4ab13fefa0231d4e">mlx_atomic_load_explicit</a> (device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *object, uint offset)</td></tr>
<tr class="separator:a802615a5c326e8dd4ab13fefa0231d4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8108e66ef9a5fa8c62e6a7c6504c43aa" id="r_a8108e66ef9a5fa8c62e6a7c6504c43aa"><td class="memTemplParams" colspan="2">template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </td></tr>
<tr class="memitem:a8108e66ef9a5fa8c62e6a7c6504c43aa"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a8108e66ef9a5fa8c62e6a7c6504c43aa">mlx_atomic_store_explicit</a> (device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *object, T val, uint offset)</td></tr>
<tr class="separator:a8108e66ef9a5fa8c62e6a7c6504c43aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a65bd5cae890db9b927d853a52bdc06e8" id="r_a65bd5cae890db9b927d853a52bdc06e8"><td class="memTemplParams" colspan="2">template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </td></tr>
<tr class="memitem:a65bd5cae890db9b927d853a52bdc06e8"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a65bd5cae890db9b927d853a52bdc06e8">mlx_atomic_fetch_and_explicit</a> (device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *object, T val, uint offset)</td></tr>
<tr class="separator:a65bd5cae890db9b927d853a52bdc06e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a995c2d054cc4faa7b86e9a8719ff3e6f" id="r_a995c2d054cc4faa7b86e9a8719ff3e6f"><td class="memTemplParams" colspan="2">template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </td></tr>
<tr class="memitem:a995c2d054cc4faa7b86e9a8719ff3e6f"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a995c2d054cc4faa7b86e9a8719ff3e6f">mlx_atomic_fetch_or_explicit</a> (device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *object, T val, uint offset)</td></tr>
<tr class="separator:a995c2d054cc4faa7b86e9a8719ff3e6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab962bd4d6ee8040e930e03f54c5ac16a" id="r_ab962bd4d6ee8040e930e03f54c5ac16a"><td class="memTemplParams" colspan="2">template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </td></tr>
<tr class="memitem:ab962bd4d6ee8040e930e03f54c5ac16a"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ab962bd4d6ee8040e930e03f54c5ac16a">mlx_atomic_fetch_min_explicit</a> (device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *object, T val, uint offset)</td></tr>
<tr class="separator:ab962bd4d6ee8040e930e03f54c5ac16a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafeb87661c0b216d994677807a78f6d7" id="r_aafeb87661c0b216d994677807a78f6d7"><td class="memTemplParams" colspan="2">template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </td></tr>
<tr class="memitem:aafeb87661c0b216d994677807a78f6d7"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aafeb87661c0b216d994677807a78f6d7">mlx_atomic_fetch_max_explicit</a> (device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *object, T val, uint offset)</td></tr>
<tr class="separator:aafeb87661c0b216d994677807a78f6d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a37cbd062017e3d056782dcfa7f5f6add" id="r_a37cbd062017e3d056782dcfa7f5f6add"><td class="memTemplParams" colspan="2">template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </td></tr>
<tr class="memitem:a37cbd062017e3d056782dcfa7f5f6add"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a37cbd062017e3d056782dcfa7f5f6add">mlx_atomic_fetch_add_explicit</a> (device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *object, T val, uint offset)</td></tr>
<tr class="separator:a37cbd062017e3d056782dcfa7f5f6add"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adea4b9574507634f411de665f4db7c3c" id="r_adea4b9574507634f411de665f4db7c3c"><td class="memTemplParams" colspan="2">template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </td></tr>
<tr class="memitem:adea4b9574507634f411de665f4db7c3c"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#adea4b9574507634f411de665f4db7c3c">mlx_atomic_fetch_mul_explicit</a> (device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *object, T val, uint offset)</td></tr>
<tr class="separator:adea4b9574507634f411de665f4db7c3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af63dac2f2df485a85b490e58302491b3" id="r_af63dac2f2df485a85b490e58302491b3"><td class="memTemplParams" colspan="2">template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </td></tr>
<tr class="memitem:af63dac2f2df485a85b490e58302491b3"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#af63dac2f2df485a85b490e58302491b3">mlx_atomic_compare_exchange_weak_explicit</a> (device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *object, thread T *expected, T val, uint offset)</td></tr>
<tr class="separator:af63dac2f2df485a85b490e58302491b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa81c17d78ba4c9eb989f288000816c73" id="r_aa81c17d78ba4c9eb989f288000816c73"><td class="memItemLeft" align="right" valign="top">template&lt;&gt; </td></tr>
<tr class="memitem:aa81c17d78ba4c9eb989f288000816c73"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aa81c17d78ba4c9eb989f288000816c73">mlx_atomic_fetch_min_explicit&lt; float &gt;</a> (device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; float &gt; *object, float val, uint offset)</td></tr>
<tr class="separator:aa81c17d78ba4c9eb989f288000816c73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55a4a8fbb8951a18375bdb635cf81af0" id="r_a55a4a8fbb8951a18375bdb635cf81af0"><td class="memItemLeft" align="right" valign="top">template&lt;&gt; </td></tr>
<tr class="memitem:a55a4a8fbb8951a18375bdb635cf81af0"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a55a4a8fbb8951a18375bdb635cf81af0">mlx_atomic_fetch_max_explicit&lt; float &gt;</a> (device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; float &gt; *object, float val, uint offset)</td></tr>
<tr class="separator:a55a4a8fbb8951a18375bdb635cf81af0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c328b82e1b4c8cd0e9c864ecac30136" id="r_a0c328b82e1b4c8cd0e9c864ecac30136"><td class="memTemplParams" colspan="2">template&lt;typename T , enable_if_t&lt;!<a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </td></tr>
<tr class="memitem:a0c328b82e1b4c8cd0e9c864ecac30136"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a0c328b82e1b4c8cd0e9c864ecac30136">mlx_atomic_compare_exchange_weak_explicit</a> (device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *object, thread uint *expected, uint val, uint offset)</td></tr>
<tr class="separator:a0c328b82e1b4c8cd0e9c864ecac30136"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a91a8bdcae647947a83c6689d7f252d24" id="r_a91a8bdcae647947a83c6689d7f252d24"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a91a8bdcae647947a83c6689d7f252d24"><td class="memTemplItemLeft" align="right" valign="top">constexpr constant bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a></td></tr>
<tr class="separator:a91a8bdcae647947a83c6689d7f252d24"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="af63dac2f2df485a85b490e58302491b3" name="af63dac2f2df485a85b490e58302491b3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af63dac2f2df485a85b490e58302491b3">&#9670;&#160;</a></span>mlx_atomic_compare_exchange_weak_explicit() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC bool mlx_atomic_compare_exchange_weak_explicit </td>
<td>(</td>
<td class="paramtype">device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>object</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">thread T *</td> <td class="paramname"><span class="paramname"><em>expected</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">T</td> <td class="paramname"><span class="paramname"><em>val</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>offset</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a0c328b82e1b4c8cd0e9c864ecac30136" name="a0c328b82e1b4c8cd0e9c864ecac30136"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c328b82e1b4c8cd0e9c864ecac30136">&#9670;&#160;</a></span>mlx_atomic_compare_exchange_weak_explicit() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , enable_if_t&lt;!<a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC bool mlx_atomic_compare_exchange_weak_explicit </td>
<td>(</td>
<td class="paramtype">device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>object</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">thread uint *</td> <td class="paramname"><span class="paramname"><em>expected</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>val</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>offset</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a37cbd062017e3d056782dcfa7f5f6add" name="a37cbd062017e3d056782dcfa7f5f6add"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a37cbd062017e3d056782dcfa7f5f6add">&#9670;&#160;</a></span>mlx_atomic_fetch_add_explicit()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC void mlx_atomic_fetch_add_explicit </td>
<td>(</td>
<td class="paramtype">device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>object</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">T</td> <td class="paramname"><span class="paramname"><em>val</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>offset</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a65bd5cae890db9b927d853a52bdc06e8" name="a65bd5cae890db9b927d853a52bdc06e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a65bd5cae890db9b927d853a52bdc06e8">&#9670;&#160;</a></span>mlx_atomic_fetch_and_explicit()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC void mlx_atomic_fetch_and_explicit </td>
<td>(</td>
<td class="paramtype">device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>object</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">T</td> <td class="paramname"><span class="paramname"><em>val</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>offset</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aafeb87661c0b216d994677807a78f6d7" name="aafeb87661c0b216d994677807a78f6d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aafeb87661c0b216d994677807a78f6d7">&#9670;&#160;</a></span>mlx_atomic_fetch_max_explicit()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC void mlx_atomic_fetch_max_explicit </td>
<td>(</td>
<td class="paramtype">device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>object</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">T</td> <td class="paramname"><span class="paramname"><em>val</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>offset</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a55a4a8fbb8951a18375bdb635cf81af0" name="a55a4a8fbb8951a18375bdb635cf81af0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a55a4a8fbb8951a18375bdb635cf81af0">&#9670;&#160;</a></span>mlx_atomic_fetch_max_explicit&lt; float &gt;()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC void <a class="el" href="#aafeb87661c0b216d994677807a78f6d7">mlx_atomic_fetch_max_explicit</a>&lt; float &gt; </td>
<td>(</td>
<td class="paramtype">device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; float &gt; *</td> <td class="paramname"><span class="paramname"><em>object</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>val</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>offset</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ab962bd4d6ee8040e930e03f54c5ac16a" name="ab962bd4d6ee8040e930e03f54c5ac16a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab962bd4d6ee8040e930e03f54c5ac16a">&#9670;&#160;</a></span>mlx_atomic_fetch_min_explicit()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC void mlx_atomic_fetch_min_explicit </td>
<td>(</td>
<td class="paramtype">device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>object</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">T</td> <td class="paramname"><span class="paramname"><em>val</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>offset</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aa81c17d78ba4c9eb989f288000816c73" name="aa81c17d78ba4c9eb989f288000816c73"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa81c17d78ba4c9eb989f288000816c73">&#9670;&#160;</a></span>mlx_atomic_fetch_min_explicit&lt; float &gt;()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC void <a class="el" href="#ab962bd4d6ee8040e930e03f54c5ac16a">mlx_atomic_fetch_min_explicit</a>&lt; float &gt; </td>
<td>(</td>
<td class="paramtype">device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; float &gt; *</td> <td class="paramname"><span class="paramname"><em>object</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>val</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>offset</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="adea4b9574507634f411de665f4db7c3c" name="adea4b9574507634f411de665f4db7c3c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adea4b9574507634f411de665f4db7c3c">&#9670;&#160;</a></span>mlx_atomic_fetch_mul_explicit()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC void mlx_atomic_fetch_mul_explicit </td>
<td>(</td>
<td class="paramtype">device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>object</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">T</td> <td class="paramname"><span class="paramname"><em>val</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>offset</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a995c2d054cc4faa7b86e9a8719ff3e6f" name="a995c2d054cc4faa7b86e9a8719ff3e6f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a995c2d054cc4faa7b86e9a8719ff3e6f">&#9670;&#160;</a></span>mlx_atomic_fetch_or_explicit()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC void mlx_atomic_fetch_or_explicit </td>
<td>(</td>
<td class="paramtype">device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>object</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">T</td> <td class="paramname"><span class="paramname"><em>val</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>offset</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a802615a5c326e8dd4ab13fefa0231d4e" name="a802615a5c326e8dd4ab13fefa0231d4e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a802615a5c326e8dd4ab13fefa0231d4e">&#9670;&#160;</a></span>mlx_atomic_load_explicit()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC T mlx_atomic_load_explicit </td>
<td>(</td>
<td class="paramtype">device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>object</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>offset</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a8108e66ef9a5fa8c62e6a7c6504c43aa" name="a8108e66ef9a5fa8c62e6a7c6504c43aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8108e66ef9a5fa8c62e6a7c6504c43aa">&#9670;&#160;</a></span>mlx_atomic_store_explicit()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , enable_if_t&lt; <a class="el" href="#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt; T &gt;, bool &gt; = true&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC void mlx_atomic_store_explicit </td>
<td>(</td>
<td class="paramtype">device <a class="el" href="structmlx__atomic.html">mlx_atomic</a>&lt; T &gt; *</td> <td class="paramname"><span class="paramname"><em>object</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">T</td> <td class="paramname"><span class="paramname"><em>val</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>offset</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a91a8bdcae647947a83c6689d7f252d24" name="a91a8bdcae647947a83c6689d7f252d24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a91a8bdcae647947a83c6689d7f252d24">&#9670;&#160;</a></span>is_metal_atomic</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr constant bool is_metal_atomic</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= _disjunction&lt;</div>
<div class="line"> is_same&lt;T, int&gt;,</div>
<div class="line"> is_same&lt;T, uint&gt;,</div>
<div class="line"> is_same&lt;T, ulong&gt;,</div>
<div class="line"> is_same&lt;T, float&gt;&gt;::value</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

477
docs/build/html/atomic_8h_source.html vendored Normal file
View File

@@ -0,0 +1,477 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/atomic.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">atomic.h</div></div>
</div><!--header-->
<div class="contents">
<a href="atomic_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;metal_atomic&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;metal_stdlib&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">using namespace </span><a class="code hl_namespace" href="namespacemetal.html">metal</a>;</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// Atomic utils</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#pragma METAL internals : enable</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="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="atomic_8h.html#a91a8bdcae647947a83c6689d7f252d24"> 16</a></span><span class="keyword">constexpr</span> constant <span class="keywordtype">bool</span> <a class="code hl_variable" href="atomic_8h.html#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a> = _disjunction&lt;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> is_same&lt;T, int&gt;,</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> is_same&lt;T, uint&gt;,</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> is_same&lt;T, ulong&gt;,</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> is_same&lt;T, float&gt;&gt;::value;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#pragma METAL internals : disable</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> = <span class="keywordtype">void</span>&gt;</div>
<div class="foldopen" id="foldopen00025" data-start="{" data-end="};">
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="structmlx__atomic.html"> 25</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic</a> {</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="structmlx__atomic.html#a6f6651b8dd8149917c50cd99b13c6747"> 26</a></span> atomic&lt;uint&gt; <a class="code hl_variable" href="structmlx__atomic.html#a6f6651b8dd8149917c50cd99b13c6747">val</a>;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span>};</div>
</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00030" data-start="{" data-end="};">
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="structmlx__atomic_3_01_t_00_01enable__if__t_3_01is__metal__atomic_3_01_t_01_4_01_4_01_4.html"> 30</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic</a>&lt;T, enable_if_t&lt;<a class="code hl_variable" href="atomic_8h.html#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a>&lt;T&gt;&gt;&gt; {</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="structmlx__atomic_3_01_t_00_01enable__if__t_3_01is__metal__atomic_3_01_t_01_4_01_4_01_4.html#a8dbf729fcd8c4a16e41b546c7405543d"> 31</a></span> atomic&lt;T&gt; <a class="code hl_variable" href="structmlx__atomic_3_01_t_00_01enable__if__t_3_01is__metal__atomic_3_01_t_01_4_01_4_01_4.html#a8dbf729fcd8c4a16e41b546c7405543d">val</a>;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span>};</div>
</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment">// Native metal atomics</span></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><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span>METAL_FUNC T</div>
<div class="foldopen" id="foldopen00040" data-start="{" data-end="}">
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="atomic_8h.html#a802615a5c326e8dd4ab13fefa0231d4e"> 40</a></span><a class="code hl_function" href="atomic_8h.html#a802615a5c326e8dd4ab13fefa0231d4e">mlx_atomic_load_explicit</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>, uint offset) {</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">return</span> atomic_load_explicit(&amp;(<span class="keywordtype">object</span>[offset].val), memory_order_relaxed);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span>}</div>
</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span>METAL_FUNC <span class="keywordtype">void</span></div>
<div class="foldopen" id="foldopen00046" data-start="{" data-end="}">
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="atomic_8h.html#a8108e66ef9a5fa8c62e6a7c6504c43aa"> 46</a></span><a class="code hl_function" href="atomic_8h.html#a8108e66ef9a5fa8c62e6a7c6504c43aa">mlx_atomic_store_explicit</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>, T val, uint offset) {</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> atomic_store_explicit(&amp;(<span class="keywordtype">object</span>[offset].val), val, memory_order_relaxed);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span>}</div>
</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="foldopen" id="foldopen00051" data-start="{" data-end="}">
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="atomic_8h.html#a65bd5cae890db9b927d853a52bdc06e8"> 51</a></span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="atomic_8h.html#a65bd5cae890db9b927d853a52bdc06e8">mlx_atomic_fetch_and_explicit</a>(</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> T val,</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> uint offset) {</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> atomic_fetch_and_explicit(&amp;(<span class="keywordtype">object</span>[offset].val), val, memory_order_relaxed);</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, enable_if_t&lt;is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span>METAL_FUNC <span class="keywordtype">void</span></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="atomic_8h.html#a995c2d054cc4faa7b86e9a8719ff3e6f"> 60</a></span><a class="code hl_function" href="atomic_8h.html#a995c2d054cc4faa7b86e9a8719ff3e6f">mlx_atomic_fetch_or_explicit</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>, T val, uint offset) {</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> atomic_fetch_or_explicit(&amp;(<span class="keywordtype">object</span>[offset].val), val, memory_order_relaxed);</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> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</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="atomic_8h.html#ab962bd4d6ee8040e930e03f54c5ac16a"> 65</a></span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="atomic_8h.html#ab962bd4d6ee8040e930e03f54c5ac16a">mlx_atomic_fetch_min_explicit</a>(</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> T val,</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> uint offset) {</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> atomic_fetch_min_explicit(&amp;(<span class="keywordtype">object</span>[offset].val), val, memory_order_relaxed);</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span>}</div>
</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="foldopen" id="foldopen00073" data-start="{" data-end="}">
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="atomic_8h.html#aafeb87661c0b216d994677807a78f6d7"> 73</a></span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="atomic_8h.html#aafeb87661c0b216d994677807a78f6d7">mlx_atomic_fetch_max_explicit</a>(</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> T val,</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> uint offset) {</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> atomic_fetch_max_explicit(&amp;(<span class="keywordtype">object</span>[offset].val), val, memory_order_relaxed);</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span>}</div>
</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="foldopen" id="foldopen00081" data-start="{" data-end="}">
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="atomic_8h.html#a37cbd062017e3d056782dcfa7f5f6add"> 81</a></span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="atomic_8h.html#a37cbd062017e3d056782dcfa7f5f6add">mlx_atomic_fetch_add_explicit</a>(</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> T val,</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> uint offset) {</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> atomic_fetch_add_explicit(&amp;(<span class="keywordtype">object</span>[offset].val), val, memory_order_relaxed);</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span>}</div>
</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="foldopen" id="foldopen00089" data-start="{" data-end="}">
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="atomic_8h.html#adea4b9574507634f411de665f4db7c3c"> 89</a></span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="atomic_8h.html#adea4b9574507634f411de665f4db7c3c">mlx_atomic_fetch_mul_explicit</a>(</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> T val,</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> uint offset) {</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> T expected = <a class="code hl_function" href="atomic_8h.html#a802615a5c326e8dd4ab13fefa0231d4e">mlx_atomic_load_explicit</a>(<span class="keywordtype">object</span>, offset);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">while</span> (!<a class="code hl_function" href="atomic_8h.html#af63dac2f2df485a85b490e58302491b3">mlx_atomic_compare_exchange_weak_explicit</a>(</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordtype">object</span>, &amp;expected, val * expected, offset)) {</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>}</div>
</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="foldopen" id="foldopen00100" data-start="{" data-end="}">
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="atomic_8h.html#af63dac2f2df485a85b490e58302491b3"> 100</a></span>METAL_FUNC <span class="keywordtype">bool</span> <a class="code hl_function" href="atomic_8h.html#af63dac2f2df485a85b490e58302491b3">mlx_atomic_compare_exchange_weak_explicit</a>(</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> thread T* expected,</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> T val,</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> uint offset) {</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordflow">return</span> atomic_compare_exchange_weak_explicit(</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> &amp;(<span class="keywordtype">object</span>[offset].val),</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> expected,</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> val,</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> memory_order_relaxed,</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> memory_order_relaxed);</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span>}</div>
</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> </div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span><span class="comment">// Specialization for float since it does not atomic_fetch_min_explicit</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00115" data-start="{" data-end="}">
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="atomic_8h.html#aa81c17d78ba4c9eb989f288000816c73"> 115</a></span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="atomic_8h.html#aa81c17d78ba4c9eb989f288000816c73">mlx_atomic_fetch_min_explicit&lt;float&gt;</a>(</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;float&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordtype">float</span> val,</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> uint offset) {</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordtype">float</span> expected = <a class="code hl_function" href="atomic_8h.html#a802615a5c326e8dd4ab13fefa0231d4e">mlx_atomic_load_explicit</a>(<span class="keywordtype">object</span>, offset);</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordflow">while</span> (val &lt; expected) {</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="atomic_8h.html#af63dac2f2df485a85b490e58302491b3">mlx_atomic_compare_exchange_weak_explicit</a>(</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordtype">object</span>, &amp;expected, val, offset)) {</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">return</span>;</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"> 125</span> }</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span>}</div>
</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span><span class="comment">// Specialization for float since it does not atomic_fetch_max_explicit</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span><span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00130" data-start="{" data-end="}">
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="atomic_8h.html#a55a4a8fbb8951a18375bdb635cf81af0"> 130</a></span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="atomic_8h.html#a55a4a8fbb8951a18375bdb635cf81af0">mlx_atomic_fetch_max_explicit&lt;float&gt;</a>(</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;float&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordtype">float</span> val,</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> uint offset) {</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordtype">float</span> expected = <a class="code hl_function" href="atomic_8h.html#a802615a5c326e8dd4ab13fefa0231d4e">mlx_atomic_load_explicit</a>(<span class="keywordtype">object</span>, offset);</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordflow">while</span> (val &gt; expected) {</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="atomic_8h.html#af63dac2f2df485a85b490e58302491b3">mlx_atomic_compare_exchange_weak_explicit</a>(</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keywordtype">object</span>, &amp;expected, val, offset)) {</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> }</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> }</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span>}</div>
</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> </div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span><span class="comment">// Custom atomics</span></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="keyword">namespace </span>{</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span><span class="keyword">constexpr</span> constant uint packing_size = <span class="keyword">sizeof</span>(uint) / <span class="keyword">sizeof</span>(T);</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="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span><span class="keyword">union </span>uint_or_packed {</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> T val[packing_size&lt;T&gt;];</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> uint <a class="code hl_function" href="namespacemlx_1_1core_1_1random.html#abb895baa477f5a06b5f88e69245f1825">bits</a>;</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="keyword">template</span> &lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> Op&gt;</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span><span class="keyword">struct </span>mlx_atomic_update_helper {</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> uint operator()(uint_or_packed&lt;T&gt; init, T update, uint elem_offset) {</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> Op <a class="code hl_variable" href="common_2binary_8h.html#a70228731d29946574b238d21fb4b360c">op</a>;</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <a class="code hl_function" href="namespacemlx_1_1core_1_1distributed.html#a33633c058c7ec82cca4f237243c6810d">init</a>.val[elem_offset] = <a class="code hl_variable" href="common_2binary_8h.html#a70228731d29946574b238d21fb4b360c">op</a>(update, <a class="code hl_function" href="namespacemlx_1_1core_1_1distributed.html#a33633c058c7ec82cca4f237243c6810d">init</a>.val[elem_offset]);</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemlx_1_1core_1_1distributed.html#a33633c058c7ec82cca4f237243c6810d">init</a>.bits;</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> }</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span>};</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, <span class="keyword">typename</span> Op&gt;</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span>METAL_FUNC <span class="keywordtype">void</span> mlx_atomic_update_and_store(</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> T update,</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> uint offset) {</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> uint pack_offset = offset / packing_size&lt;T&gt;;</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> uint elem_offset = offset % packing_size&lt;T&gt;;</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> mlx_atomic_update_helper&lt;T, Op&gt; helper;</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> uint_or_packed&lt;T&gt; expected;</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> expected.bits =</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> atomic_load_explicit(&amp;(<span class="keywordtype">object</span>[pack_offset].val), memory_order_relaxed);</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> </div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <span class="keywordflow">while</span> (Op::condition(update, expected.val[elem_offset]) &amp;&amp;</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> !<a class="code hl_function" href="atomic_8h.html#af63dac2f2df485a85b490e58302491b3">mlx_atomic_compare_exchange_weak_explicit</a>(</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> &amp;(expected.bits),</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> helper(expected, update, elem_offset),</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> pack_offset)) {</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> }</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span>}</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> </div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span><span class="keyword">struct </span>__None {</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> condition(T a, T b) {</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span><span class="preprocessor">#pragma unused(a)</span></div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span><span class="preprocessor">#pragma unused(b)</span></div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</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 class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> T operator()(T a, T b) {</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span><span class="preprocessor">#pragma unused(b)</span></div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <span class="keywordflow">return</span> a;</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> }</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 class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span><span class="keyword">struct </span>__Add {</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> condition(T a, T b) {</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span><span class="preprocessor">#pragma unused(a)</span></div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span><span class="preprocessor">#pragma unused(b)</span></div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> }</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> </div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> T operator()(T a, T b) {</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <span class="keywordflow">return</span> a + b;</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> }</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span>};</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span><span class="keyword">struct </span>__Mul {</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> condition(T a, T b) {</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span><span class="preprocessor">#pragma unused(a)</span></div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="keywordflow">return</span> b != 0;</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> }</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> </div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> T operator()(T a, T b) {</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <span class="keywordflow">return</span> a * b;</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> }</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span>};</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> </div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span><span class="keyword">struct </span>__Max {</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> condition(T a, T b) {</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="keywordflow">return</span> a &gt; b;</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> }</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> T operator()(T a, T b) {</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemetal.html#a853c80479ab2264d9c4587c7bcac767b">max</a>(a, b);</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> }</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span>};</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="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span><span class="keyword">struct </span>__Min {</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> condition(T a, T b) {</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> <span class="keywordflow">return</span> a &lt; b;</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> }</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> T operator()(T a, T b) {</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">min</a>(a, b);</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> }</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span>};</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> </div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span>} <span class="comment">// namespace</span></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"> 252</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;!is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span>METAL_FUNC T</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span><a class="code hl_function" href="atomic_8h.html#a802615a5c326e8dd4ab13fefa0231d4e">mlx_atomic_load_explicit</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>, uint offset) {</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> uint pack_offset = offset / <span class="keyword">sizeof</span>(T);</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> uint elem_offset = offset % <span class="keyword">sizeof</span>(T);</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> uint_or_packed&lt;T&gt; packed_val;</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> packed_val.bits =</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> atomic_load_explicit(&amp;(<span class="keywordtype">object</span>[pack_offset].val), memory_order_relaxed);</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> <span class="keywordflow">return</span> packed_val.val[elem_offset];</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span>}</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> </div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;!is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span>METAL_FUNC <span class="keywordtype">void</span></div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span><a class="code hl_function" href="atomic_8h.html#a8108e66ef9a5fa8c62e6a7c6504c43aa">mlx_atomic_store_explicit</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>, T val, uint offset) {</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> mlx_atomic_update_and_store&lt;T, __None&lt;T&gt;&gt;(object, val, offset);</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span>}</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> </div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;!is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="atomic_8h.html#a65bd5cae890db9b927d853a52bdc06e8">mlx_atomic_fetch_and_explicit</a>(</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> T val,</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> uint offset) {</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> uint pack_offset = offset / packing_size&lt;T&gt;;</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> uint elem_offset = offset % packing_size&lt;T&gt;;</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> uint_or_packed&lt;T&gt; <a class="code hl_function" href="group__ops.html#ga484eaa10d5e19a4ca46d3a9cd9fab600">identity</a>;</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> <a class="code hl_function" href="group__ops.html#ga484eaa10d5e19a4ca46d3a9cd9fab600">identity</a>.bits = __UINT32_MAX__;</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> <a class="code hl_function" href="group__ops.html#ga484eaa10d5e19a4ca46d3a9cd9fab600">identity</a>.val[elem_offset] = val;</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> </div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> atomic_fetch_and_explicit(</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> &amp;(<span class="keywordtype">object</span>[pack_offset].val), <a class="code hl_function" href="group__ops.html#ga484eaa10d5e19a4ca46d3a9cd9fab600">identity</a>.bits, memory_order_relaxed);</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span>}</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> </div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;!is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span>METAL_FUNC <span class="keywordtype">void</span></div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span><a class="code hl_function" href="atomic_8h.html#a995c2d054cc4faa7b86e9a8719ff3e6f">mlx_atomic_fetch_or_explicit</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>, T val, uint offset) {</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> uint pack_offset = offset / packing_size&lt;T&gt;;</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> uint elem_offset = offset % packing_size&lt;T&gt;;</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> uint_or_packed&lt;T&gt; <a class="code hl_function" href="group__ops.html#ga484eaa10d5e19a4ca46d3a9cd9fab600">identity</a>;</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> <a class="code hl_function" href="group__ops.html#ga484eaa10d5e19a4ca46d3a9cd9fab600">identity</a>.bits = 0;</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> <a class="code hl_function" href="group__ops.html#ga484eaa10d5e19a4ca46d3a9cd9fab600">identity</a>.val[elem_offset] = val;</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> </div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> atomic_fetch_or_explicit(</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> &amp;(<span class="keywordtype">object</span>[pack_offset].val), <a class="code hl_function" href="group__ops.html#ga484eaa10d5e19a4ca46d3a9cd9fab600">identity</a>.bits, memory_order_relaxed);</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span>}</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> </div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;!is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="atomic_8h.html#ab962bd4d6ee8040e930e03f54c5ac16a">mlx_atomic_fetch_min_explicit</a>(</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> T val,</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> uint offset) {</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> mlx_atomic_update_and_store&lt;T, __Min&lt;T&gt;&gt;(object, val, offset);</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span>}</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> </div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;!is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="atomic_8h.html#aafeb87661c0b216d994677807a78f6d7">mlx_atomic_fetch_max_explicit</a>(</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> T val,</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> uint offset) {</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> mlx_atomic_update_and_store&lt;T, __Max&lt;T&gt;&gt;(object, val, offset);</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span>}</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> </div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;!is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="atomic_8h.html#a37cbd062017e3d056782dcfa7f5f6add">mlx_atomic_fetch_add_explicit</a>(</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> T val,</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span> uint offset) {</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span> mlx_atomic_update_and_store&lt;T, __Add&lt;T&gt;&gt;(object, val, offset);</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span>}</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> </div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;!is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="atomic_8h.html#adea4b9574507634f411de665f4db7c3c">mlx_atomic_fetch_mul_explicit</a>(</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> T val,</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> uint offset) {</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> mlx_atomic_update_and_store&lt;T, __Mul&lt;T&gt;&gt;(object, val, offset);</div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span>}</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> </div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, enable_if_t&lt;!is_metal_atomic&lt;T&gt;, <span class="keywordtype">bool</span>&gt; = true&gt;</div>
<div class="foldopen" id="foldopen00330" data-start="{" data-end="}">
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"><a class="line" href="atomic_8h.html#a0c328b82e1b4c8cd0e9c864ecac30136"> 330</a></span>METAL_FUNC <span class="keywordtype">bool</span> <a class="code hl_function" href="atomic_8h.html#af63dac2f2df485a85b490e58302491b3">mlx_atomic_compare_exchange_weak_explicit</a>(</div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* <span class="keywordtype">object</span>,</div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span> thread uint* expected,</div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"> 333</span> uint val,</div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span> uint offset) {</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> <span class="keywordflow">return</span> atomic_compare_exchange_weak_explicit(</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span> &amp;(<span class="keywordtype">object</span>[offset].val),</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> expected,</div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> val,</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> memory_order_relaxed,</div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span> memory_order_relaxed);</div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span>}</div>
</div>
<div class="ttc" id="aatomic_8h_html_a37cbd062017e3d056782dcfa7f5f6add"><div class="ttname"><a href="atomic_8h.html#a37cbd062017e3d056782dcfa7f5f6add">mlx_atomic_fetch_add_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_add_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:81</div></div>
<div class="ttc" id="aatomic_8h_html_a55a4a8fbb8951a18375bdb635cf81af0"><div class="ttname"><a href="atomic_8h.html#a55a4a8fbb8951a18375bdb635cf81af0">mlx_atomic_fetch_max_explicit&lt; float &gt;</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_max_explicit&lt; float &gt;(device mlx_atomic&lt; float &gt; *object, float val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:130</div></div>
<div class="ttc" id="aatomic_8h_html_a65bd5cae890db9b927d853a52bdc06e8"><div class="ttname"><a href="atomic_8h.html#a65bd5cae890db9b927d853a52bdc06e8">mlx_atomic_fetch_and_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_and_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:51</div></div>
<div class="ttc" id="aatomic_8h_html_a802615a5c326e8dd4ab13fefa0231d4e"><div class="ttname"><a href="atomic_8h.html#a802615a5c326e8dd4ab13fefa0231d4e">mlx_atomic_load_explicit</a></div><div class="ttdeci">METAL_FUNC T mlx_atomic_load_explicit(device mlx_atomic&lt; T &gt; *object, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:40</div></div>
<div class="ttc" id="aatomic_8h_html_a8108e66ef9a5fa8c62e6a7c6504c43aa"><div class="ttname"><a href="atomic_8h.html#a8108e66ef9a5fa8c62e6a7c6504c43aa">mlx_atomic_store_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_store_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:46</div></div>
<div class="ttc" id="aatomic_8h_html_a91a8bdcae647947a83c6689d7f252d24"><div class="ttname"><a href="atomic_8h.html#a91a8bdcae647947a83c6689d7f252d24">is_metal_atomic</a></div><div class="ttdeci">constexpr constant bool is_metal_atomic</div><div class="ttdef"><b>Definition</b> atomic.h:16</div></div>
<div class="ttc" id="aatomic_8h_html_a995c2d054cc4faa7b86e9a8719ff3e6f"><div class="ttname"><a href="atomic_8h.html#a995c2d054cc4faa7b86e9a8719ff3e6f">mlx_atomic_fetch_or_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_or_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:60</div></div>
<div class="ttc" id="aatomic_8h_html_aa81c17d78ba4c9eb989f288000816c73"><div class="ttname"><a href="atomic_8h.html#aa81c17d78ba4c9eb989f288000816c73">mlx_atomic_fetch_min_explicit&lt; float &gt;</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_min_explicit&lt; float &gt;(device mlx_atomic&lt; float &gt; *object, float val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:115</div></div>
<div class="ttc" id="aatomic_8h_html_aafeb87661c0b216d994677807a78f6d7"><div class="ttname"><a href="atomic_8h.html#aafeb87661c0b216d994677807a78f6d7">mlx_atomic_fetch_max_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_max_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:73</div></div>
<div class="ttc" id="aatomic_8h_html_ab962bd4d6ee8040e930e03f54c5ac16a"><div class="ttname"><a href="atomic_8h.html#ab962bd4d6ee8040e930e03f54c5ac16a">mlx_atomic_fetch_min_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_min_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:65</div></div>
<div class="ttc" id="aatomic_8h_html_adea4b9574507634f411de665f4db7c3c"><div class="ttname"><a href="atomic_8h.html#adea4b9574507634f411de665f4db7c3c">mlx_atomic_fetch_mul_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_mul_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:89</div></div>
<div class="ttc" id="aatomic_8h_html_af63dac2f2df485a85b490e58302491b3"><div class="ttname"><a href="atomic_8h.html#af63dac2f2df485a85b490e58302491b3">mlx_atomic_compare_exchange_weak_explicit</a></div><div class="ttdeci">METAL_FUNC bool mlx_atomic_compare_exchange_weak_explicit(device mlx_atomic&lt; T &gt; *object, thread T *expected, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:100</div></div>
<div class="ttc" id="acommon_2binary_8h_html_a70228731d29946574b238d21fb4b360c"><div class="ttname"><a href="common_2binary_8h.html#a70228731d29946574b238d21fb4b360c">op</a></div><div class="ttdeci">Op op</div><div class="ttdef"><b>Definition</b> binary.h:141</div></div>
<div class="ttc" id="agroup__ops_html_ga484eaa10d5e19a4ca46d3a9cd9fab600"><div class="ttname"><a href="group__ops.html#ga484eaa10d5e19a4ca46d3a9cd9fab600">mlx::core::identity</a></div><div class="ttdeci">array identity(int n, Dtype dtype, StreamOrDevice s={})</div><div class="ttdoc">Create a square matrix of shape (n,n) of zeros, and ones in the major diagonal.</div></div>
<div class="ttc" id="anamespacemetal_html"><div class="ttname"><a href="namespacemetal.html">metal</a></div><div class="ttdef"><b>Definition</b> bf16.h:265</div></div>
<div class="ttc" id="anamespacemetal_html_a6653b28c9473087141eddce39878d4d3"><div class="ttname"><a href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a></div><div class="ttdeci">METAL_FUNC bfloat16_t min(bfloat16_t x, bfloat16_t y)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="anamespacemetal_html_a853c80479ab2264d9c4587c7bcac767b"><div class="ttname"><a href="namespacemetal.html#a853c80479ab2264d9c4587c7bcac767b">metal::max</a></div><div class="ttdeci">METAL_FUNC bfloat16_t max(bfloat16_t x, bfloat16_t y)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1distributed_html_a33633c058c7ec82cca4f237243c6810d"><div class="ttname"><a href="namespacemlx_1_1core_1_1distributed.html#a33633c058c7ec82cca4f237243c6810d">mlx::core::distributed::init</a></div><div class="ttdeci">Group init(bool strict=false)</div><div class="ttdoc">Initialize the distributed backend and return the group containing all discoverable processes.</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1random_html_abb895baa477f5a06b5f88e69245f1825"><div class="ttname"><a href="namespacemlx_1_1core_1_1random.html#abb895baa477f5a06b5f88e69245f1825">mlx::core::random::bits</a></div><div class="ttdeci">array bits(const std::vector&lt; int &gt; &amp;shape, int width, const std::optional&lt; array &gt; &amp;key=std::nullopt, StreamOrDevice s={})</div><div class="ttdoc">Generate an array with type uint32 filled with random bits.</div></div>
<div class="ttc" id="astructmlx__atomic_3_01_t_00_01enable__if__t_3_01is__metal__atomic_3_01_t_01_4_01_4_01_4_html_a8dbf729fcd8c4a16e41b546c7405543d"><div class="ttname"><a href="structmlx__atomic_3_01_t_00_01enable__if__t_3_01is__metal__atomic_3_01_t_01_4_01_4_01_4.html#a8dbf729fcd8c4a16e41b546c7405543d">mlx_atomic&lt; T, enable_if_t&lt; is_metal_atomic&lt; T &gt; &gt; &gt;::val</a></div><div class="ttdeci">atomic&lt; T &gt; val</div><div class="ttdef"><b>Definition</b> atomic.h:31</div></div>
<div class="ttc" id="astructmlx__atomic_html"><div class="ttname"><a href="structmlx__atomic.html">mlx_atomic</a></div><div class="ttdef"><b>Definition</b> atomic.h:25</div></div>
<div class="ttc" id="astructmlx__atomic_html_a6f6651b8dd8149917c50cd99b13c6747"><div class="ttname"><a href="structmlx__atomic.html#a6f6651b8dd8149917c50cd99b13c6747">mlx_atomic::val</a></div><div class="ttdeci">atomic&lt; uint &gt; val</div><div class="ttdef"><b>Definition</b> atomic.h:26</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,107 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/accelerate/utils.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_86b95e7b1d0d6e25466bb9213752d32f.html">accelerate</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">utils.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;vecLib/BNNS/bnns.h&gt;</code><br />
<code>#include &quot;<a class="el" href="dtype_8h_source.html">mlx/dtype.h</a>&quot;</code><br />
</div>
<p><a href="backend_2accelerate_2utils_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacemlx" id="r_namespacemlx"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx.html">mlx</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1core" id="r_namespacemlx_1_1core"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html">mlx::core</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a7a4193f37b1de9c33c31d1da09c77edb" id="r_a7a4193f37b1de9c33c31d1da09c77edb"><td class="memItemLeft" align="right" valign="top">BNNSDataType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html#a7a4193f37b1de9c33c31d1da09c77edb">mlx::core::to_bnns_dtype</a> (<a class="el" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> mlx_dtype)</td></tr>
<tr class="separator:a7a4193f37b1de9c33c31d1da09c77edb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,134 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/accelerate/utils.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_86b95e7b1d0d6e25466bb9213752d32f.html">accelerate</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">utils.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2accelerate_2utils_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;vecLib/BNNS/bnns.h&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &quot;<a class="code" href="dtype_8h.html">mlx/dtype.h</a>&quot;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemlx_1_1core.html">mlx::core</a> {</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
<div class="foldopen" id="foldopen00010" data-start="{" data-end="}">
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a7a4193f37b1de9c33c31d1da09c77edb"> 10</a></span>BNNSDataType <a class="code hl_function" href="namespacemlx_1_1core.html#a7a4193f37b1de9c33c31d1da09c77edb">to_bnns_dtype</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1_dtype.html">Dtype</a> mlx_dtype) {</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> uint32_t size_bits = <a class="code hl_function" href="namespacemlx_1_1core.html#add4794cc0ffe5d717fc146084a235d95">size_of</a>(mlx_dtype) * 8;</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> <span class="keywordflow">switch</span> (<a class="code hl_function" href="namespacemlx_1_1core.html#ad527b86818823db040195785efd7d724">kindof</a>(mlx_dtype)) {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715a92eb5ffee6ae2fec3ad71c777531578f">Dtype::Kind::b</a>:</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keywordflow">return</span> BNNSDataTypeBoolean;</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715a7b774effe4a349c6dd82ad4f4f21d34c">Dtype::Kind::u</a>:</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordflow">return</span> BNNSDataType(BNNSDataTypeUIntBit | size_bits);</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715a865c0c0b4ab0e063e5caa3387c1a8741">Dtype::Kind::i</a>:</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordflow">return</span> BNNSDataType(BNNSDataTypeIntBit | size_bits);</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715a8fa14cdd754f91cc6554c9e71929cce7">Dtype::Kind::f</a>:</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordflow">return</span> BNNSDataType(BNNSDataTypeFloatBit | size_bits);</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715a5206560a306a2e085a437fd258eb57ce">Dtype::Kind::V</a>:</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordflow">return</span> BNNSDataTypeBFloat16;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715a4a8a08f09d37b73795649038408b5f33">Dtype::Kind::c</a>:</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;BNNS does not support complex types&quot;</span>);</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>}</div>
</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span>} <span class="comment">// namespace mlx::core</span></div>
<div class="ttc" id="adtype_8h_html"><div class="ttname"><a href="dtype_8h.html">dtype.h</a></div></div>
<div class="ttc" id="anamespacemlx_1_1core_html"><div class="ttname"><a href="namespacemlx_1_1core.html">mlx::core</a></div><div class="ttdef"><b>Definition</b> allocator.h:7</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a7a4193f37b1de9c33c31d1da09c77edb"><div class="ttname"><a href="namespacemlx_1_1core.html#a7a4193f37b1de9c33c31d1da09c77edb">mlx::core::to_bnns_dtype</a></div><div class="ttdeci">BNNSDataType to_bnns_dtype(Dtype mlx_dtype)</div><div class="ttdef"><b>Definition</b> utils.h:10</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_ad527b86818823db040195785efd7d724"><div class="ttname"><a href="namespacemlx_1_1core.html#ad527b86818823db040195785efd7d724">mlx::core::kindof</a></div><div class="ttdeci">Dtype::Kind kindof(const Dtype &amp;t)</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_add4794cc0ffe5d717fc146084a235d95"><div class="ttname"><a href="namespacemlx_1_1core.html#add4794cc0ffe5d717fc146084a235d95">mlx::core::size_of</a></div><div class="ttdeci">uint8_t size_of(const Dtype &amp;t)</div><div class="ttdef"><b>Definition</b> dtype.h:95</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_dtype_html"><div class="ttname"><a href="structmlx_1_1core_1_1_dtype.html">mlx::core::Dtype</a></div><div class="ttdef"><b>Definition</b> dtype.h:15</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_dtype_html_adb1ea8b45a0c53e04a0e73b168702715a4a8a08f09d37b73795649038408b5f33"><div class="ttname"><a href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715a4a8a08f09d37b73795649038408b5f33">mlx::core::Dtype::Kind::c</a></div><div class="ttdeci">@ c</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_dtype_html_adb1ea8b45a0c53e04a0e73b168702715a5206560a306a2e085a437fd258eb57ce"><div class="ttname"><a href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715a5206560a306a2e085a437fd258eb57ce">mlx::core::Dtype::Kind::V</a></div><div class="ttdeci">@ V</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_dtype_html_adb1ea8b45a0c53e04a0e73b168702715a7b774effe4a349c6dd82ad4f4f21d34c"><div class="ttname"><a href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715a7b774effe4a349c6dd82ad4f4f21d34c">mlx::core::Dtype::Kind::u</a></div><div class="ttdeci">@ u</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_dtype_html_adb1ea8b45a0c53e04a0e73b168702715a865c0c0b4ab0e063e5caa3387c1a8741"><div class="ttname"><a href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715a865c0c0b4ab0e063e5caa3387c1a8741">mlx::core::Dtype::Kind::i</a></div><div class="ttdeci">@ i</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_dtype_html_adb1ea8b45a0c53e04a0e73b168702715a8fa14cdd754f91cc6554c9e71929cce7"><div class="ttname"><a href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715a8fa14cdd754f91cc6554c9e71929cce7">mlx::core::Dtype::Kind::f</a></div><div class="ttdeci">@ f</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_dtype_html_adb1ea8b45a0c53e04a0e73b168702715a92eb5ffee6ae2fec3ad71c777531578f"><div class="ttname"><a href="structmlx_1_1core_1_1_dtype.html#adb1ea8b45a0c53e04a0e73b168702715a92eb5ffee6ae2fec3ad71c777531578f">mlx::core::Dtype::Kind::b</a></div><div class="ttdeci">@ b</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,234 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/common/ops.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_f149b24a1b5be11cd70151abe517e3f8.html">common</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">ops.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdint.h&gt;</code><br />
<code>#include &lt;cmath&gt;</code><br />
<code>#include &lt;complex&gt;</code><br />
</div>
<p><a href="backend_2common_2ops_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">union &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="unionmlx_1_1core_1_1detail_1_1_int_or_float.html">mlx::core::detail::IntOrFloat</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_abs.html">mlx::core::detail::Abs</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_cos.html">mlx::core::detail::ArcCos</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_cosh.html">mlx::core::detail::ArcCosh</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_sin.html">mlx::core::detail::ArcSin</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_sinh.html">mlx::core::detail::ArcSinh</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_tan.html">mlx::core::detail::ArcTan</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_tan2.html">mlx::core::detail::ArcTan2</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_arc_tanh.html">mlx::core::detail::ArcTanh</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_ceil.html">mlx::core::detail::Ceil</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_conjugate.html">mlx::core::detail::Conjugate</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_cos.html">mlx::core::detail::Cos</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_cosh.html">mlx::core::detail::Cosh</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_erf.html">mlx::core::detail::Erf</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_erf_inv.html">mlx::core::detail::ErfInv</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_exp.html">mlx::core::detail::Exp</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_expm1.html">mlx::core::detail::Expm1</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_floor.html">mlx::core::detail::Floor</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_log.html">mlx::core::detail::Log</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_log2.html">mlx::core::detail::Log2</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_log10.html">mlx::core::detail::Log10</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_log1p.html">mlx::core::detail::Log1p</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_logical_not.html">mlx::core::detail::LogicalNot</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_negative.html">mlx::core::detail::Negative</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_round.html">mlx::core::detail::Round</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_sigmoid.html">mlx::core::detail::Sigmoid</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_sign.html">mlx::core::detail::Sign</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_sin.html">mlx::core::detail::Sin</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_sinh.html">mlx::core::detail::Sinh</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_square.html">mlx::core::detail::Square</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_sqrt.html">mlx::core::detail::Sqrt</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_rsqrt.html">mlx::core::detail::Rsqrt</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_tan.html">mlx::core::detail::Tan</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_tanh.html">mlx::core::detail::Tanh</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_add.html">mlx::core::detail::Add</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_divide.html">mlx::core::detail::Divide</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_remainder.html">mlx::core::detail::Remainder</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_equal.html">mlx::core::detail::Equal</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_na_n_equal.html">mlx::core::detail::NaNEqual</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_greater.html">mlx::core::detail::Greater</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_greater_equal.html">mlx::core::detail::GreaterEqual</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_less.html">mlx::core::detail::Less</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_less_equal.html">mlx::core::detail::LessEqual</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_maximum.html">mlx::core::detail::Maximum</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_minimum.html">mlx::core::detail::Minimum</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_log_add_exp.html">mlx::core::detail::LogAddExp</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_multiply.html">mlx::core::detail::Multiply</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_not_equal.html">mlx::core::detail::NotEqual</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_power.html">mlx::core::detail::Power</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_subtract.html">mlx::core::detail::Subtract</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_logical_and.html">mlx::core::detail::LogicalAnd</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_logical_or.html">mlx::core::detail::LogicalOr</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_select.html">mlx::core::detail::Select</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_bitwise_and.html">mlx::core::detail::BitwiseAnd</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_bitwise_or.html">mlx::core::detail::BitwiseOr</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_bitwise_xor.html">mlx::core::detail::BitwiseXor</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_left_shift.html">mlx::core::detail::LeftShift</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1detail_1_1_right_shift.html">mlx::core::detail::RightShift</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacemlx" id="r_namespacemlx"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx.html">mlx</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1core" id="r_namespacemlx_1_1core"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html">mlx::core</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1core_1_1detail" id="r_namespacemlx_1_1core_1_1detail"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1detail.html">mlx::core::detail</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a2726436fc72d4a3f0030c89579b4d374" id="r_a2726436fc72d4a3f0030c89579b4d374"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1detail.html#a2726436fc72d4a3f0030c89579b4d374">mlx::core::detail::fast_exp</a> (float x)</td></tr>
<tr class="separator:a2726436fc72d4a3f0030c89579b4d374"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90c9f6149af5adf4e2a95608d5f7b790" id="r_a90c9f6149af5adf4e2a95608d5f7b790"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1detail.html#a90c9f6149af5adf4e2a95608d5f7b790">mlx::core::detail::fast_erf</a> (float a)</td></tr>
<tr class="separator:a90c9f6149af5adf4e2a95608d5f7b790"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad0ff3975e4c96317df1a2de0f7a30c1d" id="r_ad0ff3975e4c96317df1a2de0f7a30c1d"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1detail.html#ad0ff3975e4c96317df1a2de0f7a30c1d">mlx::core::detail::fast_erfinv</a> (float a)</td></tr>
<tr class="separator:ad0ff3975e4c96317df1a2de0f7a30c1d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,121 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/common/utils.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_f149b24a1b5be11cd70151abe517e3f8.html">common</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">utils.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;vector&gt;</code><br />
<code>#include &quot;<a class="el" href="array_8h_source.html">mlx/array.h</a>&quot;</code><br />
</div>
<p><a href="backend_2common_2utils_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacemlx" id="r_namespacemlx"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx.html">mlx</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1core" id="r_namespacemlx_1_1core"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html">mlx::core</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a4950c3248e70280b406a4f1430a85880" id="r_a4950c3248e70280b406a4f1430a85880"><td class="memTemplParams" colspan="2">template&lt;typename stride_t &gt; </td></tr>
<tr class="memitem:a4950c3248e70280b406a4f1430a85880"><td class="memTemplItemLeft" align="right" valign="top">stride_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html#a4950c3248e70280b406a4f1430a85880">mlx::core::elem_to_loc</a> (int elem, const std::vector&lt; int &gt; &amp;shape, const std::vector&lt; stride_t &gt; &amp;strides)</td></tr>
<tr class="separator:a4950c3248e70280b406a4f1430a85880"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad7e4f40eb351b554bbfabb6d7d600d06" id="r_ad7e4f40eb351b554bbfabb6d7d600d06"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html#ad7e4f40eb351b554bbfabb6d7d600d06">mlx::core::elem_to_loc</a> (int elem, const <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &amp;a)</td></tr>
<tr class="separator:ad7e4f40eb351b554bbfabb6d7d600d06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d151ba3e138be1954d2f51f85806b0c" id="r_a9d151ba3e138be1954d2f51f85806b0c"><td class="memTemplParams" colspan="2">template&lt;typename stride_t &gt; </td></tr>
<tr class="memitem:a9d151ba3e138be1954d2f51f85806b0c"><td class="memTemplItemLeft" align="right" valign="top">std::tuple&lt; std::vector&lt; int &gt;, std::vector&lt; std::vector&lt; stride_t &gt; &gt; &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html#a9d151ba3e138be1954d2f51f85806b0c">mlx::core::collapse_contiguous_dims</a> (const std::vector&lt; int &gt; &amp;shape, const std::vector&lt; std::vector&lt; stride_t &gt; &gt; strides)</td></tr>
<tr class="separator:a9d151ba3e138be1954d2f51f85806b0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8430e0baac3f6d8a2ab22428f9c0b7e2" id="r_a8430e0baac3f6d8a2ab22428f9c0b7e2"><td class="memItemLeft" align="right" valign="top">std::tuple&lt; std::vector&lt; int &gt;, std::vector&lt; std::vector&lt; size_t &gt; &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html#a8430e0baac3f6d8a2ab22428f9c0b7e2">mlx::core::collapse_contiguous_dims</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;xs)</td></tr>
<tr class="separator:a8430e0baac3f6d8a2ab22428f9c0b7e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac813412cce77fc1340dcfefc6e099276" id="r_ac813412cce77fc1340dcfefc6e099276"><td class="memTemplParams" colspan="2">template&lt;typename... Arrays, typename = enable_for_arrays_t&lt;Arrays...&gt;&gt; </td></tr>
<tr class="memitem:ac813412cce77fc1340dcfefc6e099276"><td class="memTemplItemLeft" align="right" valign="top">auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html#ac813412cce77fc1340dcfefc6e099276">mlx::core::collapse_contiguous_dims</a> (Arrays &amp;&amp;... xs)</td></tr>
<tr class="separator:ac813412cce77fc1340dcfefc6e099276"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a847b0a276663d9ddb5cac905ee977f03" id="r_a847b0a276663d9ddb5cac905ee977f03"><td class="memTemplParams" colspan="2">template&lt;typename stride_t &gt; </td></tr>
<tr class="memitem:a847b0a276663d9ddb5cac905ee977f03"><td class="memTemplItemLeft" align="right" valign="top">auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html#a847b0a276663d9ddb5cac905ee977f03">mlx::core::check_contiguity</a> (const std::vector&lt; int &gt; &amp;shape, const std::vector&lt; stride_t &gt; &amp;strides)</td></tr>
<tr class="separator:a847b0a276663d9ddb5cac905ee977f03"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,236 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/common/utils.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_f149b24a1b5be11cd70151abe517e3f8.html">common</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">utils.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2common_2utils_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023-2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;<a class="code" href="array_8h.html">mlx/array.h</a>&quot;</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.html">mlx::core</a> {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> str<span class="keywordtype">id</span>e_t&gt;</div>
<div class="foldopen" id="foldopen00012" data-start="{" data-end="}">
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a4950c3248e70280b406a4f1430a85880"> 12</a></span><span class="keyword">inline</span> stride_t <a class="code hl_function" href="namespacemlx_1_1core.html#a4950c3248e70280b406a4f1430a85880">elem_to_loc</a>(</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> <span class="keywordtype">int</span> elem,</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="keyword">const</span> std::vector&lt;int&gt;&amp; shape,</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">const</span> std::vector&lt;stride_t&gt;&amp; strides) {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> stride_t loc = 0;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = shape.size() - 1; i &gt;= 0; --i) {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">auto</span> q_and_r = ldiv(elem, shape[i]);</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> loc += q_and_r.rem * strides[i];</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> elem = q_and_r.quot;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> }</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordflow">return</span> loc;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span>}</div>
</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
<div class="foldopen" id="foldopen00025" data-start="{" data-end="}">
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#ad7e4f40eb351b554bbfabb6d7d600d06"> 25</a></span><span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a4950c3248e70280b406a4f1430a85880">elem_to_loc</a>(<span class="keywordtype">int</span> elem, <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; a) {</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordflow">if</span> (a.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a0a20a6065ae71b64c1e3aa22a45fd8a1">flags</a>().<a class="code hl_variable" href="structmlx_1_1core_1_1array_1_1_flags.html#a3170fa381dc7a90f6eabcc029bdf9bfd">row_contiguous</a>) {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordflow">return</span> elem;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> }</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a4950c3248e70280b406a4f1430a85880">elem_to_loc</a>(elem, a.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a4a2a2c8a4a5beafd723fc13f2055d55d">shape</a>(), a.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a186cf2648da92584d5c1c8b24e69629b">strides</a>());</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="comment">// Collapse dims that are contiguous to possibly route to a better kernel</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="comment">// e.g. for x = transpose(array({0, 1, 2, 3, 4, 5, 6, 7}, {2, 2, 2}), {2, 0, 1})</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="comment">// should return {{2, 4}, {{1, 2}}}.</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment">//</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment">// When multiple arrays are passed they should all have the same shape. The</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment">// collapsed axes are also the same so one shape is returned.</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> str<span class="keywordtype">id</span>e_t&gt;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="keyword">inline</span> std::tuple&lt;std::vector&lt;int&gt;, std::vector&lt;std::vector&lt;stride_t&gt;&gt;&gt;</div>
<div class="foldopen" id="foldopen00040" data-start="{" data-end="}">
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a9d151ba3e138be1954d2f51f85806b0c"> 40</a></span><a class="code hl_function" href="namespacemlx_1_1core.html#a9d151ba3e138be1954d2f51f85806b0c">collapse_contiguous_dims</a>(</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">const</span> std::vector&lt;int&gt;&amp; shape,</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keyword">const</span> std::vector&lt;std::vector&lt;stride_t&gt;&gt; strides) {</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// Make a vector that has axes separated with -1. Collapse all axes between</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="comment">// -1.</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> std::vector&lt;int&gt; to_collapse;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordflow">if</span> (shape.size() &gt; 0) {</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> to_collapse.push_back(0);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; shape.size(); i++) {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">bool</span> contiguous = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> std::vector&lt;stride_t&gt;&amp; st : strides) {</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">if</span> (st[i] * shape[i] != st[i - 1]) {</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> contiguous = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> }</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">if</span> (!contiguous) {</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordflow">break</span>;</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 class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">if</span> (!contiguous) {</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> to_collapse.push_back(-1);</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> }</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> to_collapse.push_back(i);</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> to_collapse.push_back(-1);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> }</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> std::vector&lt;int&gt; out_shape;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> std::vector&lt;std::vector&lt;stride_t&gt;&gt; out_strides(strides.size());</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; to_collapse.size(); i++) {</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordtype">int</span> current_shape = shape[to_collapse[i]];</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">while</span> (to_collapse[++i] != -1) {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> current_shape *= shape[to_collapse[i]];</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> }</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> out_shape.push_back(current_shape);</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j &lt; strides.size(); j++) {</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keyword">const</span> std::vector&lt;stride_t&gt;&amp; st = strides[j];</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> out_strides[j].push_back(st[to_collapse[i - 1]]);</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> }</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> }</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">return</span> std::make_tuple(out_shape, out_strides);</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span>}</div>
</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="keyword">inline</span> std::tuple&lt;std::vector&lt;int&gt;, std::vector&lt;std::vector&lt;size_t&gt;&gt;&gt;</div>
<div class="foldopen" id="foldopen00084" data-start="{" data-end="}">
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#a8430e0baac3f6d8a2ab22428f9c0b7e2"> 84</a></span><a class="code hl_function" href="namespacemlx_1_1core.html#a9d151ba3e138be1954d2f51f85806b0c">collapse_contiguous_dims</a>(<span class="keyword">const</span> std::vector&lt;array&gt;&amp; xs) {</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> std::vector&lt;std::vector&lt;size_t&gt;&gt; strides;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; x : xs) {</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> strides.emplace_back(x.strides());</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> }</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a9d151ba3e138be1954d2f51f85806b0c">collapse_contiguous_dims</a>(xs[0].shape(), strides);</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span>}</div>
</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span>... Arrays, <span class="keyword">typename</span> = <a class="code hl_typedef" href="namespacemlx_1_1core.html#af89751d79339f3e4d9318ea97d64d114">enable_for_arrays_t</a>&lt;Arrays...&gt;&gt;</div>
<div class="foldopen" id="foldopen00093" data-start="{" data-end="}">
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core.html#ac813412cce77fc1340dcfefc6e099276"> 93</a></span><span class="keyword">inline</span> <span class="keyword">auto</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a9d151ba3e138be1954d2f51f85806b0c">collapse_contiguous_dims</a>(Arrays&amp;&amp;... xs) {</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a9d151ba3e138be1954d2f51f85806b0c">collapse_contiguous_dims</a>(</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> std::vector&lt;array&gt;{std::forward&lt;Arrays&gt;(xs)...});</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span>}</div>
</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><span class="keyword">template</span> &lt;<span class="keyword">typename</span> str<span class="keywordtype">id</span>e_t&gt;</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.html#a847b0a276663d9ddb5cac905ee977f03"> 99</a></span><span class="keyword">inline</span> <span class="keyword">auto</span> <a class="code hl_function" href="namespacemlx_1_1core.html#a847b0a276663d9ddb5cac905ee977f03">check_contiguity</a>(</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">const</span> std::vector&lt;int&gt;&amp; shape,</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keyword">const</span> std::vector&lt;stride_t&gt;&amp; strides) {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordtype">size_t</span> data_size = 1;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordtype">size_t</span> f_stride = 1;</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordtype">size_t</span> b_stride = 1;</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordtype">bool</span> is_row_contiguous = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keywordtype">bool</span> is_col_contiguous = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> </div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0, ri = shape.size() - 1; ri &gt;= 0; i++, ri--) {</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> is_row_contiguous &amp;= strides[i] == f_stride || shape[i] == 1;</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> is_col_contiguous &amp;= strides[ri] == b_stride || shape[ri] == 1;</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> f_stride *= shape[i];</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> b_stride *= shape[ri];</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordflow">if</span> (strides[i] &gt; 0) {</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> data_size *= shape[i];</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> }</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> }</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> </div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">return</span> std::make_tuple(data_size, is_row_contiguous, is_col_contiguous);</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span>}</div>
</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span>} <span class="comment">// namespace mlx::core</span></div>
<div class="ttc" id="aarray_8h_html"><div class="ttname"><a href="array_8h.html">array.h</a></div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html"><div class="ttname"><a href="classmlx_1_1core_1_1array.html">mlx::core::array</a></div><div class="ttdef"><b>Definition</b> array.h:20</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a0a20a6065ae71b64c1e3aa22a45fd8a1"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a0a20a6065ae71b64c1e3aa22a45fd8a1">mlx::core::array::flags</a></div><div class="ttdeci">const Flags &amp; flags() const</div><div class="ttdoc">Get the Flags bit-field.</div><div class="ttdef"><b>Definition</b> array.h:290</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a186cf2648da92584d5c1c8b24e69629b"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a186cf2648da92584d5c1c8b24e69629b">mlx::core::array::strides</a></div><div class="ttdeci">const std::vector&lt; size_t &gt; &amp; strides() const</div><div class="ttdoc">The strides of the array.</div><div class="ttdef"><b>Definition</b> array.h:113</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a4a2a2c8a4a5beafd723fc13f2055d55d"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a4a2a2c8a4a5beafd723fc13f2055d55d">mlx::core::array::shape</a></div><div class="ttdeci">const std::vector&lt; int &gt; &amp; shape() const</div><div class="ttdoc">The shape of the array as a vector of integers.</div><div class="ttdef"><b>Definition</b> array.h:99</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html"><div class="ttname"><a href="namespacemlx_1_1core.html">mlx::core</a></div><div class="ttdef"><b>Definition</b> allocator.h:7</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a4950c3248e70280b406a4f1430a85880"><div class="ttname"><a href="namespacemlx_1_1core.html#a4950c3248e70280b406a4f1430a85880">mlx::core::elem_to_loc</a></div><div class="ttdeci">stride_t elem_to_loc(int elem, const std::vector&lt; int &gt; &amp;shape, const std::vector&lt; stride_t &gt; &amp;strides)</div><div class="ttdef"><b>Definition</b> utils.h:12</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a847b0a276663d9ddb5cac905ee977f03"><div class="ttname"><a href="namespacemlx_1_1core.html#a847b0a276663d9ddb5cac905ee977f03">mlx::core::check_contiguity</a></div><div class="ttdeci">auto check_contiguity(const std::vector&lt; int &gt; &amp;shape, const std::vector&lt; stride_t &gt; &amp;strides)</div><div class="ttdef"><b>Definition</b> utils.h:99</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a9d151ba3e138be1954d2f51f85806b0c"><div class="ttname"><a href="namespacemlx_1_1core.html#a9d151ba3e138be1954d2f51f85806b0c">mlx::core::collapse_contiguous_dims</a></div><div class="ttdeci">std::tuple&lt; std::vector&lt; int &gt;, std::vector&lt; std::vector&lt; stride_t &gt; &gt; &gt; collapse_contiguous_dims(const std::vector&lt; int &gt; &amp;shape, const std::vector&lt; std::vector&lt; stride_t &gt; &gt; strides)</div><div class="ttdef"><b>Definition</b> utils.h:40</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_af89751d79339f3e4d9318ea97d64d114"><div class="ttname"><a href="namespacemlx_1_1core.html#af89751d79339f3e4d9318ea97d64d114">mlx::core::enable_for_arrays_t</a></div><div class="ttdeci">typename std::enable_if_t&lt; is_arrays_v&lt; T... &gt; &gt; enable_for_arrays_t</div><div class="ttdef"><b>Definition</b> array.h:565</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1array_1_1_flags_html_a3170fa381dc7a90f6eabcc029bdf9bfd"><div class="ttname"><a href="structmlx_1_1core_1_1array_1_1_flags.html#a3170fa381dc7a90f6eabcc029bdf9bfd">mlx::core::array::Flags::row_contiguous</a></div><div class="ttdeci">bool row_contiguous</div><div class="ttdef"><b>Definition</b> array.h:226</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,161 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/allocator.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">allocator.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;map&gt;</code><br />
<code>#include &lt;mutex&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
<code>#include &quot;<a class="el" href="allocator_8h_source.html">mlx/allocator.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="backend_2metal_2device_8h_source.html">mlx/backend/metal/device.h</a>&quot;</code><br />
</div>
<p><a href="backend_2metal_2allocator_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html">mlx::core::metal::MetalAllocator</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacemlx" id="r_namespacemlx"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx.html">mlx</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1core" id="r_namespacemlx_1_1core"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html">mlx::core</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1core_1_1metal" id="r_namespacemlx_1_1core_1_1metal"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1metal.html">mlx::core::metal</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a74b3558bd518aecde6b14b0ba5e1a0d5" id="r_a74b3558bd518aecde6b14b0ba5e1a0d5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html">MetalAllocator</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1metal.html#a74b3558bd518aecde6b14b0ba5e1a0d5">mlx::core::metal::allocator</a> ()</td></tr>
<tr class="separator:a74b3558bd518aecde6b14b0ba5e1a0d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a15aa5cc1baf29be08d55cca88509e697" name="a15aa5cc1baf29be08d55cca88509e697"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a15aa5cc1baf29be08d55cca88509e697">&#9670;&#160;</a></span>buf</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">MTL::Buffer* buf</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ae704ab07eac590091daa5fc4aec7bddb" name="ae704ab07eac590091daa5fc4aec7bddb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae704ab07eac590091daa5fc4aec7bddb">&#9670;&#160;</a></span>next</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">BufferHolder* next</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aadb9e075b376adbd9ff6ba23663113bd" name="aadb9e075b376adbd9ff6ba23663113bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aadb9e075b376adbd9ff6ba23663113bd">&#9670;&#160;</a></span>prev</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">BufferHolder* prev</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,221 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/allocator.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">allocator.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2metal_2allocator_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023-2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;mutex&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;vector&gt;</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="preprocessor">#include &quot;<a class="code" href="allocator_8h.html">mlx/allocator.h</a>&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;<a class="code" href="backend_2metal_2device_8h.html">mlx/backend/metal/device.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="foldopen" id="foldopen00012" data-start="{" data-end="}">
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1metal.html"> 12</a></span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemlx_1_1core_1_1metal.html">mlx::core::metal</a> {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">using </span><a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">allocator::Buffer</a>;</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">namespace </span>{</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="keyword">class </span>BufferCache {</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> BufferCache(MTL::Device* <a class="code hl_function" href="namespacemlx_1_1core_1_1metal.html#a910797b74824e6ee576fbb533dee8b57">device</a>);</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> ~BufferCache();</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> MTL::Buffer* reuse_from_cache(<span class="keywordtype">size_t</span> size);</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordtype">void</span> recycle_to_cache(MTL::Buffer* <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordtype">void</span> release_cached_buffers(<span class="keywordtype">size_t</span> min_bytes_to_free);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordtype">size_t</span> cache_size() {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordflow">return</span> pool_size_;</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> }</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordtype">void</span> clear();</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">private</span>:</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">struct </span>BufferHolder {</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> BufferHolder(MTL::Buffer* buf_) : <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>(buf_), <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#aadb9e075b376adbd9ff6ba23663113bd">prev</a>(<span class="keyword">nullptr</span>), <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#ae704ab07eac590091daa5fc4aec7bddb">next</a>(<span class="keyword">nullptr</span>) {}</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="backend_2metal_2allocator_8h.html#aadb9e075b376adbd9ff6ba23663113bd"> 36</a></span> BufferHolder* <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#aadb9e075b376adbd9ff6ba23663113bd">prev</a>;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="backend_2metal_2allocator_8h.html#ae704ab07eac590091daa5fc4aec7bddb"> 37</a></span> BufferHolder* <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#ae704ab07eac590091daa5fc4aec7bddb">next</a>;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697"> 38</a></span> MTL::Buffer* <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> };</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordtype">void</span> add_at_head(BufferHolder* to_add);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keywordtype">void</span> remove_from_list(BufferHolder* to_remove);</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> MTL::Device* device_;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> std::multimap&lt;size_t, BufferHolder*&gt; buffer_pool_;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> BufferHolder* head_;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> BufferHolder* tail_;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">size_t</span> pool_size_;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span>};</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span>} <span class="comment">// namespace</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="foldopen" id="foldopen00054" data-start="{" data-end="};">
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html"> 54</a></span><span class="keyword">class </span><a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html">MetalAllocator</a> : <span class="keyword">public</span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_allocator.html">allocator::Allocator</a> {</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a6c0feb9b1ff9977f76c69745393944bc"> 57</a></span> <span class="keyword">virtual</span> <a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a6c0feb9b1ff9977f76c69745393944bc">malloc</a>(<span class="keywordtype">size_t</span> size, <span class="keywordtype">bool</span> allow_swap = <span class="keyword">false</span>) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a109a0a37fb0b3be381a62dc3b1a54bf0"> 58</a></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a109a0a37fb0b3be381a62dc3b1a54bf0">free</a>(<a class="code hl_class" href="classmlx_1_1core_1_1allocator_1_1_buffer.html">Buffer</a> buffer) <span class="keyword">override</span>;</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="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a7a3ad4e33d57a47474c98e2f88e775d7"> 59</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a7a3ad4e33d57a47474c98e2f88e775d7">get_active_memory</a>() {</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordflow">return</span> active_memory_;</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> };</div>
</div>
<div class="foldopen" id="foldopen00062" data-start="{" data-end="}">
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#ac7972a3fe58e69489de775a0f152da17"> 62</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#ac7972a3fe58e69489de775a0f152da17">get_peak_memory</a>() {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">return</span> peak_memory_;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> };</div>
</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="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a26b9c8ac7ed56c3bb7ddc194009ec5a6"> 65</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a26b9c8ac7ed56c3bb7ddc194009ec5a6">reset_peak_memory</a>() {</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> std::unique_lock lk(mutex_);</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> peak_memory_ = 0;</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> };</div>
</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="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#ad3cabbe638917ca4114eb74dcabe381f"> 69</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#ad3cabbe638917ca4114eb74dcabe381f">get_cache_memory</a>() {</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">return</span> buffer_cache_.cache_size();</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> };</div>
</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#af392bced29d9e4e3f1a7cc4725d83764"> 72</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#af392bced29d9e4e3f1a7cc4725d83764">set_cache_limit</a>(<span class="keywordtype">size_t</span> limit);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a179e3127ef9377ce54295f771c34ba1b"> 73</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a179e3127ef9377ce54295f771c34ba1b">set_memory_limit</a>(<span class="keywordtype">size_t</span> limit, <span class="keywordtype">bool</span> relaxed);</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a447c1eb38c00d2e8e521675297f4a9b1"> 74</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a447c1eb38c00d2e8e521675297f4a9b1">clear_cache</a>();</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> MTL::Device* device_;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html">MetalAllocator</a>();</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#afa1c5a725309caff163c492b5b84491e"> 79</a></span> <span class="keyword">friend</span> <a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html">MetalAllocator</a>&amp; <a class="code hl_friend" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#afa1c5a725309caff163c492b5b84491e">allocator</a>();</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> </div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// Caching allocator</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> BufferCache buffer_cache_;</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">// Allocation stats</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordtype">size_t</span> block_limit_;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordtype">size_t</span> gc_limit_;</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordtype">size_t</span> active_memory_{0};</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordtype">size_t</span> peak_memory_{0};</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordtype">size_t</span> max_pool_size_;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordtype">bool</span> relaxed_{<span class="keyword">true</span>};</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> std::mutex mutex_;</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span>};</div>
</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> </div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1metal.html#a74b3558bd518aecde6b14b0ba5e1a0d5"> 95</a></span><a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html">MetalAllocator</a>&amp; <a class="code hl_function" href="namespacemlx_1_1core_1_1metal.html#a74b3558bd518aecde6b14b0ba5e1a0d5">allocator</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>} <span class="comment">// namespace mlx::core::metal</span></div>
</div>
<div class="ttc" id="aallocator_8h_html"><div class="ttname"><a href="allocator_8h.html">allocator.h</a></div></div>
<div class="ttc" id="abackend_2metal_2allocator_8h_html_a15aa5cc1baf29be08d55cca88509e697"><div class="ttname"><a href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a></div><div class="ttdeci">MTL::Buffer * buf</div><div class="ttdef"><b>Definition</b> allocator.h:38</div></div>
<div class="ttc" id="abackend_2metal_2allocator_8h_html_aadb9e075b376adbd9ff6ba23663113bd"><div class="ttname"><a href="backend_2metal_2allocator_8h.html#aadb9e075b376adbd9ff6ba23663113bd">prev</a></div><div class="ttdeci">BufferHolder * prev</div><div class="ttdef"><b>Definition</b> allocator.h:36</div></div>
<div class="ttc" id="abackend_2metal_2allocator_8h_html_ae704ab07eac590091daa5fc4aec7bddb"><div class="ttname"><a href="backend_2metal_2allocator_8h.html#ae704ab07eac590091daa5fc4aec7bddb">next</a></div><div class="ttdeci">BufferHolder * next</div><div class="ttdef"><b>Definition</b> allocator.h:37</div></div>
<div class="ttc" id="abackend_2metal_2device_8h_html"><div class="ttname"><a href="backend_2metal_2device_8h.html">device.h</a></div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_allocator_html"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_allocator.html">mlx::core::allocator::Allocator</a></div><div class="ttdef"><b>Definition</b> allocator.h:39</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_buffer_html"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_buffer.html">mlx::core::allocator::Buffer</a></div><div class="ttdef"><b>Definition</b> allocator.h:12</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_metal_allocator_html"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html">mlx::core::metal::MetalAllocator</a></div><div class="ttdef"><b>Definition</b> allocator.h:54</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_metal_allocator_html_a109a0a37fb0b3be381a62dc3b1a54bf0"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a109a0a37fb0b3be381a62dc3b1a54bf0">mlx::core::metal::MetalAllocator::free</a></div><div class="ttdeci">virtual void free(Buffer buffer) override</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_metal_allocator_html_a179e3127ef9377ce54295f771c34ba1b"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a179e3127ef9377ce54295f771c34ba1b">mlx::core::metal::MetalAllocator::set_memory_limit</a></div><div class="ttdeci">size_t set_memory_limit(size_t limit, bool relaxed)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_metal_allocator_html_a26b9c8ac7ed56c3bb7ddc194009ec5a6"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a26b9c8ac7ed56c3bb7ddc194009ec5a6">mlx::core::metal::MetalAllocator::reset_peak_memory</a></div><div class="ttdeci">void reset_peak_memory()</div><div class="ttdef"><b>Definition</b> allocator.h:65</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_metal_allocator_html_a447c1eb38c00d2e8e521675297f4a9b1"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a447c1eb38c00d2e8e521675297f4a9b1">mlx::core::metal::MetalAllocator::clear_cache</a></div><div class="ttdeci">void clear_cache()</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_metal_allocator_html_a6c0feb9b1ff9977f76c69745393944bc"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a6c0feb9b1ff9977f76c69745393944bc">mlx::core::metal::MetalAllocator::malloc</a></div><div class="ttdeci">virtual Buffer malloc(size_t size, bool allow_swap=false) override</div><div class="ttdoc">Allocator for Metal GPUs.</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_metal_allocator_html_a7a3ad4e33d57a47474c98e2f88e775d7"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#a7a3ad4e33d57a47474c98e2f88e775d7">mlx::core::metal::MetalAllocator::get_active_memory</a></div><div class="ttdeci">size_t get_active_memory()</div><div class="ttdef"><b>Definition</b> allocator.h:59</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_metal_allocator_html_ac7972a3fe58e69489de775a0f152da17"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#ac7972a3fe58e69489de775a0f152da17">mlx::core::metal::MetalAllocator::get_peak_memory</a></div><div class="ttdeci">size_t get_peak_memory()</div><div class="ttdef"><b>Definition</b> allocator.h:62</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_metal_allocator_html_ad3cabbe638917ca4114eb74dcabe381f"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#ad3cabbe638917ca4114eb74dcabe381f">mlx::core::metal::MetalAllocator::get_cache_memory</a></div><div class="ttdeci">size_t get_cache_memory()</div><div class="ttdef"><b>Definition</b> allocator.h:69</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_metal_allocator_html_af392bced29d9e4e3f1a7cc4725d83764"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#af392bced29d9e4e3f1a7cc4725d83764">mlx::core::metal::MetalAllocator::set_cache_limit</a></div><div class="ttdeci">size_t set_cache_limit(size_t limit)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_metal_allocator_html_afa1c5a725309caff163c492b5b84491e"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_metal_allocator.html#afa1c5a725309caff163c492b5b84491e">mlx::core::metal::MetalAllocator::allocator</a></div><div class="ttdeci">friend MetalAllocator &amp; allocator()</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1metal_html"><div class="ttname"><a href="namespacemlx_1_1core_1_1metal.html">mlx::core::metal</a></div><div class="ttdef"><b>Definition</b> allocator.h:12</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1metal_html_a74b3558bd518aecde6b14b0ba5e1a0d5"><div class="ttname"><a href="namespacemlx_1_1core_1_1metal.html#a74b3558bd518aecde6b14b0ba5e1a0d5">mlx::core::metal::allocator</a></div><div class="ttdeci">MetalAllocator &amp; allocator()</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1metal_html_a910797b74824e6ee576fbb533dee8b57"><div class="ttname"><a href="namespacemlx_1_1core_1_1metal.html#a910797b74824e6ee576fbb533dee8b57">mlx::core::metal::device</a></div><div class="ttdeci">Device &amp; device(mlx::core::Device)</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,135 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/device.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">device.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;Metal/Metal.hpp&gt;</code><br />
<code>#include &lt;functional&gt;</code><br />
<code>#include &lt;mutex&gt;</code><br />
<code>#include &lt;string&gt;</code><br />
<code>#include &lt;unordered_map&gt;</code><br />
<code>#include &lt;unordered_set&gt;</code><br />
<code>#include &lt;dlfcn.h&gt;</code><br />
<code>#include &lt;filesystem&gt;</code><br />
<code>#include &quot;<a class="el" href="array_8h_source.html">mlx/array.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="device_8h_source.html">mlx/device.h</a>&quot;</code><br />
</div>
<p><a href="backend_2metal_2device_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">mlx::core::metal::CommandEncoder</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html">mlx::core::metal::CommandEncoder::ConcurrentContext</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1metal_1_1_device.html">mlx::core::metal::Device</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacemlx" id="r_namespacemlx"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx.html">mlx</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1core" id="r_namespacemlx_1_1core"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html">mlx::core</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1core_1_1metal" id="r_namespacemlx_1_1core_1_1metal"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1metal.html">mlx::core::metal</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a616e09a1ef321d527770721cef264c54" id="r_a616e09a1ef321d527770721cef264c54"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">mlx::core::metal::MTLFCList</a></td></tr>
<tr class="separator:a616e09a1ef321d527770721cef264c54"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a5fd6ba2040e53a254b9d71ae7ebd315f" id="r_a5fd6ba2040e53a254b9d71ae7ebd315f"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1metal.html#a5fd6ba2040e53a254b9d71ae7ebd315f">mlx::core::metal::get_colocated_mtllib_path</a> (const std::string &amp;lib_name)</td></tr>
<tr class="separator:a5fd6ba2040e53a254b9d71ae7ebd315f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a910797b74824e6ee576fbb533dee8b57" id="r_a910797b74824e6ee576fbb533dee8b57"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core_1_1metal.html#a910797b74824e6ee576fbb533dee8b57">mlx::core::metal::device</a> (<a class="el" href="structmlx_1_1core_1_1_device.html">mlx::core::Device</a>)</td></tr>
<tr class="separator:a910797b74824e6ee576fbb533dee8b57"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,389 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/device.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">device.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2metal_2device_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023-2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;Metal/Metal.hpp&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &lt;mutex&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &lt;unordered_map&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &lt;unordered_set&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &lt;dlfcn.h&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include &lt;filesystem&gt;</span></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="preprocessor">#include &quot;<a class="code" href="array_8h.html">mlx/array.h</a>&quot;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include &quot;<a class="code" href="device_8h.html">mlx/device.h</a>&quot;</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="keyword">namespace </span>fs = std::filesystem;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemlx_1_1core_1_1metal.html">mlx::core::metal</a> {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
<div class="foldopen" id="foldopen00022" data-start="{" data-end="}">
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1metal.html#a5fd6ba2040e53a254b9d71ae7ebd315f"> 22</a></span><span class="keyword">inline</span> std::string <a class="code hl_function" href="namespacemlx_1_1core_1_1metal.html#a5fd6ba2040e53a254b9d71ae7ebd315f">get_colocated_mtllib_path</a>(<span class="keyword">const</span> std::string&amp; lib_name) {</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> Dl_info info;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> std::string mtllib_path;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> std::string lib_ext = lib_name + <span class="stringliteral">&quot;.metallib&quot;</span>;</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="keywordtype">int</span> success = dladdr((<span class="keywordtype">void</span>*)<a class="code hl_function" href="namespacemlx_1_1core_1_1metal.html#a5fd6ba2040e53a254b9d71ae7ebd315f">get_colocated_mtllib_path</a>, &amp;info);</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keywordflow">if</span> (success) {</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">auto</span> mtllib = fs::path(info.dli_fname).remove_filename() / lib_ext;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> mtllib_path = mtllib.c_str();</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> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordflow">return</span> mtllib_path;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span>}</div>
</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54"> 36</a></span><span class="keyword">using </span><a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a> =</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> std::vector&lt;std::tuple&lt;const void*, MTL::DataType, NS::UInteger&gt;&gt;;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
<div class="foldopen" id="foldopen00039" data-start="{" data-end="};">
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html"> 39</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a> {</div>
<div class="foldopen" id="foldopen00040" data-start="{" data-end="}">
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a2334774486f447213ee997e55c2e52a3"> 40</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a2334774486f447213ee997e55c2e52a3">CommandEncoder</a>(MTL::CommandBuffer* cbuf) : cbuf(cbuf) {</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> enc = cbuf-&gt;computeCommandEncoder(MTL::DispatchTypeConcurrent);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> enc-&gt;retain();</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> };</div>
</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ac68ca977b5bde5434284ce7979647f14"> 44</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ac68ca977b5bde5434284ce7979647f14">CommandEncoder</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a3f42a1362b4a513fa89e7b3dcc570a8e"> 45</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>&amp; <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a3f42a1362b4a513fa89e7b3dcc570a8e">operator=</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> </div>
<div class="foldopen" id="foldopen00047" data-start="{" data-end="};">
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html"> 47</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html">ConcurrentContext</a> {</div>
<div class="foldopen" id="foldopen00048" data-start="{" data-end="}">
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#aee044d7729739c96e845823f9ecc5174"> 48</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#aee044d7729739c96e845823f9ecc5174">ConcurrentContext</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>&amp; enc) : enc(enc) {</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> enc.concurrent = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
</div>
<div class="foldopen" id="foldopen00051" data-start="{" data-end="}">
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#a28bafec56edec3091e8716d8ccfb6ee1"> 51</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#a28bafec56edec3091e8716d8ccfb6ee1">~ConcurrentContext</a>() {</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> enc.concurrent = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> enc.outputs.insert(</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> enc.concurrent_outputs.begin(), enc.concurrent_outputs.end());</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> enc.concurrent_outputs.clear();</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">private</span>:</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>&amp; enc;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> };</div>
</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
<div class="foldopen" id="foldopen00062" data-start="{" data-end="}">
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#aac45ab0630ea32cf7d15c7ba3e229966"> 62</a></span> MTL::ComputeCommandEncoder* <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#aac45ab0630ea32cf7d15c7ba3e229966">operator-&gt;</a>() {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">return</span> enc;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> }</div>
</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
<div class="foldopen" id="foldopen00066" data-start="{" data-end="}">
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ab69ff0d7f14b9b59db4df0608193dce4"> 66</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ab69ff0d7f14b9b59db4df0608193dce4">set_input_array</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; a, <span class="keywordtype">int</span> idx, int64_t offset = 0) {</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keyword">auto</span> r_buf =</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keyword">static_cast&lt;</span>MTL::Resource*<span class="keyword">&gt;</span>(<span class="keyword">const_cast&lt;</span><span class="keywordtype">void</span>*<span class="keyword">&gt;</span>(a.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08">buffer</a>().<a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94">ptr</a>()));</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> it = outputs.find(r_buf); it != outputs.end()) {</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="comment">// Insert a barrier</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> enc-&gt;memoryBarrier(&amp;r_buf, 1);</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// Remove the output</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> outputs.erase(it);</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> }</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keyword">auto</span> a_buf = <span class="keyword">static_cast&lt;</span><span class="keyword">const </span>MTL::Buffer*<span class="keyword">&gt;</span>(a.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08">buffer</a>().<a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94">ptr</a>());</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keyword">auto</span> base_offset = a.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">data</a>&lt;<span class="keywordtype">char</span>&gt;() -</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keyword">static_cast&lt;</span><span class="keywordtype">char</span>*<span class="keyword">&gt;</span>(<span class="keyword">const_cast&lt;</span>MTL::Buffer*<span class="keyword">&gt;</span>(a_buf)-&gt;contents());</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> base_offset += offset;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> enc-&gt;setBuffer(a_buf, base_offset, idx);</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> }</div>
</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
<div class="foldopen" id="foldopen00083" data-start="{" data-end="}">
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a6a2e28e542eaa2886041bddd51ff6522"> 83</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a6a2e28e542eaa2886041bddd51ff6522">set_output_array</a>(<a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>&amp; a, <span class="keywordtype">int</span> idx, int64_t offset = 0) {</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">// Add barriers before adding the output to the output set</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ab69ff0d7f14b9b59db4df0608193dce4">set_input_array</a>(a, idx, offset);</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keyword">auto</span> <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a> = <span class="keyword">static_cast&lt;</span>MTL::Resource*<span class="keyword">&gt;</span>(a.<a class="code hl_function" href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08">buffer</a>().<a class="code hl_function" href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94">ptr</a>());</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">if</span> (concurrent) {</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> concurrent_outputs.insert(<a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> outputs.insert(<a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> }</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> }</div>
</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a74bcd8e35f80f5a62db48c4a2bb0173e"> 94</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a74bcd8e35f80f5a62db48c4a2bb0173e">dispatchThreadgroups</a>(MTL::Size grid_dims, MTL::Size group_dims);</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a1e41477f2f489e38499f7830a91c9810"> 95</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a1e41477f2f489e38499f7830a91c9810">dispatchThreads</a>(MTL::Size grid_dims, MTL::Size group_dims);</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
<div class="foldopen" id="foldopen00097" data-start="{" data-end="}">
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a48b548a0b15f9d1279c938a1c6167034"> 97</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html">ConcurrentContext</a> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a48b548a0b15f9d1279c938a1c6167034">start_concurrent</a>() {</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html">ConcurrentContext</a>(*<span class="keyword">this</span>);</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> }</div>
</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> </div>
<div class="foldopen" id="foldopen00101" data-start="{" data-end="}">
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a9b6dd221ccd2d939d544004cb6279198"> 101</a></span> <a class="code hl_function" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a9b6dd221ccd2d939d544004cb6279198">~CommandEncoder</a>() {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> enc-&gt;endEncoding();</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> enc-&gt;release();</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> </div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordtype">void</span> maybe_split();</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> </div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordtype">int</span> num_dispatches{0};</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> MTL::CommandBuffer* cbuf;</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> MTL::ComputeCommandEncoder* enc;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordtype">bool</span> concurrent{<span class="keyword">false</span>};</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> std::unordered_set&lt;MTL::Resource*&gt; outputs;</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> std::unordered_set&lt;MTL::Resource*&gt; concurrent_outputs;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span>};</div>
</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> </div>
<div class="foldopen" id="foldopen00117" data-start="{" data-end="};">
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html"> 117</a></span><span class="keyword">class </span><a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a> {</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#ae0db74570eb4b19d8cf19774db91bfd6"> 119</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#ae0db74570eb4b19d8cf19774db91bfd6">Device</a>();</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#abf59a4addb5473f9e814e3651ba85f06"> 120</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#abf59a4addb5473f9e814e3651ba85f06">Device</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#ad1d6382fd18a46b1906e1b43e0bd2e73"> 121</a></span> <a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#ad1d6382fd18a46b1906e1b43e0bd2e73">operator=</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a4f39c28c6cdd1d2da1918f5871bcba6e"> 122</a></span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a4f39c28c6cdd1d2da1918f5871bcba6e">~Device</a>();</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> </div>
<div class="foldopen" id="foldopen00124" data-start="{" data-end="}">
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a31dba377f2be44a746db10d1b9367653"> 124</a></span> MTL::Device* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a31dba377f2be44a746db10d1b9367653">mtl_device</a>() {</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordflow">return</span> device_;</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> };</div>
</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a8135ae2a8c1e6f3861e84d4e60c28b67"> 128</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a8135ae2a8c1e6f3861e84d4e60c28b67">new_queue</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a5fe3970fbe92ccc55fce4241ffbe5210"> 129</a></span> MTL::CommandBuffer* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a5fe3970fbe92ccc55fce4241ffbe5210">get_command_buffer</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a064e1cb6a16de7a0619f6447622350f8"> 130</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a064e1cb6a16de7a0619f6447622350f8">get_command_buffer_ops</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a7a33d4d601423a3d3c23d5ad7072abb6"> 131</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a7a33d4d601423a3d3c23d5ad7072abb6">increment_command_buffer_ops</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a95248f1387824067fd4fed23ace5ac0c"> 132</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a95248f1387824067fd4fed23ace5ac0c">commit_command_buffer</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#affa682ef612def4890f5152f81ffb7e6"> 133</a></span> <a class="code hl_struct" href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">CommandEncoder</a>&amp; <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#affa682ef612def4890f5152f81ffb7e6">get_command_encoder</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a60689f97347811b27e8c5ca23e0372bf"> 134</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a60689f97347811b27e8c5ca23e0372bf">end_encoding</a>(<span class="keywordtype">int</span> index);</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> </div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a45945f2efcd242d915ffa2171e92bf9d"> 136</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a45945f2efcd242d915ffa2171e92bf9d">register_library</a>(</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keyword">const</span> std::string&amp; lib_name,</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keyword">const</span> std::string&amp; lib_path);</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a6993ce23a485b725b687628b77751ad2"> 139</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a6993ce23a485b725b687628b77751ad2">register_library</a>(</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keyword">const</span> std::string&amp; lib_name,</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keyword">const</span> std::function&lt;std::string(<span class="keyword">const</span> std::string&amp;)&gt;&amp; lib_path_func =</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <a class="code hl_function" href="namespacemlx_1_1core_1_1metal.html#a5fd6ba2040e53a254b9d71ae7ebd315f">get_colocated_mtllib_path</a>);</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> </div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a86297d66de43ee77d0697f69c6bd0b87"> 144</a></span> MTL::Library* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a86297d66de43ee77d0697f69c6bd0b87">get_library</a>(<span class="keyword">const</span> std::string&amp; name);</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a961d3cdb4bfb14c1a0b0aeb05609f56e"> 146</a></span> MTL::Library* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a961d3cdb4bfb14c1a0b0aeb05609f56e">get_library</a>(</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keyword">const</span> std::string&amp; name,</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keyword">const</span> std::string&amp; source_string,</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordtype">bool</span> cache = <span class="keyword">true</span>);</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"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a8d8d9e28ffeea10d687b91ea480fb4bd"> 151</a></span> MTL::Library* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a8d8d9e28ffeea10d687b91ea480fb4bd">get_library</a>(</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keyword">const</span> std::string&amp; name,</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="keyword">const</span> MTL::StitchedLibraryDescriptor* desc,</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordtype">bool</span> cache = <span class="keyword">true</span>);</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> </div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#abf4ecf035e8be2ff00d2a7e95475d7ac"> 156</a></span> MTL::Function* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#abf4ecf035e8be2ff00d2a7e95475d7ac">get_function</a>(</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="keyword">const</span> std::string&amp; base_name,</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> MTL::Library* mtl_lib,</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keyword">const</span> std::string&amp; specialized_name = <span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>&amp; func_consts = {});</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#ac083535ead07161cb27ad31f8f64fb84"> 162</a></span> MTL::Function* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#ac083535ead07161cb27ad31f8f64fb84">get_function</a>(</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keyword">const</span> std::string&amp; base_name,</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keyword">const</span> std::string&amp; lib_name = <span class="stringliteral">&quot;mlx&quot;</span>,</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keyword">const</span> std::string&amp; specialized_name = <span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>&amp; func_consts = {});</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a6810c4dcbcfbf93fc51d42aa5ff0fc3a"> 168</a></span> MTL::ComputePipelineState* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a6810c4dcbcfbf93fc51d42aa5ff0fc3a">get_kernel</a>(</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <span class="keyword">const</span> std::string&amp; base_name,</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> MTL::Library* mtl_lib,</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keyword">const</span> std::string&amp; hash_name = <span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>&amp; func_consts = {},</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <span class="keyword">const</span> std::vector&lt;MTL::Function*&gt;&amp; linked_functions = {});</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"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#afa0cac9d800c21a8a7f6cb224256abaf"> 175</a></span> MTL::ComputePipelineState* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#afa0cac9d800c21a8a7f6cb224256abaf">get_kernel</a>(</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keyword">const</span> std::string&amp; base_name,</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="keyword">const</span> std::string&amp; lib_name = <span class="stringliteral">&quot;mlx&quot;</span>,</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="keyword">const</span> std::string&amp; hash_name = <span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>&amp; func_consts = {},</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <span class="keyword">const</span> std::vector&lt;MTL::Function*&gt;&amp; linked_functions = {});</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"><a class="line" href="classmlx_1_1core_1_1metal_1_1_device.html#a6e33e2b1287324fb4a6575e0da5e5881"> 182</a></span> MTL::ArgumentEncoder* <a class="code hl_function" href="classmlx_1_1core_1_1metal_1_1_device.html#a6e33e2b1287324fb4a6575e0da5e5881">argument_encoder</a>(</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="keyword">const</span> std::vector&lt;MTL::ArgumentDescriptor*&gt;&amp; arg_descs) <span class="keyword">const</span>;</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">private</span>:</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> MTL::Library* get_library_cache_(<span class="keyword">const</span> std::string&amp; name);</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> </div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> MTL::Library* get_library_(<span class="keyword">const</span> std::string&amp; source_string);</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> MTL::Library* get_library_(<span class="keyword">const</span> MTL::StitchedLibraryDescriptor* desc);</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> MTL::Function* get_function_(<span class="keyword">const</span> std::string&amp; name, MTL::Library* mtl_lib);</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> </div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> MTL::Function* get_function_(</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="keyword">const</span> std::string&amp; name,</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <span class="keyword">const</span> std::string&amp; specialized_name,</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">MTLFCList</a>&amp; func_consts,</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> MTL::Library* mtl_lib);</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> </div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> MTL::LinkedFunctions* get_linked_functions_(</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keyword">const</span> std::vector&lt;MTL::Function*&gt;&amp; funcs);</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> MTL::ComputePipelineState* get_kernel_(</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <span class="keyword">const</span> std::string&amp; name,</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> <span class="keyword">const</span> MTL::Function* mtl_function);</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> </div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> MTL::ComputePipelineState* get_kernel_(</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> <span class="keyword">const</span> std::string&amp; name,</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <span class="keyword">const</span> MTL::Function* mtl_function,</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <span class="keyword">const</span> MTL::LinkedFunctions* linked_functions);</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> </div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> MTL::Device* device_;</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> std::unordered_map&lt;int32_t, MTL::CommandQueue*&gt; queue_map_;</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> std::unordered_map&lt;int32_t, std::pair&lt;int, MTL::CommandBuffer*&gt;&gt; buffer_map_;</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> std::unordered_map&lt;int32_t, std::unique_ptr&lt;CommandEncoder&gt;&gt; encoder_map_;</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> std::unordered_map&lt;std::string, MTL::ComputePipelineState*&gt; kernel_map_;</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> std::unordered_map&lt;std::string, MTL::Library*&gt; library_map_;</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> std::mutex mtx_;</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span>};</div>
</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> </div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1metal.html#a910797b74824e6ee576fbb533dee8b57"> 220</a></span><a class="code hl_class" href="classmlx_1_1core_1_1metal_1_1_device.html">Device</a>&amp; <a class="code hl_function" href="namespacemlx_1_1core_1_1metal.html#a910797b74824e6ee576fbb533dee8b57">device</a>(<a class="code hl_struct" href="structmlx_1_1core_1_1_device.html">mlx::core::Device</a>);</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> </div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span>} <span class="comment">// namespace mlx::core::metal</span></div>
<div class="ttc" id="aarray_8h_html"><div class="ttname"><a href="array_8h.html">array.h</a></div></div>
<div class="ttc" id="abackend_2metal_2allocator_8h_html_a15aa5cc1baf29be08d55cca88509e697"><div class="ttname"><a href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a></div><div class="ttdeci">MTL::Buffer * buf</div><div class="ttdef"><b>Definition</b> allocator.h:38</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1allocator_1_1_buffer_html_a990643feac06961c5599aac098c17b94"><div class="ttname"><a href="classmlx_1_1core_1_1allocator_1_1_buffer.html#a990643feac06961c5599aac098c17b94">mlx::core::allocator::Buffer::ptr</a></div><div class="ttdeci">const void * ptr() const</div><div class="ttdef"><b>Definition</b> allocator.h:23</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html"><div class="ttname"><a href="classmlx_1_1core_1_1array.html">mlx::core::array</a></div><div class="ttdef"><b>Definition</b> array.h:20</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_a72e3ce6c03fefe272cadf214bd127b95"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#a72e3ce6c03fefe272cadf214bd127b95">mlx::core::array::data</a></div><div class="ttdeci">T * data()</div><div class="ttdef"><b>Definition</b> array.h:313</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1array_html_ab3daf04c27c4593d9d73c397b8484a08"><div class="ttname"><a href="classmlx_1_1core_1_1array.html#ab3daf04c27c4593d9d73c397b8484a08">mlx::core::array::buffer</a></div><div class="ttdeci">allocator::Buffer &amp; buffer()</div><div class="ttdef"><b>Definition</b> array.h:299</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html">mlx::core::metal::Device</a></div><div class="ttdef"><b>Definition</b> device.h:117</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a064e1cb6a16de7a0619f6447622350f8"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a064e1cb6a16de7a0619f6447622350f8">mlx::core::metal::Device::get_command_buffer_ops</a></div><div class="ttdeci">int get_command_buffer_ops(int index)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a31dba377f2be44a746db10d1b9367653"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a31dba377f2be44a746db10d1b9367653">mlx::core::metal::Device::mtl_device</a></div><div class="ttdeci">MTL::Device * mtl_device()</div><div class="ttdef"><b>Definition</b> device.h:124</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a45945f2efcd242d915ffa2171e92bf9d"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a45945f2efcd242d915ffa2171e92bf9d">mlx::core::metal::Device::register_library</a></div><div class="ttdeci">void register_library(const std::string &amp;lib_name, const std::string &amp;lib_path)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a4f39c28c6cdd1d2da1918f5871bcba6e"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a4f39c28c6cdd1d2da1918f5871bcba6e">mlx::core::metal::Device::~Device</a></div><div class="ttdeci">~Device()</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a5fe3970fbe92ccc55fce4241ffbe5210"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a5fe3970fbe92ccc55fce4241ffbe5210">mlx::core::metal::Device::get_command_buffer</a></div><div class="ttdeci">MTL::CommandBuffer * get_command_buffer(int index)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a60689f97347811b27e8c5ca23e0372bf"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a60689f97347811b27e8c5ca23e0372bf">mlx::core::metal::Device::end_encoding</a></div><div class="ttdeci">void end_encoding(int index)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a6810c4dcbcfbf93fc51d42aa5ff0fc3a"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a6810c4dcbcfbf93fc51d42aa5ff0fc3a">mlx::core::metal::Device::get_kernel</a></div><div class="ttdeci">MTL::ComputePipelineState * get_kernel(const std::string &amp;base_name, MTL::Library *mtl_lib, const std::string &amp;hash_name=&quot;&quot;, const MTLFCList &amp;func_consts={}, const std::vector&lt; MTL::Function * &gt; &amp;linked_functions={})</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a6993ce23a485b725b687628b77751ad2"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a6993ce23a485b725b687628b77751ad2">mlx::core::metal::Device::register_library</a></div><div class="ttdeci">void register_library(const std::string &amp;lib_name, const std::function&lt; std::string(const std::string &amp;)&gt; &amp;lib_path_func=get_colocated_mtllib_path)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a6e33e2b1287324fb4a6575e0da5e5881"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a6e33e2b1287324fb4a6575e0da5e5881">mlx::core::metal::Device::argument_encoder</a></div><div class="ttdeci">MTL::ArgumentEncoder * argument_encoder(const std::vector&lt; MTL::ArgumentDescriptor * &gt; &amp;arg_descs) const</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a7a33d4d601423a3d3c23d5ad7072abb6"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a7a33d4d601423a3d3c23d5ad7072abb6">mlx::core::metal::Device::increment_command_buffer_ops</a></div><div class="ttdeci">void increment_command_buffer_ops(int index)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a8135ae2a8c1e6f3861e84d4e60c28b67"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a8135ae2a8c1e6f3861e84d4e60c28b67">mlx::core::metal::Device::new_queue</a></div><div class="ttdeci">void new_queue(int index)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a86297d66de43ee77d0697f69c6bd0b87"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a86297d66de43ee77d0697f69c6bd0b87">mlx::core::metal::Device::get_library</a></div><div class="ttdeci">MTL::Library * get_library(const std::string &amp;name)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a8d8d9e28ffeea10d687b91ea480fb4bd"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a8d8d9e28ffeea10d687b91ea480fb4bd">mlx::core::metal::Device::get_library</a></div><div class="ttdeci">MTL::Library * get_library(const std::string &amp;name, const MTL::StitchedLibraryDescriptor *desc, bool cache=true)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a95248f1387824067fd4fed23ace5ac0c"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a95248f1387824067fd4fed23ace5ac0c">mlx::core::metal::Device::commit_command_buffer</a></div><div class="ttdeci">void commit_command_buffer(int index)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_a961d3cdb4bfb14c1a0b0aeb05609f56e"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#a961d3cdb4bfb14c1a0b0aeb05609f56e">mlx::core::metal::Device::get_library</a></div><div class="ttdeci">MTL::Library * get_library(const std::string &amp;name, const std::string &amp;source_string, bool cache=true)</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_abf4ecf035e8be2ff00d2a7e95475d7ac"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#abf4ecf035e8be2ff00d2a7e95475d7ac">mlx::core::metal::Device::get_function</a></div><div class="ttdeci">MTL::Function * get_function(const std::string &amp;base_name, MTL::Library *mtl_lib, const std::string &amp;specialized_name=&quot;&quot;, const MTLFCList &amp;func_consts={})</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_abf59a4addb5473f9e814e3651ba85f06"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#abf59a4addb5473f9e814e3651ba85f06">mlx::core::metal::Device::Device</a></div><div class="ttdeci">Device(const Device &amp;)=delete</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_ac083535ead07161cb27ad31f8f64fb84"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#ac083535ead07161cb27ad31f8f64fb84">mlx::core::metal::Device::get_function</a></div><div class="ttdeci">MTL::Function * get_function(const std::string &amp;base_name, const std::string &amp;lib_name=&quot;mlx&quot;, const std::string &amp;specialized_name=&quot;&quot;, const MTLFCList &amp;func_consts={})</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_ad1d6382fd18a46b1906e1b43e0bd2e73"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#ad1d6382fd18a46b1906e1b43e0bd2e73">mlx::core::metal::Device::operator=</a></div><div class="ttdeci">Device &amp; operator=(const Device &amp;)=delete</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_ae0db74570eb4b19d8cf19774db91bfd6"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#ae0db74570eb4b19d8cf19774db91bfd6">mlx::core::metal::Device::Device</a></div><div class="ttdeci">Device()</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_afa0cac9d800c21a8a7f6cb224256abaf"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#afa0cac9d800c21a8a7f6cb224256abaf">mlx::core::metal::Device::get_kernel</a></div><div class="ttdeci">MTL::ComputePipelineState * get_kernel(const std::string &amp;base_name, const std::string &amp;lib_name=&quot;mlx&quot;, const std::string &amp;hash_name=&quot;&quot;, const MTLFCList &amp;func_consts={}, const std::vector&lt; MTL::Function * &gt; &amp;linked_functions={})</div></div>
<div class="ttc" id="aclassmlx_1_1core_1_1metal_1_1_device_html_affa682ef612def4890f5152f81ffb7e6"><div class="ttname"><a href="classmlx_1_1core_1_1metal_1_1_device.html#affa682ef612def4890f5152f81ffb7e6">mlx::core::metal::Device::get_command_encoder</a></div><div class="ttdeci">CommandEncoder &amp; get_command_encoder(int index)</div></div>
<div class="ttc" id="adevice_8h_html"><div class="ttname"><a href="device_8h.html">device.h</a></div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1metal_html"><div class="ttname"><a href="namespacemlx_1_1core_1_1metal.html">mlx::core::metal</a></div><div class="ttdef"><b>Definition</b> allocator.h:12</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1metal_html_a5fd6ba2040e53a254b9d71ae7ebd315f"><div class="ttname"><a href="namespacemlx_1_1core_1_1metal.html#a5fd6ba2040e53a254b9d71ae7ebd315f">mlx::core::metal::get_colocated_mtllib_path</a></div><div class="ttdeci">std::string get_colocated_mtllib_path(const std::string &amp;lib_name)</div><div class="ttdef"><b>Definition</b> device.h:22</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1metal_html_a616e09a1ef321d527770721cef264c54"><div class="ttname"><a href="namespacemlx_1_1core_1_1metal.html#a616e09a1ef321d527770721cef264c54">mlx::core::metal::MTLFCList</a></div><div class="ttdeci">std::vector&lt; std::tuple&lt; const void *, MTL::DataType, NS::UInteger &gt; &gt; MTLFCList</div><div class="ttdef"><b>Definition</b> device.h:36</div></div>
<div class="ttc" id="anamespacemlx_1_1core_1_1metal_html_a910797b74824e6ee576fbb533dee8b57"><div class="ttname"><a href="namespacemlx_1_1core_1_1metal.html#a910797b74824e6ee576fbb533dee8b57">mlx::core::metal::device</a></div><div class="ttdeci">Device &amp; device(mlx::core::Device)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1_device_html"><div class="ttname"><a href="structmlx_1_1core_1_1_device.html">mlx::core::Device</a></div><div class="ttdef"><b>Definition</b> device.h:7</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context_html"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html">mlx::core::metal::CommandEncoder::ConcurrentContext</a></div><div class="ttdef"><b>Definition</b> device.h:47</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context_html_a28bafec56edec3091e8716d8ccfb6ee1"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#a28bafec56edec3091e8716d8ccfb6ee1">mlx::core::metal::CommandEncoder::ConcurrentContext::~ConcurrentContext</a></div><div class="ttdeci">~ConcurrentContext()</div><div class="ttdef"><b>Definition</b> device.h:51</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context_html_aee044d7729739c96e845823f9ecc5174"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder_1_1_concurrent_context.html#aee044d7729739c96e845823f9ecc5174">mlx::core::metal::CommandEncoder::ConcurrentContext::ConcurrentContext</a></div><div class="ttdeci">ConcurrentContext(CommandEncoder &amp;enc)</div><div class="ttdef"><b>Definition</b> device.h:48</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html">mlx::core::metal::CommandEncoder</a></div><div class="ttdef"><b>Definition</b> device.h:39</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a1e41477f2f489e38499f7830a91c9810"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a1e41477f2f489e38499f7830a91c9810">mlx::core::metal::CommandEncoder::dispatchThreads</a></div><div class="ttdeci">void dispatchThreads(MTL::Size grid_dims, MTL::Size group_dims)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a2334774486f447213ee997e55c2e52a3"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a2334774486f447213ee997e55c2e52a3">mlx::core::metal::CommandEncoder::CommandEncoder</a></div><div class="ttdeci">CommandEncoder(MTL::CommandBuffer *cbuf)</div><div class="ttdef"><b>Definition</b> device.h:40</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a3f42a1362b4a513fa89e7b3dcc570a8e"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a3f42a1362b4a513fa89e7b3dcc570a8e">mlx::core::metal::CommandEncoder::operator=</a></div><div class="ttdeci">CommandEncoder &amp; operator=(const CommandEncoder &amp;)=delete</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a48b548a0b15f9d1279c938a1c6167034"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a48b548a0b15f9d1279c938a1c6167034">mlx::core::metal::CommandEncoder::start_concurrent</a></div><div class="ttdeci">ConcurrentContext start_concurrent()</div><div class="ttdef"><b>Definition</b> device.h:97</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a6a2e28e542eaa2886041bddd51ff6522"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a6a2e28e542eaa2886041bddd51ff6522">mlx::core::metal::CommandEncoder::set_output_array</a></div><div class="ttdeci">void set_output_array(array &amp;a, int idx, int64_t offset=0)</div><div class="ttdef"><b>Definition</b> device.h:83</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a74bcd8e35f80f5a62db48c4a2bb0173e"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a74bcd8e35f80f5a62db48c4a2bb0173e">mlx::core::metal::CommandEncoder::dispatchThreadgroups</a></div><div class="ttdeci">void dispatchThreadgroups(MTL::Size grid_dims, MTL::Size group_dims)</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_a9b6dd221ccd2d939d544004cb6279198"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#a9b6dd221ccd2d939d544004cb6279198">mlx::core::metal::CommandEncoder::~CommandEncoder</a></div><div class="ttdeci">~CommandEncoder()</div><div class="ttdef"><b>Definition</b> device.h:101</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_aac45ab0630ea32cf7d15c7ba3e229966"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#aac45ab0630ea32cf7d15c7ba3e229966">mlx::core::metal::CommandEncoder::operator-&gt;</a></div><div class="ttdeci">MTL::ComputeCommandEncoder * operator-&gt;()</div><div class="ttdef"><b>Definition</b> device.h:62</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_ab69ff0d7f14b9b59db4df0608193dce4"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ab69ff0d7f14b9b59db4df0608193dce4">mlx::core::metal::CommandEncoder::set_input_array</a></div><div class="ttdeci">void set_input_array(const array &amp;a, int idx, int64_t offset=0)</div><div class="ttdef"><b>Definition</b> device.h:66</div></div>
<div class="ttc" id="astructmlx_1_1core_1_1metal_1_1_command_encoder_html_ac68ca977b5bde5434284ce7979647f14"><div class="ttname"><a href="structmlx_1_1core_1_1metal_1_1_command_encoder.html#ac68ca977b5bde5434284ce7979647f14">mlx::core::metal::CommandEncoder::CommandEncoder</a></div><div class="ttdeci">CommandEncoder(const CommandEncoder &amp;)=delete</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,240 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/jit/fft.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_4336740ec0075891704443b417fef6cb.html">jit</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#var-members">Variables</a> </div>
<div class="headertitle"><div class="title">fft.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<p><a href="backend_2metal_2jit_2fft_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a19e5f580e97a92ca879a804ebaa1087c" id="r_a19e5f580e97a92ca879a804ebaa1087c"><td class="memItemLeft" align="right" valign="top">constexpr std::string_view&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a19e5f580e97a92ca879a804ebaa1087c">fft_kernel</a></td></tr>
<tr class="separator:a19e5f580e97a92ca879a804ebaa1087c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca1f201636b6f5a9912fc0502dbe83de" id="r_aca1f201636b6f5a9912fc0502dbe83de"><td class="memItemLeft" align="right" valign="top">constexpr std::string_view&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aca1f201636b6f5a9912fc0502dbe83de">rader_fft_kernel</a></td></tr>
<tr class="separator:aca1f201636b6f5a9912fc0502dbe83de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8252118504948e9781d8a3bf6d482081" id="r_a8252118504948e9781d8a3bf6d482081"><td class="memItemLeft" align="right" valign="top">constexpr std::string_view&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8252118504948e9781d8a3bf6d482081">bluestein_fft_kernel</a></td></tr>
<tr class="separator:a8252118504948e9781d8a3bf6d482081"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeca5467dbf53c4324b73fe6ef18d3daf" id="r_aeca5467dbf53c4324b73fe6ef18d3daf"><td class="memItemLeft" align="right" valign="top">constexpr std::string_view&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aeca5467dbf53c4324b73fe6ef18d3daf">four_step_fft_kernel</a></td></tr>
<tr class="separator:aeca5467dbf53c4324b73fe6ef18d3daf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a8252118504948e9781d8a3bf6d482081" name="a8252118504948e9781d8a3bf6d482081"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8252118504948e9781d8a3bf6d482081">&#9670;&#160;</a></span>bluestein_fft_kernel</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr std::string_view bluestein_fft_kernel</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= R<span class="stringliteral">&quot;(</span></div>
<div class="line"><span class="stringliteral">template [[host_name(&quot;{name}&quot;)]] [[kernel]] void</span></div>
<div class="line"><span class="stringliteral">bluestein_fft&lt;{tg_mem_size}, {in_T}, {out_T}&gt;(</span></div>
<div class="line"><span class="stringliteral"> const device {in_T}* in [[buffer(0)]],</span></div>
<div class="line"><span class="stringliteral"> device {out_T}* out [[buffer(1)]],</span></div>
<div class="line"><span class="stringliteral"> const device float2* w_q [[buffer(2)]],</span></div>
<div class="line"><span class="stringliteral"> const device float2* w_k [[buffer(3)]],</span></div>
<div class="line"><span class="stringliteral"> constant const int&amp; length,</span></div>
<div class="line"><span class="stringliteral"> constant const int&amp; n,</span></div>
<div class="line"><span class="stringliteral"> constant const int&amp; batch_size,</span></div>
<div class="line"><span class="stringliteral"> uint3 elem [[thread_position_in_grid]],</span></div>
<div class="line"><span class="stringliteral"> uint3 grid [[threads_per_grid]]);</span></div>
<div class="line"><span class="stringliteral">)&quot;</span></div>
</div><!-- fragment -->
</div>
</div>
<a id="a19e5f580e97a92ca879a804ebaa1087c" name="a19e5f580e97a92ca879a804ebaa1087c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19e5f580e97a92ca879a804ebaa1087c">&#9670;&#160;</a></span>fft_kernel</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr std::string_view fft_kernel</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= R<span class="stringliteral">&quot;(</span></div>
<div class="line"><span class="stringliteral">template [[host_name(&quot;{name}&quot;)]] [[kernel]] void</span></div>
<div class="line"><span class="stringliteral">fft&lt;{tg_mem_size}, {in_T}, {out_T}&gt;(</span></div>
<div class="line"><span class="stringliteral"> const device {in_T}* in [[buffer(0)]],</span></div>
<div class="line"><span class="stringliteral"> device {out_T}* out [[buffer(1)]],</span></div>
<div class="line"><span class="stringliteral"> constant const int&amp; n,</span></div>
<div class="line"><span class="stringliteral"> constant const int&amp; batch_size,</span></div>
<div class="line"><span class="stringliteral"> uint3 elem [[thread_position_in_grid]],</span></div>
<div class="line"><span class="stringliteral"> uint3 grid [[threads_per_grid]]);</span></div>
<div class="line"><span class="stringliteral">)&quot;</span></div>
</div><!-- fragment -->
</div>
</div>
<a id="aeca5467dbf53c4324b73fe6ef18d3daf" name="aeca5467dbf53c4324b73fe6ef18d3daf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeca5467dbf53c4324b73fe6ef18d3daf">&#9670;&#160;</a></span>four_step_fft_kernel</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr std::string_view four_step_fft_kernel</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= R<span class="stringliteral">&quot;(</span></div>
<div class="line"><span class="stringliteral">template [[host_name(&quot;{name}&quot;)]] [[kernel]] void</span></div>
<div class="line"><span class="stringliteral">four_step_fft&lt;{tg_mem_size}, {in_T}, {out_T}, {step}, {real}&gt;(</span></div>
<div class="line"><span class="stringliteral"> const device {in_T}* in [[buffer(0)]],</span></div>
<div class="line"><span class="stringliteral"> device {out_T}* out [[buffer(1)]],</span></div>
<div class="line"><span class="stringliteral"> constant const int&amp; n1,</span></div>
<div class="line"><span class="stringliteral"> constant const int&amp; n2,</span></div>
<div class="line"><span class="stringliteral"> constant const int&amp; batch_size,</span></div>
<div class="line"><span class="stringliteral"> uint3 elem [[thread_position_in_grid]],</span></div>
<div class="line"><span class="stringliteral"> uint3 grid [[threads_per_grid]]);</span></div>
<div class="line"><span class="stringliteral">)&quot;</span></div>
</div><!-- fragment -->
</div>
</div>
<a id="aca1f201636b6f5a9912fc0502dbe83de" name="aca1f201636b6f5a9912fc0502dbe83de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aca1f201636b6f5a9912fc0502dbe83de">&#9670;&#160;</a></span>rader_fft_kernel</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr std::string_view rader_fft_kernel</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= R<span class="stringliteral">&quot;(</span></div>
<div class="line"><span class="stringliteral">template [[host_name(&quot;{name}&quot;)]] [[kernel]] void</span></div>
<div class="line"><span class="stringliteral">rader_fft&lt;{tg_mem_size}, {in_T}, {out_T}&gt;(</span></div>
<div class="line"><span class="stringliteral"> const device {in_T}* in [[buffer(0)]],</span></div>
<div class="line"><span class="stringliteral"> device {out_T}* out [[buffer(1)]],</span></div>
<div class="line"><span class="stringliteral"> const device float2* raders_b_q [[buffer(2)]],</span></div>
<div class="line"><span class="stringliteral"> const device short* raders_g_q [[buffer(3)]],</span></div>
<div class="line"><span class="stringliteral"> const device short* raders_g_minus_q [[buffer(4)]],</span></div>
<div class="line"><span class="stringliteral"> constant const int&amp; n,</span></div>
<div class="line"><span class="stringliteral"> constant const int&amp; batch_size,</span></div>
<div class="line"><span class="stringliteral"> constant const int&amp; rader_n,</span></div>
<div class="line"><span class="stringliteral"> uint3 elem [[thread_position_in_grid]],</span></div>
<div class="line"><span class="stringliteral"> uint3 grid [[threads_per_grid]]);</span></div>
<div class="line"><span class="stringliteral">)&quot;</span></div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,149 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/jit/fft.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_4336740ec0075891704443b417fef6cb.html">jit</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">fft.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2metal_2jit_2fft_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"><a class="line" href="backend_2metal_2jit_2fft_8h.html#a19e5f580e97a92ca879a804ebaa1087c"> 3</a></span><span class="keyword">constexpr</span> std::string_view <a class="code hl_variable" href="backend_2metal_2jit_2fft_8h.html#a19e5f580e97a92ca879a804ebaa1087c">fft_kernel</a> = R<span class="stringliteral">&quot;(</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="stringliteral">template [[host_name(&quot;{name}&quot;)]] [[kernel]] void</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="stringliteral">fft&lt;{tg_mem_size}, {in_T}, {out_T}&gt;(</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="stringliteral"> const device {in_T}* in [[buffer(0)]],</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="stringliteral"> device {out_T}* out [[buffer(1)]],</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="stringliteral"> constant const int&amp; n,</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="stringliteral"> constant const int&amp; batch_size,</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="stringliteral"> uint3 elem [[thread_position_in_grid]],</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="stringliteral"> uint3 grid [[threads_per_grid]]);</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="stringliteral">)&quot;;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="stringliteral"></span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="backend_2metal_2jit_2fft_8h.html#aca1f201636b6f5a9912fc0502dbe83de"> 14</a></span><span class="stringliteral"></span><span class="keyword">constexpr</span> std::string_view <a class="code hl_variable" href="backend_2metal_2jit_2fft_8h.html#aca1f201636b6f5a9912fc0502dbe83de">rader_fft_kernel</a> = R<span class="stringliteral">&quot;(</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="stringliteral">template [[host_name(&quot;{name}&quot;)]] [[kernel]] void</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="stringliteral">rader_fft&lt;{tg_mem_size}, {in_T}, {out_T}&gt;(</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="stringliteral"> const device {in_T}* in [[buffer(0)]],</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="stringliteral"> device {out_T}* out [[buffer(1)]],</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="stringliteral"> const device float2* raders_b_q [[buffer(2)]],</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="stringliteral"> const device short* raders_g_q [[buffer(3)]],</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="stringliteral"> const device short* raders_g_minus_q [[buffer(4)]],</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="stringliteral"> constant const int&amp; n,</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="stringliteral"> constant const int&amp; batch_size,</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="stringliteral"> constant const int&amp; rader_n,</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="stringliteral"> uint3 elem [[thread_position_in_grid]],</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="stringliteral"> uint3 grid [[threads_per_grid]]);</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="stringliteral">)&quot;;</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="stringliteral"></span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="backend_2metal_2jit_2fft_8h.html#a8252118504948e9781d8a3bf6d482081"> 29</a></span><span class="stringliteral"></span><span class="keyword">constexpr</span> std::string_view <a class="code hl_variable" href="backend_2metal_2jit_2fft_8h.html#a8252118504948e9781d8a3bf6d482081">bluestein_fft_kernel</a> = R<span class="stringliteral">&quot;(</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="stringliteral">template [[host_name(&quot;{name}&quot;)]] [[kernel]] void</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="stringliteral">bluestein_fft&lt;{tg_mem_size}, {in_T}, {out_T}&gt;(</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="stringliteral"> const device {in_T}* in [[buffer(0)]],</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="stringliteral"> device {out_T}* out [[buffer(1)]],</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="stringliteral"> const device float2* w_q [[buffer(2)]],</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="stringliteral"> const device float2* w_k [[buffer(3)]],</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="stringliteral"> constant const int&amp; length,</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="stringliteral"> constant const int&amp; n,</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="stringliteral"> constant const int&amp; batch_size,</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="stringliteral"> uint3 elem [[thread_position_in_grid]],</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="stringliteral"> uint3 grid [[threads_per_grid]]);</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="stringliteral">)&quot;;</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="stringliteral"></span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="backend_2metal_2jit_2fft_8h.html#aeca5467dbf53c4324b73fe6ef18d3daf"> 43</a></span><span class="stringliteral"></span><span class="keyword">constexpr</span> std::string_view <a class="code hl_variable" href="backend_2metal_2jit_2fft_8h.html#aeca5467dbf53c4324b73fe6ef18d3daf">four_step_fft_kernel</a> = R<span class="stringliteral">&quot;(</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="stringliteral">template [[host_name(&quot;{name}&quot;)]] [[kernel]] void</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="stringliteral">four_step_fft&lt;{tg_mem_size}, {in_T}, {out_T}, {step}, {real}&gt;(</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="stringliteral"> const device {in_T}* in [[buffer(0)]],</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="stringliteral"> device {out_T}* out [[buffer(1)]],</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="stringliteral"> constant const int&amp; n1,</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="stringliteral"> constant const int&amp; n2,</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="stringliteral"> constant const int&amp; batch_size,</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="stringliteral"> uint3 elem [[thread_position_in_grid]],</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="stringliteral"> uint3 grid [[threads_per_grid]]);</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="stringliteral">)&quot;;</span></div>
<div class="ttc" id="abackend_2metal_2jit_2fft_8h_html_a19e5f580e97a92ca879a804ebaa1087c"><div class="ttname"><a href="backend_2metal_2jit_2fft_8h.html#a19e5f580e97a92ca879a804ebaa1087c">fft_kernel</a></div><div class="ttdeci">constexpr std::string_view fft_kernel</div><div class="ttdef"><b>Definition</b> fft.h:3</div></div>
<div class="ttc" id="abackend_2metal_2jit_2fft_8h_html_a8252118504948e9781d8a3bf6d482081"><div class="ttname"><a href="backend_2metal_2jit_2fft_8h.html#a8252118504948e9781d8a3bf6d482081">bluestein_fft_kernel</a></div><div class="ttdeci">constexpr std::string_view bluestein_fft_kernel</div><div class="ttdef"><b>Definition</b> fft.h:29</div></div>
<div class="ttc" id="abackend_2metal_2jit_2fft_8h_html_aca1f201636b6f5a9912fc0502dbe83de"><div class="ttname"><a href="backend_2metal_2jit_2fft_8h.html#aca1f201636b6f5a9912fc0502dbe83de">rader_fft_kernel</a></div><div class="ttdeci">constexpr std::string_view rader_fft_kernel</div><div class="ttdef"><b>Definition</b> fft.h:14</div></div>
<div class="ttc" id="abackend_2metal_2jit_2fft_8h_html_aeca5467dbf53c4324b73fe6ef18d3daf"><div class="ttname"><a href="backend_2metal_2jit_2fft_8h.html#aeca5467dbf53c4324b73fe6ef18d3daf">four_step_fft_kernel</a></div><div class="ttdeci">constexpr std::string_view four_step_fft_kernel</div><div class="ttdef"><b>Definition</b> fft.h:43</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,489 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/bf16.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">bf16.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2metal_2kernels_2bf16_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;metal_stdlib&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keyword">using namespace </span><a class="code hl_namespace" href="namespacemetal.html">metal</a>;</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="preprocessor">#if defined METAL_3_1 || (__METAL_VERSION__ &gt;= 310)</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">typedef</span> bfloat <a class="code hl_typedef" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</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="preprocessor">#else</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// Helpers</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
<div class="foldopen" id="foldopen00019" data-start="{" data-end="}">
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a31ce5e8e860295fa236e0d4b0befeae1"> 19</a></span><span class="keyword">constexpr</span> METAL_FUNC uint16_t <a class="code hl_function" href="backend_2metal_2kernels_2bf16_8h.html#a31ce5e8e860295fa236e0d4b0befeae1">float_to_bfloat_bits</a>(<span class="keywordtype">float</span> x) {</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="comment">// Check for nan</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">if</span> ((as_type&lt;uint32_t&gt;(x) &amp; ~_fp_encoding_traits&lt;float&gt;::sign_mask) &gt;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> _fp_encoding_traits&lt;float&gt;::inf_mask) {</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordflow">return</span> uint16_t(as_type&lt;uint32_t&gt;(0x7FC0));</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> }</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="comment">// Take bits</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> uint32_t float_bits = as_type&lt;uint32_t&gt;(x);</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="comment">// Round to nearest even</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> float_bits += ((float_bits &gt;&gt; 16) &amp; 1) + as_type&lt;uint32_t&gt;(0x7FFF);</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="comment">// Take upper 16 bits</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">return</span> float_bits &gt;&gt; 16;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span>}</div>
</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="foldopen" id="foldopen00035" data-start="{" data-end="}">
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a3b33ae338dc4f223d0f3c748de07bad1"> 35</a></span><span class="keyword">constexpr</span> METAL_FUNC <span class="keywordtype">float</span> <a class="code hl_function" href="backend_2metal_2kernels_2bf16_8h.html#a3b33ae338dc4f223d0f3c748de07bad1">bfloat_bits_to_float</a>(uint16_t x) {</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="comment">// Upper 16 bits are the data and lower 16 bits are 0s</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordflow">return</span> as_type&lt;float&gt;((uint32_t)x &lt;&lt; 16);</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span>}</div>
</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="keyword">struct </span><a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>;</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> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#aae77817d261452b2f001f4d947a3e04e"> 43</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">bool</span> <a class="code hl_variable" href="backend_2metal_2kernels_2bf16_8h.html#aae77817d261452b2f001f4d947a3e04e">can_convert_to_bfloat</a> =</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> !is_same_v&lt;T, _MLX_BFloat16&gt; &amp;&amp; is_convertible_v&lt;T, float&gt;;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a7e5992f7fcd8f2cdadcc1d7f6aefbb5a"> 47</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">bool</span> <a class="code hl_variable" href="backend_2metal_2kernels_2bf16_8h.html#a7e5992f7fcd8f2cdadcc1d7f6aefbb5a">can_convert_from_bfloat</a> =</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> !is_same_v&lt;T, _MLX_BFloat16&gt; &amp;&amp; is_convertible_v&lt;float, T&gt;;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment">// Bfloat struct</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="foldopen" id="foldopen00054" data-start="{" data-end="};">
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html"> 54</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a> {</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="comment">// Constructors</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#a4113263b63e3757ea8334cc4f0f5c3c8"> 57</a></span> uint16_t <a class="code hl_variable" href="struct___m_l_x___b_float16.html#a4113263b63e3757ea8334cc4f0f5c3c8">bits_</a>;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#ab1af7700f5d1e4ab567da6a34fa84668"> 58</a></span> <a class="code hl_function" href="struct___m_l_x___b_float16.html#ab1af7700f5d1e4ab567da6a34fa84668">_MLX_BFloat16</a>() thread = default;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#ae5c51644c3bd7cda6b796cb63c60c0b4"> 59</a></span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>() threadgroup = default;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#a21998a3c852d0e0f52681f8b453172bf"> 60</a></span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>() device = default;</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#a64d8fc2e2463d7fa19cd3d5dd1ffdae8"> 61</a></span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>() constant = default;</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"><a class="line" href="struct___m_l_x___b_float16_1_1bits__to__bfloat__struct.html"> 63</a></span> struct <a class="code hl_struct" href="struct___m_l_x___b_float16_1_1bits__to__bfloat__struct.html">bits_to_bfloat_struct</a> {};</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="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca"> 64</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> METAL_FUNC <a class="code hl_struct" href="struct___m_l_x___b_float16_1_1bits__to__bfloat__struct.html">bits_to_bfloat_struct</a> <a class="code hl_function" href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">bits_to_bfloat</a>() {</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="struct___m_l_x___b_float16_1_1bits__to__bfloat__struct.html">bits_to_bfloat_struct</a>();</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
</div>
<div class="foldopen" id="foldopen00067" data-start="{" data-end="}">
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#a50d825f05a162d0ac133ad8b6f3c3112"> 67</a></span> <span class="keyword">constexpr</span> METAL_FUNC <a class="code hl_function" href="struct___m_l_x___b_float16.html#a50d825f05a162d0ac133ad8b6f3c3112">_MLX_BFloat16</a>(uint16_t bits, <a class="code hl_struct" href="struct___m_l_x___b_float16_1_1bits__to__bfloat__struct.html">bits_to_bfloat_struct</a>)</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> : <a class="code hl_variable" href="struct___m_l_x___b_float16.html#a4113263b63e3757ea8334cc4f0f5c3c8">bits_</a>(bits) {}</div>
</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="comment">// Conversions to bfloat</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_to_bfloat&lt;T&gt;&gt;::type&gt;</div>
<div class="foldopen" id="foldopen00076" data-start="{" data-end="}">
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#a24c5736f234e09a0c82b00c7e44cc547"> 76</a></span> <span class="keyword">constexpr</span> METAL_FUNC <a class="code hl_function" href="struct___m_l_x___b_float16.html#a24c5736f234e09a0c82b00c7e44cc547">_MLX_BFloat16</a>(T x) thread</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> : <a class="code hl_variable" href="struct___m_l_x___b_float16.html#a4113263b63e3757ea8334cc4f0f5c3c8">bits_</a>(<a class="code hl_function" href="backend_2metal_2kernels_2bf16_8h.html#a31ce5e8e860295fa236e0d4b0befeae1">float_to_bfloat_bits</a>(<span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(x))) {}</div>
</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_to_bfloat&lt;T&gt;&gt;::type&gt;</div>
<div class="foldopen" id="foldopen00082" data-start="{" data-end="}">
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#adeb880f31121c6dc40ce47765c6c7455"> 82</a></span> <span class="keyword">constexpr</span> METAL_FUNC <a class="code hl_function" href="struct___m_l_x___b_float16.html#adeb880f31121c6dc40ce47765c6c7455">_MLX_BFloat16</a>(T x) threadgroup</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> : <a class="code hl_variable" href="struct___m_l_x___b_float16.html#a4113263b63e3757ea8334cc4f0f5c3c8">bits_</a>(<a class="code hl_function" href="backend_2metal_2kernels_2bf16_8h.html#a31ce5e8e860295fa236e0d4b0befeae1">float_to_bfloat_bits</a>(<span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(x))) {}</div>
</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> </div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_to_bfloat&lt;T&gt;&gt;::type&gt;</div>
<div class="foldopen" id="foldopen00088" data-start="{" data-end="}">
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#ad2701d003e8fad168c89abc3907c6e53"> 88</a></span> <span class="keyword">constexpr</span> METAL_FUNC <a class="code hl_function" href="struct___m_l_x___b_float16.html#ad2701d003e8fad168c89abc3907c6e53">_MLX_BFloat16</a>(T x) device</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> : <a class="code hl_variable" href="struct___m_l_x___b_float16.html#a4113263b63e3757ea8334cc4f0f5c3c8">bits_</a>(<a class="code hl_function" href="backend_2metal_2kernels_2bf16_8h.html#a31ce5e8e860295fa236e0d4b0befeae1">float_to_bfloat_bits</a>(<span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(x))) {}</div>
</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_to_bfloat&lt;T&gt;&gt;::type&gt;</div>
<div class="foldopen" id="foldopen00094" data-start="{" data-end="}">
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#aec7fa716fd621ce1843338027bcb0118"> 94</a></span> <span class="keyword">constexpr</span> METAL_FUNC <a class="code hl_function" href="struct___m_l_x___b_float16.html#aec7fa716fd621ce1843338027bcb0118">_MLX_BFloat16</a>(T x) constant</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> : <a class="code hl_variable" href="struct___m_l_x___b_float16.html#a4113263b63e3757ea8334cc4f0f5c3c8">bits_</a>(<a class="code hl_function" href="backend_2metal_2kernels_2bf16_8h.html#a31ce5e8e860295fa236e0d4b0befeae1">float_to_bfloat_bits</a>(<span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(x))) {}</div>
</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="comment">// Conversions from bfloat</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> </div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_from_bfloat&lt;T&gt;&gt;::type&gt;</div>
<div class="foldopen" id="foldopen00103" data-start="{" data-end="}">
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#aa7dfefdf0d15e102d2b8258c9ab01836"> 103</a></span> <span class="keyword">constexpr</span> METAL_FUNC <span class="keyword">operator</span> T() const thread {</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_function" href="backend_2metal_2kernels_2bf16_8h.html#a3b33ae338dc4f223d0f3c748de07bad1">bfloat_bits_to_float</a>(<a class="code hl_variable" href="struct___m_l_x___b_float16.html#a4113263b63e3757ea8334cc4f0f5c3c8">bits_</a>));</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> }</div>
</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> </div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_from_bfloat&lt;T&gt;&gt;::type&gt;</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="struct___m_l_x___b_float16.html#a2546a8afa77e14ed5b3c5da79a281260"> 110</a></span> <span class="keyword">constexpr</span> METAL_FUNC <span class="keyword">operator</span> T() const threadgroup {</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_function" href="backend_2metal_2kernels_2bf16_8h.html#a3b33ae338dc4f223d0f3c748de07bad1">bfloat_bits_to_float</a>(<a class="code hl_variable" href="struct___m_l_x___b_float16.html#a4113263b63e3757ea8334cc4f0f5c3c8">bits_</a>));</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> }</div>
</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> </div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_from_bfloat&lt;T&gt;&gt;::type&gt;</div>
<div class="foldopen" id="foldopen00117" data-start="{" data-end="}">
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#a1d523f87740fcb852db6ab57896c245a"> 117</a></span> <span class="keyword">constexpr</span> METAL_FUNC <span class="keyword">operator</span> T() const device {</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_function" href="backend_2metal_2kernels_2bf16_8h.html#a3b33ae338dc4f223d0f3c748de07bad1">bfloat_bits_to_float</a>(<a class="code hl_variable" href="struct___m_l_x___b_float16.html#a4113263b63e3757ea8334cc4f0f5c3c8">bits_</a>));</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> }</div>
</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_from_bfloat&lt;T&gt;&gt;::type&gt;</div>
<div class="foldopen" id="foldopen00124" data-start="{" data-end="}">
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"><a class="line" href="struct___m_l_x___b_float16.html#a95acd29283024d7093a0bc58c9468a0a"> 124</a></span> <span class="keyword">constexpr</span> METAL_FUNC <span class="keyword">operator</span> T() const constant {</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_function" href="backend_2metal_2kernels_2bf16_8h.html#a3b33ae338dc4f223d0f3c748de07bad1">bfloat_bits_to_float</a>(<a class="code hl_variable" href="struct___m_l_x___b_float16.html#a4113263b63e3757ea8334cc4f0f5c3c8">bits_</a>));</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> }</div>
</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span>};</div>
</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> </div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span><span class="comment">// Bfloat operators</span></div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> </div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span><span class="comment">// Unary ops</span></div>
<div class="foldopen" id="foldopen00135" data-start="{" data-end="}">
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a6aedc8d6d0980134ac69b96f22d9a855"> 135</a></span><span class="keyword">constexpr</span> METAL_FUNC <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a> <a class="code hl_function" href="backend_2metal_2kernels_2bf16_8h.html#a6aedc8d6d0980134ac69b96f22d9a855">operator-</a>(<a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a> x) {</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keywordflow">return</span> -<span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(x);</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span>}</div>
</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> </div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span><span class="comment">// Binary operators</span></div>
<div class="foldopen" id="foldopen00141" data-start="" data-end="">
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a78c92beda4436da9a2e520fa98c59f70"> 141</a></span><span class="preprocessor">#define bfloat_binop_base(__op__, __operator__, otype, atype, btype, ctype) \</span></div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span><span class="preprocessor"> constexpr METAL_FUNC otype __operator__(atype lhs, btype rhs) { \</span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span><span class="preprocessor"> return static_cast&lt;ctype&gt;(lhs) __op__ static_cast&lt;ctype&gt;(rhs); \</span></div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span><span class="preprocessor"> }</span></div>
</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
<div class="foldopen" id="foldopen00146" data-start="" data-end="">
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#ac7ff36230dab17e8f17b7a7c80888594"> 146</a></span><span class="preprocessor">#define bfloat_binop_helper(__op__, __operator__, otype, itype, ctype) \</span></div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span><span class="preprocessor"> constexpr METAL_FUNC otype __operator__(_MLX_BFloat16 lhs, itype rhs) { \</span></div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span><span class="preprocessor"> return static_cast&lt;ctype&gt;(lhs) __op__ static_cast&lt;ctype&gt;(rhs); \</span></div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span><span class="preprocessor"> constexpr METAL_FUNC otype __operator__(itype lhs, _MLX_BFloat16 rhs) { \</span></div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span><span class="preprocessor"> return static_cast&lt;ctype&gt;(lhs) __op__ static_cast&lt;ctype&gt;(rhs); \</span></div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span><span class="preprocessor"> }</span></div>
</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> </div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span><span class="comment">// Arithmetic Operators</span></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="backend_2metal_2kernels_2bf16_8h.html#a7694892a131c0e31e5153c088cccb707"> 156</a></span><span class="preprocessor">#define bfloat_binop(_op_, _operator_) \</span></div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span><span class="preprocessor"> bfloat_binop_base( \</span></div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span><span class="preprocessor"> _op_, _operator_, _MLX_BFloat16, _MLX_BFloat16, _MLX_BFloat16, float); \</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span><span class="preprocessor"> bfloat_binop_helper(_op_, _operator_, float, float, float); \</span></div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span><span class="preprocessor"> bfloat_binop_helper(_op_, _operator_, float, half, float); \</span></div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span><span class="preprocessor"> bfloat_binop_helper(_op_, _operator_, _MLX_BFloat16, int32_t, float); \</span></div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span><span class="preprocessor"> bfloat_binop_helper(_op_, _operator_, _MLX_BFloat16, uint32_t, float); \</span></div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span><span class="preprocessor"> bfloat_binop_helper(_op_, _operator_, _MLX_BFloat16, int64_t, float); \</span></div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span><span class="preprocessor"> bfloat_binop_helper(_op_, _operator_, _MLX_BFloat16, uint64_t, float);</span></div>
</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> </div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a09c1a797eb7f43742578680899932f50"> 166</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a7694892a131c0e31e5153c088cccb707">bfloat_binop</a>(+, <span class="keyword">operator</span>+);</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a333f67614dbf8027439a7e124052cb85"> 167</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a7694892a131c0e31e5153c088cccb707">bfloat_binop</a>(-, <span class="keyword">operator</span>-);</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a8f06316063fc91747533105f256b55b5"> 168</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a7694892a131c0e31e5153c088cccb707">bfloat_binop</a>(*, <span class="keyword">operator</span>*);</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a9f16a44e1c9836ca57edc1d7b93b5d7c"> 169</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a7694892a131c0e31e5153c088cccb707">bfloat_binop</a>(/, <span class="keyword">operator</span>/);</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> </div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span><span class="comment">// Comparison ops</span></div>
<div class="foldopen" id="foldopen00173" data-start="" data-end="">
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a330a0883503cb640f1cf628a7ca50239"> 173</a></span><span class="preprocessor">#define bfloat_compop(__op__, __operator__) \</span></div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span><span class="preprocessor"> bfloat_binop_base( \</span></div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span><span class="preprocessor"> __op__, __operator__, bool, _MLX_BFloat16, _MLX_BFloat16, float); \</span></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span><span class="preprocessor"> bfloat_binop_helper(__op__, __operator__, bool, float, float); \</span></div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span><span class="preprocessor"> bfloat_binop_helper(__op__, __operator__, bool, half, float); \</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span><span class="preprocessor"> bfloat_binop_helper(__op__, __operator__, bool, int32_t, float); \</span></div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span><span class="preprocessor"> bfloat_binop_helper(__op__, __operator__, bool, uint32_t, float); \</span></div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span><span class="preprocessor"> bfloat_binop_helper(__op__, __operator__, bool, int64_t, float); \</span></div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span><span class="preprocessor"> bfloat_binop_helper(__op__, __operator__, bool, uint64_t, float);</span></div>
</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> </div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#ae394c0a10e47d1d047854a888402eb57"> 183</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a330a0883503cb640f1cf628a7ca50239">bfloat_compop</a>(&gt;, <span class="keyword">operator</span>&gt;);</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a9ef6a57b7185e9ca49e255fec1a44e25"> 184</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a330a0883503cb640f1cf628a7ca50239">bfloat_compop</a>(&lt;, <span class="keyword">operator</span>&lt;);</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a430dd11fbf4c6f39bc1506ab43b2341f"> 185</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a330a0883503cb640f1cf628a7ca50239">bfloat_compop</a>(&gt;=, <span class="keyword">operator</span>&gt;=);</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#af469c58cffeab488c681f4b33f02cd05"> 186</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a330a0883503cb640f1cf628a7ca50239">bfloat_compop</a>(&lt;=, <span class="keyword">operator</span>&lt;=);</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a49a13b06a325ed3cca4004b6a0cde065"> 187</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a330a0883503cb640f1cf628a7ca50239">bfloat_compop</a>(==, <span class="keyword">operator</span>==);</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#afc6e4fc5589bbf30f978f34868dd4e55"> 188</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a330a0883503cb640f1cf628a7ca50239">bfloat_compop</a>(!=, <span class="keyword">operator</span>!=);</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> </div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span><span class="preprocessor">#undef bfloat_compop</span></div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span><span class="preprocessor">#undef bfloat_binop_base</span></div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span><span class="preprocessor">#undef bfloat_binop_helper</span></div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span><span class="preprocessor">#undef bfloat_binop</span></div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> </div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span><span class="comment">// Inplace Operators</span></div>
<div class="foldopen" id="foldopen00197" data-start="" data-end="">
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a2846fd11b5e19b435e9f7ef0998c9b1d"> 197</a></span><span class="preprocessor">#define bfloat_inplace_op_helper(__op__, __operator__, itype, addr_space) \</span></div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span><span class="preprocessor"> constexpr METAL_FUNC addr_space _MLX_BFloat16&amp; __operator__( \</span></div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span><span class="preprocessor"> addr_space _MLX_BFloat16&amp; lhs, itype rhs) { \</span></div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span><span class="preprocessor"> lhs = static_cast&lt;float&gt;(lhs) __op__ static_cast&lt;float&gt;(rhs); \</span></div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span><span class="preprocessor"> return lhs; \</span></div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span><span class="preprocessor"> constexpr METAL_FUNC addr_space itype&amp; __operator__( \</span></div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span><span class="preprocessor"> addr_space itype&amp; lhs, _MLX_BFloat16 rhs) { \</span></div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span><span class="preprocessor"> lhs = static_cast&lt;float&gt;(lhs) __op__ static_cast&lt;float&gt;(rhs); \</span></div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span><span class="preprocessor"> return lhs; \</span></div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span><span class="preprocessor"> }</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="backend_2metal_2kernels_2bf16_8h.html#af30a2cbd2c3415516203b83bd21872f8"> 209</a></span><span class="preprocessor">#define bfloat_inplace_op_addr_space_helper(__op__, __operator__, itype) \</span></div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span><span class="preprocessor"> bfloat_inplace_op_helper(__op__, __operator__, itype, device); \</span></div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span><span class="preprocessor"> bfloat_inplace_op_helper(__op__, __operator__, itype, thread); \</span></div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span><span class="preprocessor"> bfloat_inplace_op_helper(__op__, __operator__, itype, threadgroup);</span></div>
</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> </div>
<div class="foldopen" id="foldopen00214" data-start="" data-end="">
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a4ac82467fbc674e990090f482b9c1e5c"> 214</a></span><span class="preprocessor">#define bfloat_inplace_op(itype) \</span></div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span><span class="preprocessor"> bfloat_inplace_op_addr_space_helper(+, operator+=, itype); \</span></div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span><span class="preprocessor"> bfloat_inplace_op_addr_space_helper(-, operator-=, itype); \</span></div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span><span class="preprocessor"> bfloat_inplace_op_addr_space_helper(*, operator*=, itype); \</span></div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span><span class="preprocessor"> bfloat_inplace_op_addr_space_helper(/, operator/=, itype);</span></div>
</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> </div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a7232b0a0e193b3c6172d6fc2578bf419"> 220</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a4ac82467fbc674e990090f482b9c1e5c">bfloat_inplace_op</a>(<span class="keywordtype">float</span>);</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#ab706af260b61f735b28464877d02137c"> 221</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a4ac82467fbc674e990090f482b9c1e5c">bfloat_inplace_op</a>(half);</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a81f65b04a87a25c7eb1a751d1be9fa55"> 222</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a4ac82467fbc674e990090f482b9c1e5c">bfloat_inplace_op</a>(int16_t);</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#ae97ab6c3ddcc2754b24f86319a5398be"> 223</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a4ac82467fbc674e990090f482b9c1e5c">bfloat_inplace_op</a>(int32_t);</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a917354f77eac26189da8a2f610a00074"> 224</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a4ac82467fbc674e990090f482b9c1e5c">bfloat_inplace_op</a>(int64_t);</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a99aa4cc110d1c7aa3b4c8c5cbf9235b7"> 225</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a4ac82467fbc674e990090f482b9c1e5c">bfloat_inplace_op</a>(uint16_t);</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#aeff4c28986f98c23de1df17043edb0f5"> 226</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a4ac82467fbc674e990090f482b9c1e5c">bfloat_inplace_op</a>(uint32_t);</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a1a2a683ff40490226eb1371fb905023d"> 227</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#a4ac82467fbc674e990090f482b9c1e5c">bfloat_inplace_op</a>(uint64_t);</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="preprocessor">#undef bfloat_inplace_op_helper</span></div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span><span class="preprocessor">#undef bfloat_inplace_op_addr_space_helper</span></div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span><span class="preprocessor">#undef bfloat_inplace_op</span></div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> </div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span><span class="preprocessor">#define bfloat_inplace_op_helper(__op__, __operator__, addr_space) \</span></div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span><span class="preprocessor"> constexpr METAL_FUNC addr_space _MLX_BFloat16&amp; __operator__( \</span></div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span><span class="preprocessor"> addr_space _MLX_BFloat16&amp; lhs, _MLX_BFloat16 rhs) { \</span></div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span><span class="preprocessor"> lhs = static_cast&lt;float&gt;(lhs) __op__ static_cast&lt;float&gt;(rhs); \</span></div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span><span class="preprocessor"> return lhs; \</span></div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span><span class="preprocessor"> }</span></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="preprocessor">#define bfloat_inplace_op_addr_space_helper(__op__, __operator__) \</span></div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span><span class="preprocessor"> bfloat_inplace_op_helper(__op__, __operator__, device); \</span></div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span><span class="preprocessor"> bfloat_inplace_op_helper(__op__, __operator__, thread); \</span></div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span><span class="preprocessor"> bfloat_inplace_op_helper(__op__, __operator__, threadgroup);</span></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"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a24ca436ab299a710263d65302532dd3b"> 245</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#af30a2cbd2c3415516203b83bd21872f8">bfloat_inplace_op_addr_space_helper</a>(+, <span class="keyword">operator</span>+=);</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a0d3fb52437c677c5d0f1a3642384b15c"> 246</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#af30a2cbd2c3415516203b83bd21872f8">bfloat_inplace_op_addr_space_helper</a>(-, <span class="keyword">operator</span>-=);</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a13aa79165ec87710e977f33fe0361e91"> 247</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#af30a2cbd2c3415516203b83bd21872f8">bfloat_inplace_op_addr_space_helper</a>(*, <span class="keyword">operator</span>*=);</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#af1a12a1efb618a57da6dd41ae18cb53c"> 248</a></span><a class="code hl_define" href="backend_2metal_2kernels_2bf16_8h.html#af30a2cbd2c3415516203b83bd21872f8">bfloat_inplace_op_addr_space_helper</a>(/, <span class="keyword">operator</span>/=);</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> </div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span><span class="preprocessor">#undef bfloat_inplace_op_helper</span></div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span><span class="preprocessor">#undef bfloat_inplace_op_addr_space_helper</span></div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> </div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span><span class="comment">// Bfloat typedef</span></div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> </div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82"> 257</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>;</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> </div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span><span class="comment">// Bfloat numeric limits</span></div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> </div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span><span class="preprocessor">#pragma METAL internals : enable</span></div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> </div>
<div class="foldopen" id="foldopen00265" data-start="{" data-end="}">
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"><a class="line" href="namespacemetal.html"> 265</a></span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemetal.html">metal</a> {</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> </div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span><span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00268" data-start="{" data-end="};">
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html"> 268</a></span><span class="keyword">struct </span>_numeric_limits_impl&lt;<a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>&gt; : _fp_numeric_limits_impl_base {</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#af6a681edff230c8d734a1feefb8d1879"> 269</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">int</span> digits = 8;</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a0f48dd0c8a2d2dfa825067fb212b2e6b"> 270</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">int</span> digits10 = 2;</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a8d3905e6f158379a0c52682266e8d0e2"> 271</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">int</span> max_digits10 = 4;</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#aaefa8c2cadd11ac7e22f7b2c5edbd1cd"> 272</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">int</span> radix = 2;</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a13829f8c7a7c0efdc8946eff5d3c9470"> 273</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">int</span> min_exponent = -125;</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#aeaed172780720e06b8731cef3177e277"> 274</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">int</span> min_exponent10 = -37;</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a61bb136f819fa392c50bdf3c38f3aad2"> 275</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">int</span> max_exponent = 128;</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a76bfb2deb0e0afc011f77bf5a6d0ed94"> 276</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">int</span> max_exponent10 = 38;</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> </div>
<div class="foldopen" id="foldopen00278" data-start="{" data-end="}">
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#adaed80031f5ca0ff69d30ec4c5d0c98f"> 278</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> <a class="code hl_function" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#adaed80031f5ca0ff69d30ec4c5d0c98f">min</a>() {</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>(0x0080, <a class="code hl_function" href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">_MLX_BFloat16::bits_to_bfloat</a>());</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> }</div>
</div>
<div class="foldopen" id="foldopen00281" data-start="{" data-end="}">
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#ae81c58b8223e504965183c99d19a2116"> 281</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> <a class="code hl_function" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#ae81c58b8223e504965183c99d19a2116">lowest</a>() {</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>(0xFF7F, <a class="code hl_function" href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">_MLX_BFloat16::bits_to_bfloat</a>());</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> }</div>
</div>
<div class="foldopen" id="foldopen00284" data-start="{" data-end="}">
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a92320d40a58218e40cc414986ac95c50"> 284</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> <a class="code hl_function" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a92320d40a58218e40cc414986ac95c50">max</a>() {</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>(0x7F7F, <a class="code hl_function" href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">_MLX_BFloat16::bits_to_bfloat</a>());</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> }</div>
</div>
<div class="foldopen" id="foldopen00287" data-start="{" data-end="}">
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a96c4197e3076f0aa9065370b8ece49ca"> 287</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> <a class="code hl_function" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a96c4197e3076f0aa9065370b8ece49ca">epsilon</a>() {</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>(0x3C00, <a class="code hl_function" href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">_MLX_BFloat16::bits_to_bfloat</a>());</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> }</div>
</div>
<div class="foldopen" id="foldopen00290" data-start="{" data-end="}">
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#afa223448fa4f04c1113a85345dd720c3"> 290</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> <a class="code hl_function" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#afa223448fa4f04c1113a85345dd720c3">round_error</a>() {</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>(0x3F00, <a class="code hl_function" href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">_MLX_BFloat16::bits_to_bfloat</a>());</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> }</div>
</div>
<div class="foldopen" id="foldopen00293" data-start="{" data-end="}">
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a61eb741e7af49046beb863abf023b206"> 293</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> <a class="code hl_function" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a61eb741e7af49046beb863abf023b206">infinity</a>() {</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>(0x7F80, <a class="code hl_function" href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">_MLX_BFloat16::bits_to_bfloat</a>());</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> }</div>
</div>
<div class="foldopen" id="foldopen00296" data-start="{" data-end="}">
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#aebeb07c01984be246bc2d1b8f8e4ac7b"> 296</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> <a class="code hl_function" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#aebeb07c01984be246bc2d1b8f8e4ac7b">quiet_NaN</a>() {</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>(0x7FC0, <a class="code hl_function" href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">_MLX_BFloat16::bits_to_bfloat</a>());</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> }</div>
</div>
<div class="foldopen" id="foldopen00299" data-start="{" data-end="}">
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#ad1f76a43c7d51a3765174aa6e0dd9f80"> 299</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> <a class="code hl_function" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#ad1f76a43c7d51a3765174aa6e0dd9f80">signaling_NaN</a>() {</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>(0x7F80, <a class="code hl_function" href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">_MLX_BFloat16::bits_to_bfloat</a>());</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> }</div>
</div>
<div class="foldopen" id="foldopen00302" data-start="{" data-end="}">
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"><a class="line" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a6a9dbcba4dd79cad50876dda506b9eed"> 302</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> <a class="code hl_function" href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a6a9dbcba4dd79cad50876dda506b9eed">denorm_min</a>() {</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>(0x0001, <a class="code hl_function" href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">_MLX_BFloat16::bits_to_bfloat</a>());</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> }</div>
</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span>};</div>
</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> </div>
<div class="foldopen" id="foldopen00307" data-start="{" data-end="}">
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"><a class="line" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb"> 307</a></span>METAL_FUNC <span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">isnan</a>(<a class="code hl_struct" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a> x) {</div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> <span class="keywordflow">return</span> x != x;</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span>}</div>
</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> </div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span>} <span class="comment">// namespace metal</span></div>
</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> </div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span><span class="preprocessor">#pragma METAL internals : disable</span></div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> </div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> </div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span><span class="preprocessor">#include &quot;<a class="code" href="bf16__math_8h.html">mlx/backend/metal/kernels/bf16_math.h</a>&quot;</span></div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html_a31ce5e8e860295fa236e0d4b0befeae1"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html#a31ce5e8e860295fa236e0d4b0befeae1">float_to_bfloat_bits</a></div><div class="ttdeci">constexpr METAL_FUNC uint16_t float_to_bfloat_bits(float x)</div><div class="ttdef"><b>Definition</b> bf16.h:19</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html_a330a0883503cb640f1cf628a7ca50239"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html#a330a0883503cb640f1cf628a7ca50239">bfloat_compop</a></div><div class="ttdeci">#define bfloat_compop(__op__, __operator__)</div><div class="ttdef"><b>Definition</b> bf16.h:173</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html_a3b33ae338dc4f223d0f3c748de07bad1"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html#a3b33ae338dc4f223d0f3c748de07bad1">bfloat_bits_to_float</a></div><div class="ttdeci">constexpr METAL_FUNC float bfloat_bits_to_float(uint16_t x)</div><div class="ttdef"><b>Definition</b> bf16.h:35</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html_a4ac82467fbc674e990090f482b9c1e5c"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html#a4ac82467fbc674e990090f482b9c1e5c">bfloat_inplace_op</a></div><div class="ttdeci">#define bfloat_inplace_op(itype)</div><div class="ttdef"><b>Definition</b> bf16.h:214</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html_a6aedc8d6d0980134ac69b96f22d9a855"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html#a6aedc8d6d0980134ac69b96f22d9a855">operator-</a></div><div class="ttdeci">constexpr METAL_FUNC _MLX_BFloat16 operator-(_MLX_BFloat16 x)</div><div class="ttdef"><b>Definition</b> bf16.h:135</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html_a7694892a131c0e31e5153c088cccb707"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html#a7694892a131c0e31e5153c088cccb707">bfloat_binop</a></div><div class="ttdeci">#define bfloat_binop(_op_, _operator_)</div><div class="ttdef"><b>Definition</b> bf16.h:156</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html_a7782de82393104dd4ad754ce3b316e82"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a></div><div class="ttdeci">struct _MLX_BFloat16 bfloat16_t</div><div class="ttdef"><b>Definition</b> bf16.h:257</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html_a7e5992f7fcd8f2cdadcc1d7f6aefbb5a"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html#a7e5992f7fcd8f2cdadcc1d7f6aefbb5a">can_convert_from_bfloat</a></div><div class="ttdeci">static constexpr constant bool can_convert_from_bfloat</div><div class="ttdef"><b>Definition</b> bf16.h:47</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html_aae77817d261452b2f001f4d947a3e04e"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html#aae77817d261452b2f001f4d947a3e04e">can_convert_to_bfloat</a></div><div class="ttdeci">static constexpr constant bool can_convert_to_bfloat</div><div class="ttdef"><b>Definition</b> bf16.h:43</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html_af30a2cbd2c3415516203b83bd21872f8"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html#af30a2cbd2c3415516203b83bd21872f8">bfloat_inplace_op_addr_space_helper</a></div><div class="ttdeci">#define bfloat_inplace_op_addr_space_helper(__op__, __operator__, itype)</div><div class="ttdef"><b>Definition</b> bf16.h:209</div></div>
<div class="ttc" id="abf16__math_8h_html"><div class="ttname"><a href="bf16__math_8h.html">bf16_math.h</a></div></div>
<div class="ttc" id="anamespacemetal_html"><div class="ttname"><a href="namespacemetal.html">metal</a></div><div class="ttdef"><b>Definition</b> bf16.h:265</div></div>
<div class="ttc" id="anamespacemetal_html_a83320ba983d90dd1fa5847b6940dc0bb"><div class="ttname"><a href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a></div><div class="ttdeci">METAL_FUNC bool isnan(_MLX_BFloat16 x)</div><div class="ttdef"><b>Definition</b> bf16.h:307</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_1_1bits__to__bfloat__struct_html"><div class="ttname"><a href="struct___m_l_x___b_float16_1_1bits__to__bfloat__struct.html">_MLX_BFloat16::bits_to_bfloat_struct</a></div><div class="ttdef"><b>Definition</b> bf16.h:63</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_html"><div class="ttname"><a href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a></div><div class="ttdef"><b>Definition</b> bf16.h:54</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_html_a24c5736f234e09a0c82b00c7e44cc547"><div class="ttname"><a href="struct___m_l_x___b_float16.html#a24c5736f234e09a0c82b00c7e44cc547">_MLX_BFloat16::_MLX_BFloat16</a></div><div class="ttdeci">constexpr METAL_FUNC _MLX_BFloat16(T x) thread</div><div class="ttdef"><b>Definition</b> bf16.h:76</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_html_a4113263b63e3757ea8334cc4f0f5c3c8"><div class="ttname"><a href="struct___m_l_x___b_float16.html#a4113263b63e3757ea8334cc4f0f5c3c8">_MLX_BFloat16::bits_</a></div><div class="ttdeci">uint16_t bits_</div><div class="ttdef"><b>Definition</b> bf16.h:57</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_html_a50d825f05a162d0ac133ad8b6f3c3112"><div class="ttname"><a href="struct___m_l_x___b_float16.html#a50d825f05a162d0ac133ad8b6f3c3112">_MLX_BFloat16::_MLX_BFloat16</a></div><div class="ttdeci">constexpr METAL_FUNC _MLX_BFloat16(uint16_t bits, bits_to_bfloat_struct)</div><div class="ttdef"><b>Definition</b> bf16.h:67</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_html_a91ccb774773b65f8d4c1aea3f1c6e1ca"><div class="ttname"><a href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">_MLX_BFloat16::bits_to_bfloat</a></div><div class="ttdeci">static constexpr METAL_FUNC bits_to_bfloat_struct bits_to_bfloat()</div><div class="ttdef"><b>Definition</b> bf16.h:64</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_html_ab1af7700f5d1e4ab567da6a34fa84668"><div class="ttname"><a href="struct___m_l_x___b_float16.html#ab1af7700f5d1e4ab567da6a34fa84668">_MLX_BFloat16::_MLX_BFloat16</a></div><div class="ttdeci">_MLX_BFloat16() thread=default</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_html_ad2701d003e8fad168c89abc3907c6e53"><div class="ttname"><a href="struct___m_l_x___b_float16.html#ad2701d003e8fad168c89abc3907c6e53">_MLX_BFloat16::_MLX_BFloat16</a></div><div class="ttdeci">constexpr METAL_FUNC _MLX_BFloat16(T x) device</div><div class="ttdef"><b>Definition</b> bf16.h:88</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_html_adeb880f31121c6dc40ce47765c6c7455"><div class="ttname"><a href="struct___m_l_x___b_float16.html#adeb880f31121c6dc40ce47765c6c7455">_MLX_BFloat16::_MLX_BFloat16</a></div><div class="ttdeci">constexpr METAL_FUNC _MLX_BFloat16(T x) threadgroup</div><div class="ttdef"><b>Definition</b> bf16.h:82</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_html_aec7fa716fd621ce1843338027bcb0118"><div class="ttname"><a href="struct___m_l_x___b_float16.html#aec7fa716fd621ce1843338027bcb0118">_MLX_BFloat16::_MLX_BFloat16</a></div><div class="ttdeci">constexpr METAL_FUNC _MLX_BFloat16(T x) const ant</div><div class="ttdef"><b>Definition</b> bf16.h:94</div></div>
<div class="ttc" id="astructmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4_html_a61eb741e7af49046beb863abf023b206"><div class="ttname"><a href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a61eb741e7af49046beb863abf023b206">metal::_numeric_limits_impl&lt; bfloat16_t &gt;::infinity</a></div><div class="ttdeci">static constexpr bfloat16_t infinity()</div><div class="ttdef"><b>Definition</b> bf16.h:293</div></div>
<div class="ttc" id="astructmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4_html_a6a9dbcba4dd79cad50876dda506b9eed"><div class="ttname"><a href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a6a9dbcba4dd79cad50876dda506b9eed">metal::_numeric_limits_impl&lt; bfloat16_t &gt;::denorm_min</a></div><div class="ttdeci">static constexpr bfloat16_t denorm_min()</div><div class="ttdef"><b>Definition</b> bf16.h:302</div></div>
<div class="ttc" id="astructmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4_html_a92320d40a58218e40cc414986ac95c50"><div class="ttname"><a href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a92320d40a58218e40cc414986ac95c50">metal::_numeric_limits_impl&lt; bfloat16_t &gt;::max</a></div><div class="ttdeci">static constexpr bfloat16_t max()</div><div class="ttdef"><b>Definition</b> bf16.h:284</div></div>
<div class="ttc" id="astructmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4_html_a96c4197e3076f0aa9065370b8ece49ca"><div class="ttname"><a href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#a96c4197e3076f0aa9065370b8ece49ca">metal::_numeric_limits_impl&lt; bfloat16_t &gt;::epsilon</a></div><div class="ttdeci">static constexpr bfloat16_t epsilon()</div><div class="ttdef"><b>Definition</b> bf16.h:287</div></div>
<div class="ttc" id="astructmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4_html_ad1f76a43c7d51a3765174aa6e0dd9f80"><div class="ttname"><a href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#ad1f76a43c7d51a3765174aa6e0dd9f80">metal::_numeric_limits_impl&lt; bfloat16_t &gt;::signaling_NaN</a></div><div class="ttdeci">static constexpr bfloat16_t signaling_NaN()</div><div class="ttdef"><b>Definition</b> bf16.h:299</div></div>
<div class="ttc" id="astructmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4_html_adaed80031f5ca0ff69d30ec4c5d0c98f"><div class="ttname"><a href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#adaed80031f5ca0ff69d30ec4c5d0c98f">metal::_numeric_limits_impl&lt; bfloat16_t &gt;::min</a></div><div class="ttdeci">static constexpr bfloat16_t min()</div><div class="ttdef"><b>Definition</b> bf16.h:278</div></div>
<div class="ttc" id="astructmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4_html_ae81c58b8223e504965183c99d19a2116"><div class="ttname"><a href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#ae81c58b8223e504965183c99d19a2116">metal::_numeric_limits_impl&lt; bfloat16_t &gt;::lowest</a></div><div class="ttdeci">static constexpr bfloat16_t lowest()</div><div class="ttdef"><b>Definition</b> bf16.h:281</div></div>
<div class="ttc" id="astructmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4_html_aebeb07c01984be246bc2d1b8f8e4ac7b"><div class="ttname"><a href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#aebeb07c01984be246bc2d1b8f8e4ac7b">metal::_numeric_limits_impl&lt; bfloat16_t &gt;::quiet_NaN</a></div><div class="ttdeci">static constexpr bfloat16_t quiet_NaN()</div><div class="ttdef"><b>Definition</b> bf16.h:296</div></div>
<div class="ttc" id="astructmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4_html_afa223448fa4f04c1113a85345dd720c3"><div class="ttname"><a href="structmetal_1_1__numeric__limits__impl_3_01bfloat16__t_01_4.html#afa223448fa4f04c1113a85345dd720c3">metal::_numeric_limits_impl&lt; bfloat16_t &gt;::round_error</a></div><div class="ttdeci">static constexpr bfloat16_t round_error()</div><div class="ttdef"><b>Definition</b> bf16.h:290</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,504 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/complex.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a> </div>
<div class="headertitle"><div class="title">complex.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;metal_stdlib&gt;</code><br />
</div>
<p><a href="backend_2metal_2kernels_2complex_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcomplex64__t.html">complex64_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a226cfd54d49f02e35c5aab3139c7596b" id="r_a226cfd54d49f02e35c5aab3139c7596b"><td class="memItemLeft" align="right" valign="top">constexpr <a class="el" href="structcomplex64__t.html">complex64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a226cfd54d49f02e35c5aab3139c7596b">operator-</a> (<a class="el" href="structcomplex64__t.html">complex64_t</a> x)</td></tr>
<tr class="separator:a226cfd54d49f02e35c5aab3139c7596b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafbd686c180398c98b33d7643f893a46" id="r_aafbd686c180398c98b33d7643f893a46"><td class="memItemLeft" align="right" valign="top">constexpr bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aafbd686c180398c98b33d7643f893a46">operator&gt;=</a> (<a class="el" href="structcomplex64__t.html">complex64_t</a> a, <a class="el" href="structcomplex64__t.html">complex64_t</a> b)</td></tr>
<tr class="separator:aafbd686c180398c98b33d7643f893a46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a032a8d3eec2384c9f03066f7fd945995" id="r_a032a8d3eec2384c9f03066f7fd945995"><td class="memItemLeft" align="right" valign="top">constexpr bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a032a8d3eec2384c9f03066f7fd945995">operator&gt;</a> (<a class="el" href="structcomplex64__t.html">complex64_t</a> a, <a class="el" href="structcomplex64__t.html">complex64_t</a> b)</td></tr>
<tr class="separator:a032a8d3eec2384c9f03066f7fd945995"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee04c9a63c6716a99a027418354debb0" id="r_aee04c9a63c6716a99a027418354debb0"><td class="memItemLeft" align="right" valign="top">constexpr bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aee04c9a63c6716a99a027418354debb0">operator&lt;=</a> (<a class="el" href="structcomplex64__t.html">complex64_t</a> a, <a class="el" href="structcomplex64__t.html">complex64_t</a> b)</td></tr>
<tr class="separator:aee04c9a63c6716a99a027418354debb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67674e32596a9dae2258bb8e0e6a2058" id="r_a67674e32596a9dae2258bb8e0e6a2058"><td class="memItemLeft" align="right" valign="top">constexpr bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a67674e32596a9dae2258bb8e0e6a2058">operator&lt;</a> (<a class="el" href="structcomplex64__t.html">complex64_t</a> a, <a class="el" href="structcomplex64__t.html">complex64_t</a> b)</td></tr>
<tr class="separator:a67674e32596a9dae2258bb8e0e6a2058"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abfc19f03616441245dfc7726b278f190" id="r_abfc19f03616441245dfc7726b278f190"><td class="memItemLeft" align="right" valign="top">constexpr bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#abfc19f03616441245dfc7726b278f190">operator==</a> (<a class="el" href="structcomplex64__t.html">complex64_t</a> a, <a class="el" href="structcomplex64__t.html">complex64_t</a> b)</td></tr>
<tr class="separator:abfc19f03616441245dfc7726b278f190"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6af5c6c5ed4898b49758618e5aee189" id="r_ad6af5c6c5ed4898b49758618e5aee189"><td class="memItemLeft" align="right" valign="top">constexpr <a class="el" href="structcomplex64__t.html">complex64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad6af5c6c5ed4898b49758618e5aee189">operator+</a> (<a class="el" href="structcomplex64__t.html">complex64_t</a> a, <a class="el" href="structcomplex64__t.html">complex64_t</a> b)</td></tr>
<tr class="separator:ad6af5c6c5ed4898b49758618e5aee189"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5608264cf920688607059b4e8cd3117" id="r_af5608264cf920688607059b4e8cd3117"><td class="memItemLeft" align="right" valign="top">constexpr <a class="el" href="structcomplex64__t.html">complex64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af5608264cf920688607059b4e8cd3117">operator-</a> (<a class="el" href="structcomplex64__t.html">complex64_t</a> a, <a class="el" href="structcomplex64__t.html">complex64_t</a> b)</td></tr>
<tr class="separator:af5608264cf920688607059b4e8cd3117"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a681d4fb076973f58f7dac894ec62a385" id="r_a681d4fb076973f58f7dac894ec62a385"><td class="memItemLeft" align="right" valign="top">constexpr <a class="el" href="structcomplex64__t.html">complex64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a681d4fb076973f58f7dac894ec62a385">operator*</a> (<a class="el" href="structcomplex64__t.html">complex64_t</a> a, <a class="el" href="structcomplex64__t.html">complex64_t</a> b)</td></tr>
<tr class="separator:a681d4fb076973f58f7dac894ec62a385"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae6a708f67d6fd9b0962aa8877cec6d35" id="r_ae6a708f67d6fd9b0962aa8877cec6d35"><td class="memItemLeft" align="right" valign="top">constexpr <a class="el" href="structcomplex64__t.html">complex64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae6a708f67d6fd9b0962aa8877cec6d35">operator/</a> (<a class="el" href="structcomplex64__t.html">complex64_t</a> a, <a class="el" href="structcomplex64__t.html">complex64_t</a> b)</td></tr>
<tr class="separator:ae6a708f67d6fd9b0962aa8877cec6d35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf53122a07c8eca858b5a8e38ae280e0" id="r_aaf53122a07c8eca858b5a8e38ae280e0"><td class="memItemLeft" align="right" valign="top">constexpr <a class="el" href="structcomplex64__t.html">complex64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aaf53122a07c8eca858b5a8e38ae280e0">operator%</a> (<a class="el" href="structcomplex64__t.html">complex64_t</a> a, <a class="el" href="structcomplex64__t.html">complex64_t</a> b)</td></tr>
<tr class="separator:aaf53122a07c8eca858b5a8e38ae280e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a4f90ad54f4fae363e8d3cc41d539557b" id="r_a4f90ad54f4fae363e8d3cc41d539557b"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a4f90ad54f4fae363e8d3cc41d539557b"><td class="memTemplItemLeft" align="right" valign="top">static constexpr constant bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a4f90ad54f4fae363e8d3cc41d539557b">can_convert_to_complex64</a></td></tr>
<tr class="separator:a4f90ad54f4fae363e8d3cc41d539557b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab149db78f6f19b8da6297dac4c36d893" id="r_ab149db78f6f19b8da6297dac4c36d893"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ab149db78f6f19b8da6297dac4c36d893"><td class="memTemplItemLeft" align="right" valign="top">static constexpr constant bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ab149db78f6f19b8da6297dac4c36d893">can_convert_from_complex64</a></td></tr>
<tr class="separator:ab149db78f6f19b8da6297dac4c36d893"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="aaf53122a07c8eca858b5a8e38ae280e0" name="aaf53122a07c8eca858b5a8e38ae280e0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf53122a07c8eca858b5a8e38ae280e0">&#9670;&#160;</a></span>operator%()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr <a class="el" href="structcomplex64__t.html">complex64_t</a> operator% </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>a</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a681d4fb076973f58f7dac894ec62a385" name="a681d4fb076973f58f7dac894ec62a385"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a681d4fb076973f58f7dac894ec62a385">&#9670;&#160;</a></span>operator*()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr <a class="el" href="structcomplex64__t.html">complex64_t</a> operator* </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>a</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ad6af5c6c5ed4898b49758618e5aee189" name="ad6af5c6c5ed4898b49758618e5aee189"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6af5c6c5ed4898b49758618e5aee189">&#9670;&#160;</a></span>operator+()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr <a class="el" href="structcomplex64__t.html">complex64_t</a> operator+ </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>a</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="af5608264cf920688607059b4e8cd3117" name="af5608264cf920688607059b4e8cd3117"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af5608264cf920688607059b4e8cd3117">&#9670;&#160;</a></span>operator-() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr <a class="el" href="structcomplex64__t.html">complex64_t</a> operator- </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>a</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a226cfd54d49f02e35c5aab3139c7596b" name="a226cfd54d49f02e35c5aab3139c7596b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a226cfd54d49f02e35c5aab3139c7596b">&#9670;&#160;</a></span>operator-() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr <a class="el" href="structcomplex64__t.html">complex64_t</a> operator- </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>x</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ae6a708f67d6fd9b0962aa8877cec6d35" name="ae6a708f67d6fd9b0962aa8877cec6d35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae6a708f67d6fd9b0962aa8877cec6d35">&#9670;&#160;</a></span>operator/()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr <a class="el" href="structcomplex64__t.html">complex64_t</a> operator/ </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>a</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a67674e32596a9dae2258bb8e0e6a2058" name="a67674e32596a9dae2258bb8e0e6a2058"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a67674e32596a9dae2258bb8e0e6a2058">&#9670;&#160;</a></span>operator&lt;()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr bool operator&lt; </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>a</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aee04c9a63c6716a99a027418354debb0" name="aee04c9a63c6716a99a027418354debb0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aee04c9a63c6716a99a027418354debb0">&#9670;&#160;</a></span>operator&lt;=()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr bool operator&lt;= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>a</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="abfc19f03616441245dfc7726b278f190" name="abfc19f03616441245dfc7726b278f190"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abfc19f03616441245dfc7726b278f190">&#9670;&#160;</a></span>operator==()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr bool operator== </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>a</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a032a8d3eec2384c9f03066f7fd945995" name="a032a8d3eec2384c9f03066f7fd945995"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a032a8d3eec2384c9f03066f7fd945995">&#9670;&#160;</a></span>operator&gt;()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr bool operator&gt; </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>a</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aafbd686c180398c98b33d7643f893a46" name="aafbd686c180398c98b33d7643f893a46"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aafbd686c180398c98b33d7643f893a46">&#9670;&#160;</a></span>operator&gt;=()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr bool operator&gt;= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>a</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structcomplex64__t.html">complex64_t</a></td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="ab149db78f6f19b8da6297dac4c36d893" name="ab149db78f6f19b8da6297dac4c36d893"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab149db78f6f19b8da6297dac4c36d893">&#9670;&#160;</a></span>can_convert_from_complex64</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr constant bool can_convert_from_complex64</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">=</div>
<div class="line"> !is_same_v&lt;T, complex64_t&gt; &amp;&amp;</div>
<div class="line"> (is_convertible_v&lt;float, T&gt; || is_convertible_v&lt;bfloat16_t, T&gt;)</div>
</div><!-- fragment -->
</div>
</div>
<a id="a4f90ad54f4fae363e8d3cc41d539557b" name="a4f90ad54f4fae363e8d3cc41d539557b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f90ad54f4fae363e8d3cc41d539557b">&#9670;&#160;</a></span>can_convert_to_complex64</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constexpr constant bool can_convert_to_complex64</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">=</div>
<div class="line"> !is_same_v&lt;T, complex64_t&gt; &amp;&amp; is_convertible_v&lt;T, float&gt;</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,276 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/complex.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">complex.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2metal_2kernels_2complex_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;metal_stdlib&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keyword">using namespace </span><a class="code hl_namespace" href="namespacemetal.html">metal</a>;</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">struct </span><a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a>;</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2complex_8h.html#a4f90ad54f4fae363e8d3cc41d539557b"> 12</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">bool</span> <a class="code hl_variable" href="backend_2metal_2kernels_2complex_8h.html#a4f90ad54f4fae363e8d3cc41d539557b">can_convert_to_complex64</a> =</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> !is_same_v&lt;T, complex64_t&gt; &amp;&amp; is_convertible_v&lt;T, float&gt;;</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="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2complex_8h.html#ab149db78f6f19b8da6297dac4c36d893"> 16</a></span><span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">bool</span> <a class="code hl_variable" href="backend_2metal_2kernels_2complex_8h.html#ab149db78f6f19b8da6297dac4c36d893">can_convert_from_complex64</a> =</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> !is_same_v&lt;T, complex64_t&gt; &amp;&amp;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> (is_convertible_v&lt;float, T&gt; || is_convertible_v&lt;bfloat16_t, T&gt;);</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
<div class="foldopen" id="foldopen00020" data-start="{" data-end="};">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="structcomplex64__t.html"> 20</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e"> 21</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de"> 22</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="comment">// Constructors</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="structcomplex64__t.html#adbd392a5e92d31997380ad0a38be4be8"> 25</a></span> <span class="keyword">constexpr</span> <a class="code hl_function" href="structcomplex64__t.html#adbd392a5e92d31997380ad0a38be4be8">complex64_t</a>(<span class="keywordtype">float</span> <a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>, <span class="keywordtype">float</span> <a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>) : <a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>(<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>), <a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>(<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>) {};</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="comment">// Conversions to complex64_t</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_to_complex64&lt;T&gt;&gt;::type&gt;</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="structcomplex64__t.html#a33a2452eb33b5ed53655773539c357a5"> 31</a></span> <span class="keyword">constexpr</span> <a class="code hl_function" href="structcomplex64__t.html#a33a2452eb33b5ed53655773539c357a5">complex64_t</a>(T x) thread : <a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>(x), <a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>(0) {}</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_to_complex64&lt;T&gt;&gt;::type&gt;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="structcomplex64__t.html#a89b65ace8588b7bf215355f705eb23d9"> 36</a></span> <span class="keyword">constexpr</span> <a class="code hl_function" href="structcomplex64__t.html#a89b65ace8588b7bf215355f705eb23d9">complex64_t</a>(T x) threadgroup : <a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>(x), <a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>(0) {}</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> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_to_complex64&lt;T&gt;&gt;::type&gt;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="structcomplex64__t.html#ac81b486f642fb3b26c5d659917bdbcd0"> 41</a></span> <span class="keyword">constexpr</span> <a class="code hl_function" href="structcomplex64__t.html#ac81b486f642fb3b26c5d659917bdbcd0">complex64_t</a>(T x) device : <a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>(x), <a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>(0) {}</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_to_complex64&lt;T&gt;&gt;::type&gt;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="structcomplex64__t.html#a0a27a41206400f1e62b60ceb56960c93"> 46</a></span> <span class="keyword">constexpr</span> <a class="code hl_function" href="structcomplex64__t.html#a0a27a41206400f1e62b60ceb56960c93">complex64_t</a>(T x) constant : <a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>(x), <a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>(0) {}</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="comment">// Conversions from complex64_t</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_from_complex64&lt;T&gt;&gt;::type&gt;</div>
<div class="foldopen" id="foldopen00052" data-start="{" data-end="}">
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="structcomplex64__t.html#a70e9b16031eeaff3baa601f400023fcd"> 52</a></span> <span class="keyword">constexpr</span> <span class="keyword">operator</span> T() const thread {</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>);</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> }</div>
</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> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_from_complex64&lt;T&gt;&gt;::type&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="structcomplex64__t.html#a4f3beea7ab6001189b782a74d1746b67"> 59</a></span> <span class="keyword">constexpr</span> <span class="keyword">operator</span> T() const threadgroup {</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>);</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;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_from_complex64&lt;T&gt;&gt;::type&gt;</div>
<div class="foldopen" id="foldopen00066" data-start="{" data-end="}">
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="structcomplex64__t.html#a9f4f7eca89ffe6c8d126a4145df6d9f2"> 66</a></span> <span class="keyword">constexpr</span> <span class="keyword">operator</span> T() const device {</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>);</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> }</div>
</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keyword">typename</span> T,</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keyword">typename</span> = <span class="keyword">typename</span> enable_if&lt;can_convert_from_complex64&lt;T&gt;&gt;::type&gt;</div>
<div class="foldopen" id="foldopen00073" data-start="{" data-end="}">
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="structcomplex64__t.html#ac33e2e5263fec76a4fb4418c6e1d8d14"> 73</a></span> <span class="keyword">constexpr</span> <span class="keyword">operator</span> T() const constant {</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>);</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> }</div>
</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span>};</div>
</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="foldopen" id="foldopen00078" data-start="{" data-end="}">
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2complex_8h.html#a226cfd54d49f02e35c5aab3139c7596b"> 78</a></span><span class="keyword">constexpr</span> <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#a226cfd54d49f02e35c5aab3139c7596b">operator-</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> x) {</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">return</span> {-x.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>, -x.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>};</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span>}</div>
</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
<div class="foldopen" id="foldopen00082" data-start="{" data-end="}">
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2complex_8h.html#aafbd686c180398c98b33d7643f893a46"> 82</a></span><span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#aafbd686c180398c98b33d7643f893a46">operator&gt;=</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> a, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> b) {</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">return</span> (a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> &gt; b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>) || (a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> == b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> &amp;&amp; a.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> &gt;= b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span>}</div>
</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> </div>
<div class="foldopen" id="foldopen00086" data-start="{" data-end="}">
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2complex_8h.html#a032a8d3eec2384c9f03066f7fd945995"> 86</a></span><span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#a032a8d3eec2384c9f03066f7fd945995">operator&gt;</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> a, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> b) {</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">return</span> (a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> &gt; b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>) || (a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> == b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> &amp;&amp; a.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> &gt; b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>);</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span>}</div>
</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
<div class="foldopen" id="foldopen00090" data-start="{" data-end="}">
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2complex_8h.html#aee04c9a63c6716a99a027418354debb0"> 90</a></span><span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#aee04c9a63c6716a99a027418354debb0">operator&lt;=</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> a, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> b) {</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">return</span> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#aafbd686c180398c98b33d7643f893a46">operator&gt;=</a>(b, a);</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span>}</div>
</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
<div class="foldopen" id="foldopen00094" data-start="{" data-end="}">
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2complex_8h.html#a67674e32596a9dae2258bb8e0e6a2058"> 94</a></span><span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#a67674e32596a9dae2258bb8e0e6a2058">operator&lt;</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> a, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> b) {</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordflow">return</span> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#a032a8d3eec2384c9f03066f7fd945995">operator&gt;</a>(b, a);</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span>}</div>
</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> </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="backend_2metal_2kernels_2complex_8h.html#abfc19f03616441245dfc7726b278f190"> 98</a></span><span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#abfc19f03616441245dfc7726b278f190">operator==</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> a, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> b) {</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keywordflow">return</span> a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> == b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> &amp;&amp; a.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> == b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>;</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> </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="backend_2metal_2kernels_2complex_8h.html#ad6af5c6c5ed4898b49758618e5aee189"> 102</a></span><span class="keyword">constexpr</span> <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#ad6af5c6c5ed4898b49758618e5aee189">operator+</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> a, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> b) {</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordflow">return</span> {a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> + b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>, a.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> + b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>};</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> </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="backend_2metal_2kernels_2complex_8h.html#af5608264cf920688607059b4e8cd3117"> 106</a></span><span class="keyword">constexpr</span> <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#a226cfd54d49f02e35c5aab3139c7596b">operator-</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> a, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> b) {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">return</span> {a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> - b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>, a.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> - b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</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="backend_2metal_2kernels_2complex_8h.html#a681d4fb076973f58f7dac894ec62a385"> 110</a></span><span class="keyword">constexpr</span> <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#a681d4fb076973f58f7dac894ec62a385">operator*</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> a, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> b) {</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keywordflow">return</span> {a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> * b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> - a.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> * b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>, a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> * b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> + a.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> * b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>};</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span>}</div>
</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> </div>
<div class="foldopen" id="foldopen00114" data-start="{" data-end="}">
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2complex_8h.html#ae6a708f67d6fd9b0962aa8877cec6d35"> 114</a></span><span class="keyword">constexpr</span> <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#ae6a708f67d6fd9b0962aa8877cec6d35">operator/</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> a, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> b) {</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="keyword">auto</span> denom = b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> * b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> + b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> * b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keyword">auto</span> x = a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> * b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> + a.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> * b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keyword">auto</span> y = a.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> * b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> - a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> * b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordflow">return</span> {x / denom, y / denom};</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span>}</div>
</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
<div class="foldopen" id="foldopen00121" data-start="{" data-end="}">
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2complex_8h.html#aaf53122a07c8eca858b5a8e38ae280e0"> 121</a></span><span class="keyword">constexpr</span> <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> <a class="code hl_function" href="backend_2metal_2kernels_2complex_8h.html#aaf53122a07c8eca858b5a8e38ae280e0">operator%</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> a, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> b) {</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keyword">auto</span> real = a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> - (b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> * <span class="keyword">static_cast&lt;</span>int64_t<span class="keyword">&gt;</span>(a.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> / b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>));</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keyword">auto</span> imag = a.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> - (b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> * <span class="keyword">static_cast&lt;</span>int64_t<span class="keyword">&gt;</span>(a.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> / b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>));</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keywordflow">if</span> (real != 0 &amp;&amp; (real &lt; 0 != b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> &lt; 0)) {</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> real += b.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>;</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> }</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keywordflow">if</span> (imag != 0 &amp;&amp; (imag &lt; 0 != b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> &lt; 0)) {</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> imag += b.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>;</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> }</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="keywordflow">return</span> {real, imag};</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span>}</div>
</div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html_a032a8d3eec2384c9f03066f7fd945995"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html#a032a8d3eec2384c9f03066f7fd945995">operator&gt;</a></div><div class="ttdeci">constexpr bool operator&gt;(complex64_t a, complex64_t b)</div><div class="ttdef"><b>Definition</b> complex.h:86</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html_a226cfd54d49f02e35c5aab3139c7596b"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html#a226cfd54d49f02e35c5aab3139c7596b">operator-</a></div><div class="ttdeci">constexpr complex64_t operator-(complex64_t x)</div><div class="ttdef"><b>Definition</b> complex.h:78</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html_a4f90ad54f4fae363e8d3cc41d539557b"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html#a4f90ad54f4fae363e8d3cc41d539557b">can_convert_to_complex64</a></div><div class="ttdeci">static constexpr constant bool can_convert_to_complex64</div><div class="ttdef"><b>Definition</b> complex.h:12</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html_a67674e32596a9dae2258bb8e0e6a2058"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html#a67674e32596a9dae2258bb8e0e6a2058">operator&lt;</a></div><div class="ttdeci">constexpr bool operator&lt;(complex64_t a, complex64_t b)</div><div class="ttdef"><b>Definition</b> complex.h:94</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html_a681d4fb076973f58f7dac894ec62a385"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html#a681d4fb076973f58f7dac894ec62a385">operator*</a></div><div class="ttdeci">constexpr complex64_t operator*(complex64_t a, complex64_t b)</div><div class="ttdef"><b>Definition</b> complex.h:110</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html_aaf53122a07c8eca858b5a8e38ae280e0"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html#aaf53122a07c8eca858b5a8e38ae280e0">operator%</a></div><div class="ttdeci">constexpr complex64_t operator%(complex64_t a, complex64_t b)</div><div class="ttdef"><b>Definition</b> complex.h:121</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html_aafbd686c180398c98b33d7643f893a46"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html#aafbd686c180398c98b33d7643f893a46">operator&gt;=</a></div><div class="ttdeci">constexpr bool operator&gt;=(complex64_t a, complex64_t b)</div><div class="ttdef"><b>Definition</b> complex.h:82</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html_ab149db78f6f19b8da6297dac4c36d893"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html#ab149db78f6f19b8da6297dac4c36d893">can_convert_from_complex64</a></div><div class="ttdeci">static constexpr constant bool can_convert_from_complex64</div><div class="ttdef"><b>Definition</b> complex.h:16</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html_abfc19f03616441245dfc7726b278f190"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html#abfc19f03616441245dfc7726b278f190">operator==</a></div><div class="ttdeci">constexpr bool operator==(complex64_t a, complex64_t b)</div><div class="ttdef"><b>Definition</b> complex.h:98</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html_ad6af5c6c5ed4898b49758618e5aee189"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html#ad6af5c6c5ed4898b49758618e5aee189">operator+</a></div><div class="ttdeci">constexpr complex64_t operator+(complex64_t a, complex64_t b)</div><div class="ttdef"><b>Definition</b> complex.h:102</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html_ae6a708f67d6fd9b0962aa8877cec6d35"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html#ae6a708f67d6fd9b0962aa8877cec6d35">operator/</a></div><div class="ttdeci">constexpr complex64_t operator/(complex64_t a, complex64_t b)</div><div class="ttdef"><b>Definition</b> complex.h:114</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html_aee04c9a63c6716a99a027418354debb0"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html#aee04c9a63c6716a99a027418354debb0">operator&lt;=</a></div><div class="ttdeci">constexpr bool operator&lt;=(complex64_t a, complex64_t b)</div><div class="ttdef"><b>Definition</b> complex.h:90</div></div>
<div class="ttc" id="anamespacemetal_html"><div class="ttname"><a href="namespacemetal.html">metal</a></div><div class="ttdef"><b>Definition</b> bf16.h:265</div></div>
<div class="ttc" id="astructcomplex64__t_html"><div class="ttname"><a href="structcomplex64__t.html">complex64_t</a></div><div class="ttdef"><b>Definition</b> complex.h:20</div></div>
<div class="ttc" id="astructcomplex64__t_html_a0a27a41206400f1e62b60ceb56960c93"><div class="ttname"><a href="structcomplex64__t.html#a0a27a41206400f1e62b60ceb56960c93">complex64_t::complex64_t</a></div><div class="ttdeci">constexpr complex64_t(T x) const ant</div><div class="ttdef"><b>Definition</b> complex.h:46</div></div>
<div class="ttc" id="astructcomplex64__t_html_a33a2452eb33b5ed53655773539c357a5"><div class="ttname"><a href="structcomplex64__t.html#a33a2452eb33b5ed53655773539c357a5">complex64_t::complex64_t</a></div><div class="ttdeci">constexpr complex64_t(T x) thread</div><div class="ttdef"><b>Definition</b> complex.h:31</div></div>
<div class="ttc" id="astructcomplex64__t_html_a89b65ace8588b7bf215355f705eb23d9"><div class="ttname"><a href="structcomplex64__t.html#a89b65ace8588b7bf215355f705eb23d9">complex64_t::complex64_t</a></div><div class="ttdeci">constexpr complex64_t(T x) threadgroup</div><div class="ttdef"><b>Definition</b> complex.h:36</div></div>
<div class="ttc" id="astructcomplex64__t_html_a94037c0cf8451aaff7cb4d154a8426de"><div class="ttname"><a href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">complex64_t::imag</a></div><div class="ttdeci">float imag</div><div class="ttdef"><b>Definition</b> complex.h:22</div></div>
<div class="ttc" id="astructcomplex64__t_html_abbd4a0092eca9f112c1c5ae1a133a27e"><div class="ttname"><a href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">complex64_t::real</a></div><div class="ttdeci">float real</div><div class="ttdef"><b>Definition</b> complex.h:21</div></div>
<div class="ttc" id="astructcomplex64__t_html_ac81b486f642fb3b26c5d659917bdbcd0"><div class="ttname"><a href="structcomplex64__t.html#ac81b486f642fb3b26c5d659917bdbcd0">complex64_t::complex64_t</a></div><div class="ttdeci">constexpr complex64_t(T x) device</div><div class="ttdef"><b>Definition</b> complex.h:41</div></div>
<div class="ttc" id="astructcomplex64__t_html_adbd392a5e92d31997380ad0a38be4be8"><div class="ttname"><a href="structcomplex64__t.html#adbd392a5e92d31997380ad0a38be4be8">complex64_t::complex64_t</a></div><div class="ttdeci">constexpr complex64_t(float real, float imag)</div><div class="ttdef"><b>Definition</b> complex.h:25</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,913 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/fft.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a> </div>
<div class="headertitle"><div class="title">fft.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;metal_common&gt;</code><br />
<code>#include &quot;<a class="el" href="radix_8h_source.html">mlx/backend/metal/kernels/fft/radix.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="readwrite_8h_source.html">mlx/backend/metal/kernels/fft/readwrite.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="steel_2defines_8h_source.html">mlx/backend/metal/kernels/steel/defines.h</a>&quot;</code><br />
</div>
<p><a href="backend_2metal_2kernels_2fft_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a7b6e56afa21f022c5e754b000955735a" id="r_a7b6e56afa21f022c5e754b000955735a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7b6e56afa21f022c5e754b000955735a">MAX_RADIX</a>&#160;&#160;&#160;13</td></tr>
<tr class="separator:a7b6e56afa21f022c5e754b000955735a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28d683cf067736d76f867f30c066317e" id="r_a28d683cf067736d76f867f30c066317e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a28d683cf067736d76f867f30c066317e">MAX_OUTPUT_SIZE</a>&#160;&#160;&#160;18</td></tr>
<tr class="separator:a28d683cf067736d76f867f30c066317e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a794032d3a9acff0e31c77c69d0007f10" id="r_a794032d3a9acff0e31c77c69d0007f10"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a794032d3a9acff0e31c77c69d0007f10">RADIX_STEP</a>(radix, radix_func, num_steps)</td></tr>
<tr class="separator:a794032d3a9acff0e31c77c69d0007f10"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a6ba62eabfd5428644aabf89ddaa0128d" id="r_a6ba62eabfd5428644aabf89ddaa0128d"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6ba62eabfd5428644aabf89ddaa0128d">RadixFunc</a>) (thread float2 *, thread float2 *)</td></tr>
<tr class="separator:a6ba62eabfd5428644aabf89ddaa0128d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a278d980ed397e6841ce0af44b9aa4396" id="r_a278d980ed397e6841ce0af44b9aa4396"><td class="memTemplParams" colspan="2">template&lt;int radix, <a class="el" href="#a6ba62eabfd5428644aabf89ddaa0128d">RadixFunc</a> radix_func&gt; </td></tr>
<tr class="memitem:a278d980ed397e6841ce0af44b9aa4396"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a278d980ed397e6841ce0af44b9aa4396">radix_butterfly</a> (int i, int p, thread float2 *x, thread short *indices, thread float2 *y)</td></tr>
<tr class="separator:a278d980ed397e6841ce0af44b9aa4396"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba8d32e0911499671df93678f39da08b" id="r_aba8d32e0911499671df93678f39da08b"><td class="memTemplParams" colspan="2">template&lt;int radix, <a class="el" href="#a6ba62eabfd5428644aabf89ddaa0128d">RadixFunc</a> radix_func&gt; </td></tr>
<tr class="memitem:aba8d32e0911499671df93678f39da08b"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aba8d32e0911499671df93678f39da08b">radix_n_steps</a> (int i, thread int *p, int m, int n, int num_steps, thread float2 *inputs, thread short *indices, thread float2 *values, threadgroup float2 *<a class="el" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>)</td></tr>
<tr class="separator:aba8d32e0911499671df93678f39da08b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a050ead8fa5cacdaec13d68ca3c0dcb81" id="r_a050ead8fa5cacdaec13d68ca3c0dcb81"><td class="memTemplParams" colspan="2">template&lt;bool rader = false&gt; </td></tr>
<tr class="memitem:a050ead8fa5cacdaec13d68ca3c0dcb81"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a050ead8fa5cacdaec13d68ca3c0dcb81">perform_fft</a> (int fft_idx, thread int *p, int m, int n, threadgroup float2 *<a class="el" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>)</td></tr>
<tr class="separator:a050ead8fa5cacdaec13d68ca3c0dcb81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4010b0e151e5f01e610e9c32234458c7" id="r_a4010b0e151e5f01e610e9c32234458c7"><td class="memTemplParams" colspan="2">template&lt;int tg_mem_size, typename in_T , typename out_T &gt; </td></tr>
<tr class="memitem:a4010b0e151e5f01e610e9c32234458c7"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a4010b0e151e5f01e610e9c32234458c7">fft</a> (const device in_T *in, device out_T *out, constant const int &amp;n, constant const int &amp;batch_size, uint3 elem, uint3 grid)</td></tr>
<tr class="separator:a4010b0e151e5f01e610e9c32234458c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad123452303f6415904f3592f660769b8" id="r_ad123452303f6415904f3592f660769b8"><td class="memTemplParams" colspan="2">template&lt;int tg_mem_size, typename in_T , typename out_T &gt; </td></tr>
<tr class="memitem:ad123452303f6415904f3592f660769b8"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ad123452303f6415904f3592f660769b8">rader_fft</a> (const device in_T *in, device out_T *out, const device float2 *raders_b_q, const device short *raders_g_q, const device short *raders_g_minus_q, constant const int &amp;n, constant const int &amp;batch_size, constant const int &amp;rader_n, uint3 elem, uint3 grid)</td></tr>
<tr class="separator:ad123452303f6415904f3592f660769b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0abc609e9756475800e996775a96a87e" id="r_a0abc609e9756475800e996775a96a87e"><td class="memTemplParams" colspan="2">template&lt;int tg_mem_size, typename in_T , typename out_T &gt; </td></tr>
<tr class="memitem:a0abc609e9756475800e996775a96a87e"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a0abc609e9756475800e996775a96a87e">bluestein_fft</a> (const device in_T *in, device out_T *out, const device float2 *w_q, const device float2 *w_k, constant const int &amp;length, constant const int &amp;n, constant const int &amp;batch_size, uint3 elem, uint3 grid)</td></tr>
<tr class="separator:a0abc609e9756475800e996775a96a87e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6558a8205ee4c3e4767bafa93f7606de" id="r_a6558a8205ee4c3e4767bafa93f7606de"><td class="memTemplParams" colspan="2">template&lt;int tg_mem_size, typename in_T , typename out_T , int step, bool real = false&gt; </td></tr>
<tr class="memitem:a6558a8205ee4c3e4767bafa93f7606de"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a6558a8205ee4c3e4767bafa93f7606de">four_step_fft</a> (const device in_T *in, device out_T *out, constant const int &amp;n1, constant const int &amp;n2, constant const int &amp;batch_size, uint3 elem, uint3 grid)</td></tr>
<tr class="separator:a6558a8205ee4c3e4767bafa93f7606de"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a23a773ae455da5d0b9b5508ee2e7694b" id="r_a23a773ae455da5d0b9b5508ee2e7694b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a23a773ae455da5d0b9b5508ee2e7694b">inv_</a></td></tr>
<tr class="separator:a23a773ae455da5d0b9b5508ee2e7694b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abeb0f8d030ee27c89882b87eed13be2d" id="r_abeb0f8d030ee27c89882b87eed13be2d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#abeb0f8d030ee27c89882b87eed13be2d">is_power_of_2_</a></td></tr>
<tr class="separator:abeb0f8d030ee27c89882b87eed13be2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf9b1130c134093453d15eee02683c94" id="r_acf9b1130c134093453d15eee02683c94"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a></td></tr>
<tr class="separator:acf9b1130c134093453d15eee02683c94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d03e78eedb9a084645f8f63185bcf2f" id="r_a5d03e78eedb9a084645f8f63185bcf2f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5d03e78eedb9a084645f8f63185bcf2f">rader_m_</a></td></tr>
<tr class="separator:a5d03e78eedb9a084645f8f63185bcf2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40c698855591f5d73b0d9258049571a2" id="r_a40c698855591f5d73b0d9258049571a2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a40c698855591f5d73b0d9258049571a2">radix_13_steps_</a></td></tr>
<tr class="separator:a40c698855591f5d73b0d9258049571a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af17a5682878a88283d995f2ca37681e4" id="r_af17a5682878a88283d995f2ca37681e4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af17a5682878a88283d995f2ca37681e4">radix_11_steps_</a></td></tr>
<tr class="separator:af17a5682878a88283d995f2ca37681e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aadbf4b8812c1489e78ea7d1184a0fdd9" id="r_aadbf4b8812c1489e78ea7d1184a0fdd9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aadbf4b8812c1489e78ea7d1184a0fdd9">radix_8_steps_</a></td></tr>
<tr class="separator:aadbf4b8812c1489e78ea7d1184a0fdd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02e428463b66a6e0f059bf8fc4f3a073" id="r_a02e428463b66a6e0f059bf8fc4f3a073"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a02e428463b66a6e0f059bf8fc4f3a073">radix_7_steps_</a></td></tr>
<tr class="separator:a02e428463b66a6e0f059bf8fc4f3a073"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92d77e600661bb6f4a7779b6529733b7" id="r_a92d77e600661bb6f4a7779b6529733b7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a92d77e600661bb6f4a7779b6529733b7">radix_6_steps_</a></td></tr>
<tr class="separator:a92d77e600661bb6f4a7779b6529733b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7cea841e54e678c583aeb369ea7bf573" id="r_a7cea841e54e678c583aeb369ea7bf573"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7cea841e54e678c583aeb369ea7bf573">radix_5_steps_</a></td></tr>
<tr class="separator:a7cea841e54e678c583aeb369ea7bf573"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad28408cc4ff0a4f820afd1aa18ca9646" id="r_ad28408cc4ff0a4f820afd1aa18ca9646"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad28408cc4ff0a4f820afd1aa18ca9646">radix_4_steps_</a></td></tr>
<tr class="separator:ad28408cc4ff0a4f820afd1aa18ca9646"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b23fe1ca5b7f650cc3e8b03efc55434" id="r_a7b23fe1ca5b7f650cc3e8b03efc55434"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7b23fe1ca5b7f650cc3e8b03efc55434">radix_3_steps_</a></td></tr>
<tr class="separator:a7b23fe1ca5b7f650cc3e8b03efc55434"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae76b69e0b030b8cf1ee7ca9011f3e504" id="r_ae76b69e0b030b8cf1ee7ca9011f3e504"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae76b69e0b030b8cf1ee7ca9011f3e504">radix_2_steps_</a></td></tr>
<tr class="separator:ae76b69e0b030b8cf1ee7ca9011f3e504"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fe88d81170dc4e2e8993c58b887dce6" id="r_a7fe88d81170dc4e2e8993c58b887dce6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7fe88d81170dc4e2e8993c58b887dce6">rader_13_steps_</a></td></tr>
<tr class="separator:a7fe88d81170dc4e2e8993c58b887dce6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1538cb224d84bfedf6655f8ea05aac8" id="r_ae1538cb224d84bfedf6655f8ea05aac8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae1538cb224d84bfedf6655f8ea05aac8">rader_11_steps_</a></td></tr>
<tr class="separator:ae1538cb224d84bfedf6655f8ea05aac8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb9b3944eb792a4f518b5e151a3e1591" id="r_adb9b3944eb792a4f518b5e151a3e1591"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#adb9b3944eb792a4f518b5e151a3e1591">rader_8_steps_</a></td></tr>
<tr class="separator:adb9b3944eb792a4f518b5e151a3e1591"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9946b98d3350cb1b3c08ad4f7b67f880" id="r_a9946b98d3350cb1b3c08ad4f7b67f880"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9946b98d3350cb1b3c08ad4f7b67f880">rader_7_steps_</a></td></tr>
<tr class="separator:a9946b98d3350cb1b3c08ad4f7b67f880"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97d2f30278a31635497d7c6c3443206a" id="r_a97d2f30278a31635497d7c6c3443206a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a97d2f30278a31635497d7c6c3443206a">rader_6_steps_</a></td></tr>
<tr class="separator:a97d2f30278a31635497d7c6c3443206a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad64f06afe2ff8ada7449556e1c41b39a" id="r_ad64f06afe2ff8ada7449556e1c41b39a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad64f06afe2ff8ada7449556e1c41b39a">rader_5_steps_</a></td></tr>
<tr class="separator:ad64f06afe2ff8ada7449556e1c41b39a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add993232d88c3203960852a6de6a03c3" id="r_add993232d88c3203960852a6de6a03c3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#add993232d88c3203960852a6de6a03c3">rader_4_steps_</a></td></tr>
<tr class="separator:add993232d88c3203960852a6de6a03c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab5dd8c9141fbee09048ba6837ab8aae" id="r_aab5dd8c9141fbee09048ba6837ab8aae"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aab5dd8c9141fbee09048ba6837ab8aae">rader_3_steps_</a></td></tr>
<tr class="separator:aab5dd8c9141fbee09048ba6837ab8aae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6faebd7ba948a4b572b7933f6d3b8646" id="r_a6faebd7ba948a4b572b7933f6d3b8646"><td class="memItemLeft" align="right" valign="top"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6faebd7ba948a4b572b7933f6d3b8646">rader_2_steps_</a></td></tr>
<tr class="separator:a6faebd7ba948a4b572b7933f6d3b8646"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a28d683cf067736d76f867f30c066317e" name="a28d683cf067736d76f867f30c066317e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a28d683cf067736d76f867f30c066317e">&#9670;&#160;</a></span>MAX_OUTPUT_SIZE</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MAX_OUTPUT_SIZE&#160;&#160;&#160;18</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a7b6e56afa21f022c5e754b000955735a" name="a7b6e56afa21f022c5e754b000955735a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7b6e56afa21f022c5e754b000955735a">&#9670;&#160;</a></span>MAX_RADIX</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MAX_RADIX&#160;&#160;&#160;13</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a794032d3a9acff0e31c77c69d0007f10" name="a794032d3a9acff0e31c77c69d0007f10"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a794032d3a9acff0e31c77c69d0007f10">&#9670;&#160;</a></span>RADIX_STEP</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define RADIX_STEP</td>
<td>(</td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">radix, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">radix_func, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">num_steps</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"> radix_n_steps&lt;radix, radix_func&gt;( \</div>
<div class="line"> fft_idx, p, m, n, num_steps, inputs, indices, values, <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
<div class="ttc" id="abackend_2metal_2allocator_8h_html_a15aa5cc1baf29be08d55cca88509e697"><div class="ttname"><a href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a></div><div class="ttdeci">MTL::Buffer * buf</div><div class="ttdef"><b>Definition</b> allocator.h:38</div></div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="a6ba62eabfd5428644aabf89ddaa0128d" name="a6ba62eabfd5428644aabf89ddaa0128d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ba62eabfd5428644aabf89ddaa0128d">&#9670;&#160;</a></span>RadixFunc</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* RadixFunc) (thread float2 *, thread float2 *)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a0abc609e9756475800e996775a96a87e" name="a0abc609e9756475800e996775a96a87e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0abc609e9756475800e996775a96a87e">&#9670;&#160;</a></span>bluestein_fft()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int tg_mem_size, typename in_T , typename out_T &gt; </div>
<table class="memname">
<tr>
<td class="memname">void bluestein_fft </td>
<td>(</td>
<td class="paramtype">const device in_T *</td> <td class="paramname"><span class="paramname"><em>in</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">device out_T *</td> <td class="paramname"><span class="paramname"><em>out</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const device float2 *</td> <td class="paramname"><span class="paramname"><em>w_q</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const device float2 *</td> <td class="paramname"><span class="paramname"><em>w_k</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int &amp;</td> <td class="paramname"><span class="paramname"><em>length</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int &amp;</td> <td class="paramname"><span class="paramname"><em>n</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int &amp;</td> <td class="paramname"><span class="paramname"><em>batch_size</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>grid</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a4010b0e151e5f01e610e9c32234458c7" name="a4010b0e151e5f01e610e9c32234458c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4010b0e151e5f01e610e9c32234458c7">&#9670;&#160;</a></span>fft()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int tg_mem_size, typename in_T , typename out_T &gt; </div>
<table class="memname">
<tr>
<td class="memname">void fft </td>
<td>(</td>
<td class="paramtype">const device in_T *</td> <td class="paramname"><span class="paramname"><em>in</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">device out_T *</td> <td class="paramname"><span class="paramname"><em>out</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int &amp;</td> <td class="paramname"><span class="paramname"><em>n</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int &amp;</td> <td class="paramname"><span class="paramname"><em>batch_size</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>grid</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a6558a8205ee4c3e4767bafa93f7606de" name="a6558a8205ee4c3e4767bafa93f7606de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6558a8205ee4c3e4767bafa93f7606de">&#9670;&#160;</a></span>four_step_fft()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int tg_mem_size, typename in_T , typename out_T , int step, bool real = false&gt; </div>
<table class="memname">
<tr>
<td class="memname">void four_step_fft </td>
<td>(</td>
<td class="paramtype">const device in_T *</td> <td class="paramname"><span class="paramname"><em>in</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">device out_T *</td> <td class="paramname"><span class="paramname"><em>out</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int &amp;</td> <td class="paramname"><span class="paramname"><em>n1</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int &amp;</td> <td class="paramname"><span class="paramname"><em>n2</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int &amp;</td> <td class="paramname"><span class="paramname"><em>batch_size</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>grid</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a050ead8fa5cacdaec13d68ca3c0dcb81" name="a050ead8fa5cacdaec13d68ca3c0dcb81"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a050ead8fa5cacdaec13d68ca3c0dcb81">&#9670;&#160;</a></span>perform_fft()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;bool rader = false&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC void perform_fft </td>
<td>(</td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>fft_idx</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">thread int *</td> <td class="paramname"><span class="paramname"><em>p</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>m</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>n</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">threadgroup float2 *</td> <td class="paramname"><span class="paramname"><em>buf</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ad123452303f6415904f3592f660769b8" name="ad123452303f6415904f3592f660769b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad123452303f6415904f3592f660769b8">&#9670;&#160;</a></span>rader_fft()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int tg_mem_size, typename in_T , typename out_T &gt; </div>
<table class="memname">
<tr>
<td class="memname">void rader_fft </td>
<td>(</td>
<td class="paramtype">const device in_T *</td> <td class="paramname"><span class="paramname"><em>in</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">device out_T *</td> <td class="paramname"><span class="paramname"><em>out</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const device float2 *</td> <td class="paramname"><span class="paramname"><em>raders_b_q</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const device short *</td> <td class="paramname"><span class="paramname"><em>raders_g_q</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const device short *</td> <td class="paramname"><span class="paramname"><em>raders_g_minus_q</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int &amp;</td> <td class="paramname"><span class="paramname"><em>n</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int &amp;</td> <td class="paramname"><span class="paramname"><em>batch_size</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int &amp;</td> <td class="paramname"><span class="paramname"><em>rader_n</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>grid</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a278d980ed397e6841ce0af44b9aa4396" name="a278d980ed397e6841ce0af44b9aa4396"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a278d980ed397e6841ce0af44b9aa4396">&#9670;&#160;</a></span>radix_butterfly()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int radix, <a class="el" href="#a6ba62eabfd5428644aabf89ddaa0128d">RadixFunc</a> radix_func&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC void radix_butterfly </td>
<td>(</td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>i</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>p</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">thread float2 *</td> <td class="paramname"><span class="paramname"><em>x</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">thread short *</td> <td class="paramname"><span class="paramname"><em>indices</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">thread float2 *</td> <td class="paramname"><span class="paramname"><em>y</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aba8d32e0911499671df93678f39da08b" name="aba8d32e0911499671df93678f39da08b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba8d32e0911499671df93678f39da08b">&#9670;&#160;</a></span>radix_n_steps()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int radix, <a class="el" href="#a6ba62eabfd5428644aabf89ddaa0128d">RadixFunc</a> radix_func&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC void radix_n_steps </td>
<td>(</td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>i</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">thread int *</td> <td class="paramname"><span class="paramname"><em>p</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>m</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>n</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>num_steps</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">thread float2 *</td> <td class="paramname"><span class="paramname"><em>inputs</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">thread short *</td> <td class="paramname"><span class="paramname"><em>indices</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">thread float2 *</td> <td class="paramname"><span class="paramname"><em>values</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">threadgroup float2 *</td> <td class="paramname"><span class="paramname"><em>buf</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="acf9b1130c134093453d15eee02683c94" name="acf9b1130c134093453d15eee02683c94"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf9b1130c134093453d15eee02683c94">&#9670;&#160;</a></span>elems_per_thread_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int elems_per_thread_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a23a773ae455da5d0b9b5508ee2e7694b" name="a23a773ae455da5d0b9b5508ee2e7694b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a23a773ae455da5d0b9b5508ee2e7694b">&#9670;&#160;</a></span>inv_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> bool inv_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="abeb0f8d030ee27c89882b87eed13be2d" name="abeb0f8d030ee27c89882b87eed13be2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abeb0f8d030ee27c89882b87eed13be2d">&#9670;&#160;</a></span>is_power_of_2_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> bool is_power_of_2_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ae1538cb224d84bfedf6655f8ea05aac8" name="ae1538cb224d84bfedf6655f8ea05aac8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae1538cb224d84bfedf6655f8ea05aac8">&#9670;&#160;</a></span>rader_11_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int rader_11_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a7fe88d81170dc4e2e8993c58b887dce6" name="a7fe88d81170dc4e2e8993c58b887dce6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7fe88d81170dc4e2e8993c58b887dce6">&#9670;&#160;</a></span>rader_13_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int rader_13_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a6faebd7ba948a4b572b7933f6d3b8646" name="a6faebd7ba948a4b572b7933f6d3b8646"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6faebd7ba948a4b572b7933f6d3b8646">&#9670;&#160;</a></span>rader_2_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int rader_2_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aab5dd8c9141fbee09048ba6837ab8aae" name="aab5dd8c9141fbee09048ba6837ab8aae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aab5dd8c9141fbee09048ba6837ab8aae">&#9670;&#160;</a></span>rader_3_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int rader_3_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="add993232d88c3203960852a6de6a03c3" name="add993232d88c3203960852a6de6a03c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add993232d88c3203960852a6de6a03c3">&#9670;&#160;</a></span>rader_4_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int rader_4_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ad64f06afe2ff8ada7449556e1c41b39a" name="ad64f06afe2ff8ada7449556e1c41b39a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad64f06afe2ff8ada7449556e1c41b39a">&#9670;&#160;</a></span>rader_5_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int rader_5_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a97d2f30278a31635497d7c6c3443206a" name="a97d2f30278a31635497d7c6c3443206a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a97d2f30278a31635497d7c6c3443206a">&#9670;&#160;</a></span>rader_6_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int rader_6_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a9946b98d3350cb1b3c08ad4f7b67f880" name="a9946b98d3350cb1b3c08ad4f7b67f880"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9946b98d3350cb1b3c08ad4f7b67f880">&#9670;&#160;</a></span>rader_7_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int rader_7_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="adb9b3944eb792a4f518b5e151a3e1591" name="adb9b3944eb792a4f518b5e151a3e1591"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb9b3944eb792a4f518b5e151a3e1591">&#9670;&#160;</a></span>rader_8_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int rader_8_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a5d03e78eedb9a084645f8f63185bcf2f" name="a5d03e78eedb9a084645f8f63185bcf2f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5d03e78eedb9a084645f8f63185bcf2f">&#9670;&#160;</a></span>rader_m_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int rader_m_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="af17a5682878a88283d995f2ca37681e4" name="af17a5682878a88283d995f2ca37681e4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af17a5682878a88283d995f2ca37681e4">&#9670;&#160;</a></span>radix_11_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int radix_11_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a40c698855591f5d73b0d9258049571a2" name="a40c698855591f5d73b0d9258049571a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40c698855591f5d73b0d9258049571a2">&#9670;&#160;</a></span>radix_13_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int radix_13_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ae76b69e0b030b8cf1ee7ca9011f3e504" name="ae76b69e0b030b8cf1ee7ca9011f3e504"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae76b69e0b030b8cf1ee7ca9011f3e504">&#9670;&#160;</a></span>radix_2_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int radix_2_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a7b23fe1ca5b7f650cc3e8b03efc55434" name="a7b23fe1ca5b7f650cc3e8b03efc55434"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7b23fe1ca5b7f650cc3e8b03efc55434">&#9670;&#160;</a></span>radix_3_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int radix_3_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ad28408cc4ff0a4f820afd1aa18ca9646" name="ad28408cc4ff0a4f820afd1aa18ca9646"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad28408cc4ff0a4f820afd1aa18ca9646">&#9670;&#160;</a></span>radix_4_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int radix_4_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a7cea841e54e678c583aeb369ea7bf573" name="a7cea841e54e678c583aeb369ea7bf573"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7cea841e54e678c583aeb369ea7bf573">&#9670;&#160;</a></span>radix_5_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int radix_5_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a92d77e600661bb6f4a7779b6529733b7" name="a92d77e600661bb6f4a7779b6529733b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a92d77e600661bb6f4a7779b6529733b7">&#9670;&#160;</a></span>radix_6_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int radix_6_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a02e428463b66a6e0f059bf8fc4f3a073" name="a02e428463b66a6e0f059bf8fc4f3a073"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a02e428463b66a6e0f059bf8fc4f3a073">&#9670;&#160;</a></span>radix_7_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int radix_7_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aadbf4b8812c1489e78ea7d1184a0fdd9" name="aadbf4b8812c1489e78ea7d1184a0fdd9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aadbf4b8812c1489e78ea7d1184a0fdd9">&#9670;&#160;</a></span>radix_8_steps_</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> int radix_8_steps_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,647 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/fft.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">fft.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2metal_2kernels_2fft_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// Metal FFT using Stockham&#39;s algorithm</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">//</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">// References:</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">// - VkFFT (https://github.com/DTolm/VkFFT)</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">// - Eric Bainville&#39;s excellent page (http://www.bealto.com/gpu-fft.html)</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="preprocessor">#include &lt;metal_common&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;<a class="code" href="radix_8h.html">mlx/backend/metal/kernels/fft/radix.h</a>&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &quot;<a class="code" href="readwrite_8h.html">mlx/backend/metal/kernels/fft/readwrite.h</a>&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include &quot;<a class="code" href="steel_2defines_8h.html">mlx/backend/metal/kernels/steel/defines.h</a>&quot;</span></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">using namespace </span><a class="code hl_namespace" href="namespacemetal.html">metal</a>;</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a7b6e56afa21f022c5e754b000955735a"> 17</a></span><span class="preprocessor">#define MAX_RADIX 13</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// Reached when elems_per_thread_ = 6, max_radix = 13</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">// and some threads have to do 3 radix 6s requiring 18 float2s.</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a28d683cf067736d76f867f30c066317e"> 20</a></span><span class="preprocessor">#define MAX_OUTPUT_SIZE 18</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// Specialize for a particular value of N at runtime</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a23a773ae455da5d0b9b5508ee2e7694b"> 23</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">bool</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a23a773ae455da5d0b9b5508ee2e7694b">inv_</a> [[function_constant(0)]];</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#abeb0f8d030ee27c89882b87eed13be2d"> 24</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">bool</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#abeb0f8d030ee27c89882b87eed13be2d">is_power_of_2_</a> [[function_constant(1)]];</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94"> 25</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a> [[function_constant(2)]];</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// rader_m = n / rader_n</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a5d03e78eedb9a084645f8f63185bcf2f"> 27</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a5d03e78eedb9a084645f8f63185bcf2f">rader_m_</a> [[function_constant(3)]];</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">// Stockham steps</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a40c698855591f5d73b0d9258049571a2"> 29</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a40c698855591f5d73b0d9258049571a2">radix_13_steps_</a> [[function_constant(4)]];</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#af17a5682878a88283d995f2ca37681e4"> 30</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#af17a5682878a88283d995f2ca37681e4">radix_11_steps_</a> [[function_constant(5)]];</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#aadbf4b8812c1489e78ea7d1184a0fdd9"> 31</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#aadbf4b8812c1489e78ea7d1184a0fdd9">radix_8_steps_</a> [[function_constant(6)]];</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a02e428463b66a6e0f059bf8fc4f3a073"> 32</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a02e428463b66a6e0f059bf8fc4f3a073">radix_7_steps_</a> [[function_constant(7)]];</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a92d77e600661bb6f4a7779b6529733b7"> 33</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a92d77e600661bb6f4a7779b6529733b7">radix_6_steps_</a> [[function_constant(8)]];</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a7cea841e54e678c583aeb369ea7bf573"> 34</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a7cea841e54e678c583aeb369ea7bf573">radix_5_steps_</a> [[function_constant(9)]];</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#ad28408cc4ff0a4f820afd1aa18ca9646"> 35</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#ad28408cc4ff0a4f820afd1aa18ca9646">radix_4_steps_</a> [[function_constant(10)]];</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a7b23fe1ca5b7f650cc3e8b03efc55434"> 36</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a7b23fe1ca5b7f650cc3e8b03efc55434">radix_3_steps_</a> [[function_constant(11)]];</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#ae76b69e0b030b8cf1ee7ca9011f3e504"> 37</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#ae76b69e0b030b8cf1ee7ca9011f3e504">radix_2_steps_</a> [[function_constant(12)]];</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="comment">// Rader steps</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a7fe88d81170dc4e2e8993c58b887dce6"> 39</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a7fe88d81170dc4e2e8993c58b887dce6">rader_13_steps_</a> [[function_constant(13)]];</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#ae1538cb224d84bfedf6655f8ea05aac8"> 40</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#ae1538cb224d84bfedf6655f8ea05aac8">rader_11_steps_</a> [[function_constant(14)]];</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#adb9b3944eb792a4f518b5e151a3e1591"> 41</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#adb9b3944eb792a4f518b5e151a3e1591">rader_8_steps_</a> [[function_constant(15)]];</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a9946b98d3350cb1b3c08ad4f7b67f880"> 42</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a9946b98d3350cb1b3c08ad4f7b67f880">rader_7_steps_</a> [[function_constant(16)]];</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a97d2f30278a31635497d7c6c3443206a"> 43</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a97d2f30278a31635497d7c6c3443206a">rader_6_steps_</a> [[function_constant(17)]];</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#ad64f06afe2ff8ada7449556e1c41b39a"> 44</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#ad64f06afe2ff8ada7449556e1c41b39a">rader_5_steps_</a> [[function_constant(18)]];</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#add993232d88c3203960852a6de6a03c3"> 45</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#add993232d88c3203960852a6de6a03c3">rader_4_steps_</a> [[function_constant(19)]];</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#aab5dd8c9141fbee09048ba6837ab8aae"> 46</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#aab5dd8c9141fbee09048ba6837ab8aae">rader_3_steps_</a> [[function_constant(20)]];</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a6faebd7ba948a4b572b7933f6d3b8646"> 47</a></span><a class="code hl_define" href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a> <span class="keywordtype">int</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a6faebd7ba948a4b572b7933f6d3b8646">rader_2_steps_</a> [[function_constant(21)]];</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="comment">// See &quot;radix.h&quot; for radix codelets</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a6ba62eabfd5428644aabf89ddaa0128d"> 50</a></span><span class="keyword">typedef</span> void (*<a class="code hl_typedef" href="backend_2metal_2kernels_2fft_8h.html#a6ba62eabfd5428644aabf89ddaa0128d">RadixFunc</a>)(thread float2*, thread float2*);</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="comment">// Perform a single radix n butterfly with appropriate twiddles</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="keyword">template</span> &lt;<span class="keywordtype">int</span> radix, RadixFunc radix_func&gt;</div>
<div class="foldopen" id="foldopen00054" data-start="{" data-end="}">
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a278d980ed397e6841ce0af44b9aa4396"> 54</a></span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#a278d980ed397e6841ce0af44b9aa4396">radix_butterfly</a>(</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">int</span> i,</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">int</span> p,</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> thread float2* x,</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> thread <span class="keywordtype">short</span>* indices,</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> thread float2* y) {</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="comment">// i: the index in the overall DFT that we&#39;re processing.</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="comment">// p: the size of the DFTs we&#39;re merging at this step.</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="comment">// m: how many threads are working on this DFT.</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordtype">int</span> k, j;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="comment">// Use faster bitwise operations when working with powers of two</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> radix_p_2 = (radix &amp; (radix - 1)) == 0;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordflow">if</span> (radix_p_2 &amp;&amp; <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#abeb0f8d030ee27c89882b87eed13be2d">is_power_of_2_</a>) {</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keyword">constexpr</span> <span class="keywordtype">short</span> power = __builtin_ctz(radix);</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> k = i &amp; (p - 1);</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> j = ((i - k) &lt;&lt; power) + k;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> k = i % p;</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> j = (i / p) * radix * p + k;</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"> 75</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="comment">// Apply twiddles</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">if</span> (p &gt; 1) {</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> float2 twiddle_1 = <a class="code hl_function" href="radix_8h.html#ac5cf950316b9445296ee9ecfc56a56bd">get_twiddle</a>(k, radix * p);</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> float2 twiddle = twiddle_1;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> x[1] = <a class="code hl_function" href="radix_8h.html#a5bfc53b531214c9ce277bebc18aa67d6">complex_mul</a>(x[1], twiddle);</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <a class="code hl_define" href="steel_2defines_8h.html#a5a5c3095b132a7589bc19cd5cb80e2c6">STEEL_PRAGMA_UNROLL</a></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> t = 2; t &lt; radix; t++) {</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> twiddle = <a class="code hl_function" href="radix_8h.html#a5bfc53b531214c9ce277bebc18aa67d6">complex_mul</a>(twiddle, twiddle_1);</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> x[t] = <a class="code hl_function" href="radix_8h.html#a5bfc53b531214c9ce277bebc18aa67d6">complex_mul</a>(x[t], twiddle);</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> }</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> }</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> radix_func(x, y);</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <a class="code hl_define" href="steel_2defines_8h.html#a5a5c3095b132a7589bc19cd5cb80e2c6">STEEL_PRAGMA_UNROLL</a></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> t = 0; t &lt; radix; t++) {</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> indices[t] = j + t * p;</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> }</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span>}</div>
</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="comment">// Perform all the radix steps required for a</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="comment">// particular radix size n.</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="keyword">template</span> &lt;<span class="keywordtype">int</span> radix, RadixFunc radix_func&gt;</div>
<div class="foldopen" id="foldopen00100" data-start="{" data-end="}">
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#aba8d32e0911499671df93678f39da08b"> 100</a></span>METAL_FUNC <span class="keywordtype">void</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#aba8d32e0911499671df93678f39da08b">radix_n_steps</a>(</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordtype">int</span> i,</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> thread <span class="keywordtype">int</span>* p,</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordtype">int</span> m,</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordtype">int</span> n,</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordtype">int</span> num_steps,</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> thread float2* inputs,</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> thread <span class="keywordtype">short</span>* indices,</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> thread float2* values,</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> threadgroup float2* <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>) {</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordtype">int</span> m_r = n / radix;</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="comment">// When combining different sized radices, we have to do</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="comment">// multiple butterflies in a single thread.</span></div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="comment">// E.g. n = 28 = 4 * 7</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="comment">// 4 threads, 7 elems_per_thread</span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="comment">// All threads do 1 radix7 butterfly.</span></div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="comment">// 3 threads do 2 radix4 butterflies.</span></div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="comment">// 1 thread does 1 radix4 butterfly.</span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordtype">int</span> max_radices_per_thread = (<a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a> + radix - 1) / radix;</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordtype">int</span> index = 0;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordtype">int</span> r_index = 0;</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> s = 0; s &lt; num_steps; s++) {</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> t = 0; t &lt; max_radices_per_thread; t++) {</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> index = i + t * m;</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordflow">if</span> (index &lt; m_r) {</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> r = 0; r &lt; radix; r++) {</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> inputs[r] = <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[index + r * m_r];</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> }</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> radix_butterfly&lt;radix, radix_func&gt;(</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> index, *p, inputs, indices + t * radix, values + t * radix);</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> }</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> }</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> </div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="comment">// Wait until all threads have read their inputs into thread local mem</span></div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> threadgroup_barrier(mem_flags::mem_threadgroup);</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> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> t = 0; t &lt; max_radices_per_thread; t++) {</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> index = i + t * m;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <span class="keywordflow">if</span> (index &lt; m_r) {</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> r = 0; r &lt; radix; r++) {</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> r_index = t * radix + r;</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[indices[r_index]] = values[r_index];</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> }</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> }</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> }</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="comment">// Wait until all threads have written back to threadgroup mem</span></div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> threadgroup_barrier(mem_flags::mem_threadgroup);</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> *p *= radix;</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>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> </div>
<div class="foldopen" id="foldopen00153" data-start="" data-end="">
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a794032d3a9acff0e31c77c69d0007f10"> 153</a></span><span class="preprocessor">#define RADIX_STEP(radix, radix_func, num_steps) \</span></div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span><span class="preprocessor"> radix_n_steps&lt;radix, radix_func&gt;( \</span></div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span><span class="preprocessor"> fft_idx, p, m, n, num_steps, inputs, indices, values, buf);</span></div>
</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><span class="keyword">template</span> &lt;<span class="keywordtype">bool</span> rader = false&gt;</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span>METAL_FUNC <span class="keywordtype">void</span></div>
<div class="foldopen" id="foldopen00159" data-start="{" data-end="}">
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a050ead8fa5cacdaec13d68ca3c0dcb81"> 159</a></span><a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#a050ead8fa5cacdaec13d68ca3c0dcb81">perform_fft</a>(<span class="keywordtype">int</span> fft_idx, thread <span class="keywordtype">int</span>* p, <span class="keywordtype">int</span> m, <span class="keywordtype">int</span> n, threadgroup float2* <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>) {</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> float2 inputs[<a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a7b6e56afa21f022c5e754b000955735a">MAX_RADIX</a>];</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="keywordtype">short</span> indices[<a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a28d683cf067736d76f867f30c066317e">MAX_OUTPUT_SIZE</a>];</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> float2 values[<a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a28d683cf067736d76f867f30c066317e">MAX_OUTPUT_SIZE</a>];</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> <a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a794032d3a9acff0e31c77c69d0007f10">RADIX_STEP</a>(2, <a class="code hl_function" href="radix_8h.html#a745e50244f1470bba233d8b6b993729c">radix2</a>, rader ? <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a6faebd7ba948a4b572b7933f6d3b8646">rader_2_steps_</a> : <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#ae76b69e0b030b8cf1ee7ca9011f3e504">radix_2_steps_</a>);</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a794032d3a9acff0e31c77c69d0007f10">RADIX_STEP</a>(3, <a class="code hl_function" href="radix_8h.html#a497b31cfa28418e1c2fad53d09f7bc0b">radix3</a>, rader ? <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#aab5dd8c9141fbee09048ba6837ab8aae">rader_3_steps_</a> : <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a7b23fe1ca5b7f650cc3e8b03efc55434">radix_3_steps_</a>);</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a794032d3a9acff0e31c77c69d0007f10">RADIX_STEP</a>(4, <a class="code hl_function" href="radix_8h.html#a12cb26bd3ad635d16a195ccea750256d">radix4</a>, rader ? <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#add993232d88c3203960852a6de6a03c3">rader_4_steps_</a> : <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#ad28408cc4ff0a4f820afd1aa18ca9646">radix_4_steps_</a>);</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a794032d3a9acff0e31c77c69d0007f10">RADIX_STEP</a>(5, <a class="code hl_function" href="radix_8h.html#a026e6779e6d2ecdef39ff4aad186091e">radix5</a>, rader ? <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#ad64f06afe2ff8ada7449556e1c41b39a">rader_5_steps_</a> : <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a7cea841e54e678c583aeb369ea7bf573">radix_5_steps_</a>);</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a794032d3a9acff0e31c77c69d0007f10">RADIX_STEP</a>(6, <a class="code hl_function" href="radix_8h.html#afaaa5de58a97f0a5e6a84fc0d598a884">radix6</a>, rader ? <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a97d2f30278a31635497d7c6c3443206a">rader_6_steps_</a> : <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a92d77e600661bb6f4a7779b6529733b7">radix_6_steps_</a>);</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a794032d3a9acff0e31c77c69d0007f10">RADIX_STEP</a>(7, <a class="code hl_function" href="radix_8h.html#a6d37e483d806c550deefabf56caf4ec8">radix7</a>, rader ? <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a9946b98d3350cb1b3c08ad4f7b67f880">rader_7_steps_</a> : <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a02e428463b66a6e0f059bf8fc4f3a073">radix_7_steps_</a>);</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a794032d3a9acff0e31c77c69d0007f10">RADIX_STEP</a>(8, <a class="code hl_function" href="radix_8h.html#a6b306e1afe1c5b6af4cd80aa02adb138">radix8</a>, rader ? <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#adb9b3944eb792a4f518b5e151a3e1591">rader_8_steps_</a> : <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#aadbf4b8812c1489e78ea7d1184a0fdd9">radix_8_steps_</a>);</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a794032d3a9acff0e31c77c69d0007f10">RADIX_STEP</a>(11, <a class="code hl_function" href="radix_8h.html#a34f7dcefd29f8a7f6bddf9a17609a8a7">radix11</a>, rader ? <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#ae1538cb224d84bfedf6655f8ea05aac8">rader_11_steps_</a> : <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#af17a5682878a88283d995f2ca37681e4">radix_11_steps_</a>);</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a794032d3a9acff0e31c77c69d0007f10">RADIX_STEP</a>(13, <a class="code hl_function" href="radix_8h.html#a833b7b31facbd62f6971bb108c54d1db">radix13</a>, rader ? <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a7fe88d81170dc4e2e8993c58b887dce6">rader_13_steps_</a> : <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a40c698855591f5d73b0d9258049571a2">radix_13_steps_</a>);</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span>}</div>
</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><span class="comment">// Each FFT is computed entirely in shared GPU memory.</span></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span><span class="comment">//</span></div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span><span class="comment">// N is decomposed into radix-n DFTs:</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span><span class="comment">// e.g. 128 = 2 * 4 * 4 * 4</span></div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span><span class="keyword">template</span> &lt;<span class="keywordtype">int</span> tg_mem_size, <span class="keyword">typename</span> in_T, <span class="keyword">typename</span> out_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="backend_2metal_2kernels_2fft_8h.html#a4010b0e151e5f01e610e9c32234458c7"> 180</a></span>[[kernel]] <span class="keywordtype">void</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#a4010b0e151e5f01e610e9c32234458c7">fft</a>(</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <span class="keyword">const</span> device in_T* in [[buffer(0)]],</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> device out_T* out [[buffer(1)]],</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; n,</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; batch_size,</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> uint3 elem [[thread_position_in_grid]],</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> uint3 grid [[threads_per_grid]]) {</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> threadgroup float2 shared_in[tg_mem_size];</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> </div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> thread <a class="code hl_struct" href="struct_read_writer.html">ReadWriter&lt;in_T, out_T&gt;</a> read_writer = <a class="code hl_struct" href="struct_read_writer.html">ReadWriter&lt;in_T, out_T&gt;</a>(</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> in,</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> &amp;shared_in[0],</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> out,</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> n,</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> batch_size,</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a>,</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> elem,</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> grid,</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a23a773ae455da5d0b9b5508ee2e7694b">inv_</a>);</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">if</span> (read_writer.out_of_bounds()) {</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> };</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> read_writer.load();</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> </div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> threadgroup_barrier(mem_flags::mem_threadgroup);</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> </div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> <span class="keywordtype">int</span> p = 1;</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <span class="keywordtype">int</span> fft_idx = elem.z; <span class="comment">// Thread index in DFT</span></div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <span class="keywordtype">int</span> m = grid.z; <span class="comment">// Threads per DFT</span></div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> <span class="keywordtype">int</span> tg_idx = elem.y * n; <span class="comment">// Index of this DFT in threadgroup</span></div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> threadgroup float2* <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a> = &amp;shared_in[tg_idx];</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> </div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#a050ead8fa5cacdaec13d68ca3c0dcb81">perform_fft</a>(fft_idx, &amp;p, m, n, <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> </div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> read_writer.write();</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span>}</div>
</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> </div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span><span class="keyword">template</span> &lt;<span class="keywordtype">int</span> tg_mem_size, <span class="keyword">typename</span> in_T, <span class="keyword">typename</span> out_T&gt;</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="backend_2metal_2kernels_2fft_8h.html#ad123452303f6415904f3592f660769b8"> 219</a></span>[[kernel]] <span class="keywordtype">void</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#ad123452303f6415904f3592f660769b8">rader_fft</a>(</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="keyword">const</span> device in_T* in [[buffer(0)]],</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> device out_T* out [[buffer(1)]],</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <span class="keyword">const</span> device float2* raders_b_q [[buffer(2)]],</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> <span class="keyword">const</span> device <span class="keywordtype">short</span>* raders_g_q [[buffer(3)]],</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <span class="keyword">const</span> device <span class="keywordtype">short</span>* raders_g_minus_q [[buffer(4)]],</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; n,</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; batch_size,</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; rader_n,</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> uint3 elem [[thread_position_in_grid]],</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> uint3 grid [[threads_per_grid]]) {</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> <span class="comment">// Use Rader&#39;s algorithm to compute fast FFTs</span></div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="comment">// when a prime factor `p` of `n` is greater than 13 but</span></div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="comment">// has `p - 1` Stockham decomposable into to prime factors &lt;= 13.</span></div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> <span class="comment">//</span></div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> <span class="comment">// E.g. n = 102</span></div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> <span class="comment">// = 2 * 3 * 17</span></div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> <span class="comment">// . = 2 * 3 * RADER(16)</span></div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> <span class="comment">// . = 2 * 3 * RADER(4 * 4)</span></div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> <span class="comment">//</span></div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> <span class="comment">// In numpy:</span></div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> <span class="comment">// x_perm = x[g_q]</span></div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> <span class="comment">// y = np.fft.fft(x_perm) * b_q</span></div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> <span class="comment">// z = np.fft.ifft(y) + x[0]</span></div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> <span class="comment">// out = z[g_minus_q]</span></div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> <span class="comment">// out[0] = x[1:].sum()</span></div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> <span class="comment">//</span></div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> <span class="comment">// Where the g_q and g_minus_q are permutations formed</span></div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> <span class="comment">// by the group under multiplicative modulo N using the</span></div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> <span class="comment">// primitive root of N and b_q is a constant.</span></div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <span class="comment">// See https://en.wikipedia.org/wiki/Rader%27s_FFT_algorithm</span></div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> <span class="comment">//</span></div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> <span class="comment">// Rader&#39;s uses fewer operations than Bluestein&#39;s and so</span></div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> <span class="comment">// is more accurate. It&#39;s also faster in most cases.</span></div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> threadgroup float2 shared_in[tg_mem_size];</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> </div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> thread <a class="code hl_struct" href="struct_read_writer.html">ReadWriter&lt;in_T, out_T&gt;</a> read_writer = <a class="code hl_struct" href="struct_read_writer.html">ReadWriter&lt;in_T, out_T&gt;</a>(</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> in,</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> &amp;shared_in[0],</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> out,</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> n,</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> batch_size,</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a>,</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> elem,</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> grid,</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a23a773ae455da5d0b9b5508ee2e7694b">inv_</a>);</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> </div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> <span class="keywordflow">if</span> (read_writer.out_of_bounds()) {</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> };</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> read_writer.load();</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> </div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> threadgroup_barrier(mem_flags::mem_threadgroup);</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> </div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> <span class="comment">// The number of the threads we&#39;re using for each DFT</span></div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> <span class="keywordtype">int</span> m = grid.z;</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> </div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> <span class="keywordtype">int</span> fft_idx = elem.z;</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> <span class="keywordtype">int</span> tg_idx = elem.y * n;</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> threadgroup float2* <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a> = &amp;shared_in[tg_idx];</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> </div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> <span class="comment">// rader_m = n / rader_n;</span></div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> <span class="keywordtype">int</span> rader_m = <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a5d03e78eedb9a084645f8f63185bcf2f">rader_m_</a>;</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> </div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> <span class="comment">// We have to load two x_0s for each thread since sometimes</span></div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> <span class="comment">// elems_per_thread_ crosses a boundary.</span></div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> <span class="comment">// E.g. with n = 34, rader_n = 17, elems_per_thread_ = 4</span></div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> <span class="comment">// 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7 8 8</span></div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> <span class="comment">// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</span></div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> <span class="keywordtype">short</span> x_0_index =</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> <a class="code hl_function" href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a>(fft_idx * <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a> / (rader_n - 1), rader_m - 1);</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> float2 x_0[2] = {<a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[x_0_index], <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[x_0_index + 1]};</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> </div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> <span class="comment">// Do the Rader permutation in shared memory</span></div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> float2 temp[<a class="code hl_define" href="backend_2metal_2kernels_2fft_8h.html#a7b6e56afa21f022c5e754b000955735a">MAX_RADIX</a>];</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> <span class="keywordtype">int</span> max_index = n - rader_m - 1;</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> e = 0; e &lt; <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a>; e++) {</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> <span class="keywordtype">short</span> index = <a class="code hl_function" href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a>(fft_idx * <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a> + e, max_index);</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> <span class="keywordtype">short</span> g_q = raders_g_q[index / rader_m];</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> temp[e] = <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[rader_m + (g_q - 1) * rader_m + index % rader_m];</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> }</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> </div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> threadgroup_barrier(mem_flags::mem_threadgroup);</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> </div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> e = 0; e &lt; <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a>; e++) {</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> <span class="keywordtype">short</span> index = <a class="code hl_function" href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a>(fft_idx * <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a> + e, max_index);</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[index + rader_m] = temp[e];</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> }</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> </div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> threadgroup_barrier(mem_flags::mem_threadgroup);</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> </div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> <span class="comment">// Rader FFT on x[rader_m:]</span></div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> <span class="keywordtype">int</span> p = 1;</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#a050ead8fa5cacdaec13d68ca3c0dcb81">perform_fft</a>&lt;<span class="comment">/*rader=*/</span><span class="keyword">true</span>&gt;(fft_idx, &amp;p, m, n - rader_m, <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a> + rader_m);</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> </div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> <span class="comment">// x_1 + ... + x_n is computed for us in the first FFT step so</span></div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> <span class="comment">// we save it in the first rader_m indices of the array for later.</span></div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> <span class="keywordtype">int</span> x_sum_index = <a class="code hl_function" href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a>(fft_idx, rader_m - 1);</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span> <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[x_sum_index] = <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[rader_m + x_sum_index * (rader_n - 1)];</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span> </div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> float2 inv = {1.0f, -1.0f};</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> e = 0; e &lt; <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a>; e++) {</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> <span class="keywordtype">short</span> index = <a class="code hl_function" href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a>(fft_idx * <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a> + e, max_index);</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> <span class="keywordtype">short</span> interleaved_index =</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> index / rader_m + (index % rader_m) * (rader_n - 1);</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> temp[e] = <a class="code hl_function" href="radix_8h.html#a5bfc53b531214c9ce277bebc18aa67d6">complex_mul</a>(</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[rader_m + interleaved_index],</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> raders_b_q[interleaved_index % (rader_n - 1)]);</div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span> }</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> </div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> threadgroup_barrier(mem_flags::mem_threadgroup);</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</span> </div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> e = 0; e &lt; <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a>; e++) {</div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span> <span class="keywordtype">short</span> index = <a class="code hl_function" href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a>(fft_idx * <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a> + e, max_index);</div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"> 333</span> <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[rader_m + index] = temp[e] * inv;</div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span> }</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> </div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span> threadgroup_barrier(mem_flags::mem_threadgroup);</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> </div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> <span class="comment">// Rader IFFT on x[rader_m:]</span></div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> p = 1;</div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#a050ead8fa5cacdaec13d68ca3c0dcb81">perform_fft</a>&lt;<span class="comment">/*rader=*/</span><span class="keyword">true</span>&gt;(fft_idx, &amp;p, m, n - rader_m, <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a> + rader_m);</div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span> </div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span> float2 rader_inv_factor = {1.0f / (rader_n - 1), -1.0f / (rader_n - 1)};</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> </div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> e = 0; e &lt; <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a>; e++) {</div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span> <span class="keywordtype">short</span> index = <a class="code hl_function" href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a>(fft_idx * <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a> + e, n - rader_m - 1);</div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</span> <span class="keywordtype">short</span> diff_index = index / (rader_n - 1) - x_0_index;</div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno"> 347</span> temp[e] = <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[rader_m + index] * rader_inv_factor + x_0[diff_index];</div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno"> 348</span> }</div>
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno"> 349</span> </div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno"> 350</span> <span class="comment">// Use the sum of elements that was computed in the first FFT</span></div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"> 351</span> float2 x_sum = <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[x_0_index] + x_0[0];</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"> 352</span> </div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span> threadgroup_barrier(mem_flags::mem_threadgroup);</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"> 354</span> </div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> e = 0; e &lt; <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a>; e++) {</div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"> 356</span> <span class="keywordtype">short</span> index = <a class="code hl_function" href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a>(fft_idx * <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a> + e, max_index);</div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span> <span class="keywordtype">short</span> g_q_index = index % (rader_n - 1);</div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</span> <span class="keywordtype">short</span> g_q = raders_g_minus_q[g_q_index];</div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"> 359</span> <span class="keywordtype">short</span> out_index = index - g_q_index + g_q + (index / (rader_n - 1));</div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"> 360</span> <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[out_index] = temp[e];</div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno"> 361</span> }</div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"> 362</span> </div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno"> 363</span> <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[x_0_index * rader_n] = x_sum;</div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno"> 364</span> </div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno"> 365</span> threadgroup_barrier(mem_flags::mem_threadgroup);</div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno"> 366</span> </div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno"> 367</span> p = rader_n;</div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno"> 368</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#a050ead8fa5cacdaec13d68ca3c0dcb81">perform_fft</a>(fft_idx, &amp;p, m, n, <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno"> 369</span> </div>
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno"> 370</span> read_writer.write();</div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno"> 371</span>}</div>
</div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno"> 372</span> </div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno"> 373</span><span class="keyword">template</span> &lt;<span class="keywordtype">int</span> tg_mem_size, <span class="keyword">typename</span> in_T, <span class="keyword">typename</span> out_T&gt;</div>
<div class="foldopen" id="foldopen00374" data-start="{" data-end="}">
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a0abc609e9756475800e996775a96a87e"> 374</a></span>[[kernel]] <span class="keywordtype">void</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#a0abc609e9756475800e996775a96a87e">bluestein_fft</a>(</div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno"> 375</span> <span class="keyword">const</span> device in_T* in [[buffer(0)]],</div>
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno"> 376</span> device out_T* out [[buffer(1)]],</div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"> 377</span> <span class="keyword">const</span> device float2* w_q [[buffer(2)]],</div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span> <span class="keyword">const</span> device float2* w_k [[buffer(3)]],</div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno"> 379</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; length,</div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno"> 380</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; n,</div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"> 381</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; batch_size,</div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno"> 382</span> uint3 elem [[thread_position_in_grid]],</div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno"> 383</span> uint3 grid [[threads_per_grid]]) {</div>
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno"> 384</span> <span class="comment">// Computes arbitrary length FFTs with Bluestein&#39;s algorithm</span></div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno"> 385</span> <span class="comment">//</span></div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno"> 386</span> <span class="comment">// In numpy:</span></div>
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno"> 387</span> <span class="comment">// bluestein_n = next_power_of_2(2*n - 1)</span></div>
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno"> 388</span> <span class="comment">// out = w_k * np.fft.ifft(np.fft.fft(w_k * in, bluestein_n) * w_q)</span></div>
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno"> 389</span> <span class="comment">//</span></div>
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno"> 390</span> <span class="comment">// Where w_k and w_q are precomputed on CPU in high precision as:</span></div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"> 391</span> <span class="comment">// w_k = np.exp(-1j * np.pi / n * (np.arange(-n + 1, n) ** 2))</span></div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno"> 392</span> <span class="comment">// w_q = np.fft.fft(1/w_k[-n:])</span></div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> threadgroup float2 shared_in[tg_mem_size];</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</span> </div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno"> 395</span> thread <a class="code hl_struct" href="struct_read_writer.html">ReadWriter&lt;in_T, out_T&gt;</a> read_writer = <a class="code hl_struct" href="struct_read_writer.html">ReadWriter&lt;in_T, out_T&gt;</a>(</div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno"> 396</span> in,</div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno"> 397</span> &amp;shared_in[0],</div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno"> 398</span> out,</div>
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno"> 399</span> n,</div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno"> 400</span> batch_size,</div>
<div class="line"><a id="l00401" name="l00401"></a><span class="lineno"> 401</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a>,</div>
<div class="line"><a id="l00402" name="l00402"></a><span class="lineno"> 402</span> elem,</div>
<div class="line"><a id="l00403" name="l00403"></a><span class="lineno"> 403</span> grid,</div>
<div class="line"><a id="l00404" name="l00404"></a><span class="lineno"> 404</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a23a773ae455da5d0b9b5508ee2e7694b">inv_</a>);</div>
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno"> 405</span> </div>
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno"> 406</span> <span class="keywordflow">if</span> (read_writer.out_of_bounds()) {</div>
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno"> 407</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno"> 408</span> };</div>
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno"> 409</span> read_writer.load_padded(length, w_k);</div>
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno"> 410</span> </div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno"> 411</span> threadgroup_barrier(mem_flags::mem_threadgroup);</div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno"> 412</span> </div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno"> 413</span> <span class="keywordtype">int</span> p = 1;</div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"> 414</span> <span class="keywordtype">int</span> fft_idx = elem.z; <span class="comment">// Thread index in DFT</span></div>
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> <span class="keywordtype">int</span> m = grid.z; <span class="comment">// Threads per DFT</span></div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno"> 416</span> <span class="keywordtype">int</span> tg_idx = elem.y * n; <span class="comment">// Index of this DFT in threadgroup</span></div>
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno"> 417</span> threadgroup float2* <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a> = &amp;shared_in[tg_idx];</div>
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno"> 418</span> </div>
<div class="line"><a id="l00419" name="l00419"></a><span class="lineno"> 419</span> <span class="comment">// fft</span></div>
<div class="line"><a id="l00420" name="l00420"></a><span class="lineno"> 420</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#a050ead8fa5cacdaec13d68ca3c0dcb81">perform_fft</a>(fft_idx, &amp;p, m, n, <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno"> 421</span> </div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno"> 422</span> float2 inv = float2(1.0f, -1.0f);</div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno"> 423</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> t = 0; t &lt; <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a>; t++) {</div>
<div class="line"><a id="l00424" name="l00424"></a><span class="lineno"> 424</span> <span class="keywordtype">int</span> index = fft_idx + t * m;</div>
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno"> 425</span> <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[index] = <a class="code hl_function" href="radix_8h.html#a5bfc53b531214c9ce277bebc18aa67d6">complex_mul</a>(<a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>[index], w_q[index]) * inv;</div>
<div class="line"><a id="l00426" name="l00426"></a><span class="lineno"> 426</span> }</div>
<div class="line"><a id="l00427" name="l00427"></a><span class="lineno"> 427</span> </div>
<div class="line"><a id="l00428" name="l00428"></a><span class="lineno"> 428</span> threadgroup_barrier(mem_flags::mem_threadgroup);</div>
<div class="line"><a id="l00429" name="l00429"></a><span class="lineno"> 429</span> </div>
<div class="line"><a id="l00430" name="l00430"></a><span class="lineno"> 430</span> <span class="comment">// ifft</span></div>
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno"> 431</span> p = 1;</div>
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno"> 432</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#a050ead8fa5cacdaec13d68ca3c0dcb81">perform_fft</a>(fft_idx, &amp;p, m, n, <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno"> 433</span> </div>
<div class="line"><a id="l00434" name="l00434"></a><span class="lineno"> 434</span> read_writer.write_padded(length, w_k);</div>
<div class="line"><a id="l00435" name="l00435"></a><span class="lineno"> 435</span>}</div>
</div>
<div class="line"><a id="l00436" name="l00436"></a><span class="lineno"> 436</span> </div>
<div class="line"><a id="l00437" name="l00437"></a><span class="lineno"> 437</span><span class="keyword">template</span> &lt;</div>
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno"> 438</span> <span class="keywordtype">int</span> tg_mem_size,</div>
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno"> 439</span> <span class="keyword">typename</span> in_T,</div>
<div class="line"><a id="l00440" name="l00440"></a><span class="lineno"> 440</span> <span class="keyword">typename</span> out_T,</div>
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno"> 441</span> <span class="keywordtype">int</span> step,</div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"> 442</span> <span class="keywordtype">bool</span> real = <span class="keyword">false</span>&gt;</div>
<div class="foldopen" id="foldopen00443" data-start="{" data-end="}">
<div class="line"><a id="l00443" name="l00443"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2fft_8h.html#a6558a8205ee4c3e4767bafa93f7606de"> 443</a></span>[[kernel]] <span class="keywordtype">void</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#a6558a8205ee4c3e4767bafa93f7606de">four_step_fft</a>(</div>
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno"> 444</span> <span class="keyword">const</span> device in_T* in [[buffer(0)]],</div>
<div class="line"><a id="l00445" name="l00445"></a><span class="lineno"> 445</span> device out_T* out [[buffer(1)]],</div>
<div class="line"><a id="l00446" name="l00446"></a><span class="lineno"> 446</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; n1,</div>
<div class="line"><a id="l00447" name="l00447"></a><span class="lineno"> 447</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; n2,</div>
<div class="line"><a id="l00448" name="l00448"></a><span class="lineno"> 448</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>&amp; batch_size,</div>
<div class="line"><a id="l00449" name="l00449"></a><span class="lineno"> 449</span> uint3 elem [[thread_position_in_grid]],</div>
<div class="line"><a id="l00450" name="l00450"></a><span class="lineno"> 450</span> uint3 grid [[threads_per_grid]]) {</div>
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno"> 451</span> <span class="comment">// Fast four step FFT implementation for powers of 2.</span></div>
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno"> 452</span> <span class="keywordtype">int</span> overall_n = n1 * n2;</div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno"> 453</span> <span class="keywordtype">int</span> n = step == 0 ? n1 : n2;</div>
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno"> 454</span> <span class="keywordtype">int</span> stride = step == 0 ? n2 : n1;</div>
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno"> 455</span> </div>
<div class="line"><a id="l00456" name="l00456"></a><span class="lineno"> 456</span> <span class="comment">// The number of the threads we&#39;re using for each DFT</span></div>
<div class="line"><a id="l00457" name="l00457"></a><span class="lineno"> 457</span> <span class="keywordtype">int</span> m = grid.z;</div>
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno"> 458</span> <span class="keywordtype">int</span> fft_idx = elem.z;</div>
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno"> 459</span> </div>
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno"> 460</span> threadgroup float2 shared_in[tg_mem_size];</div>
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno"> 461</span> threadgroup float2* <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a> = &amp;shared_in[elem.y * n];</div>
<div class="line"><a id="l00462" name="l00462"></a><span class="lineno"> 462</span> </div>
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno"> 463</span> <span class="keyword">using </span>read_writer_t = <a class="code hl_struct" href="struct_read_writer.html">ReadWriter&lt;in_T, out_T, step, real&gt;</a>;</div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno"> 464</span> read_writer_t read_writer = read_writer_t(</div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno"> 465</span> in,</div>
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno"> 466</span> &amp;shared_in[0],</div>
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno"> 467</span> out,</div>
<div class="line"><a id="l00468" name="l00468"></a><span class="lineno"> 468</span> n,</div>
<div class="line"><a id="l00469" name="l00469"></a><span class="lineno"> 469</span> batch_size,</div>
<div class="line"><a id="l00470" name="l00470"></a><span class="lineno"> 470</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a>,</div>
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno"> 471</span> elem,</div>
<div class="line"><a id="l00472" name="l00472"></a><span class="lineno"> 472</span> grid,</div>
<div class="line"><a id="l00473" name="l00473"></a><span class="lineno"> 473</span> <a class="code hl_variable" href="backend_2metal_2kernels_2fft_8h.html#a23a773ae455da5d0b9b5508ee2e7694b">inv_</a>);</div>
<div class="line"><a id="l00474" name="l00474"></a><span class="lineno"> 474</span> </div>
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno"> 475</span> <span class="keywordflow">if</span> (read_writer.out_of_bounds()) {</div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno"> 476</span> <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno"> 477</span> };</div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"> 478</span> read_writer.load_strided(stride, overall_n);</div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno"> 479</span> </div>
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno"> 480</span> threadgroup_barrier(mem_flags::mem_threadgroup);</div>
<div class="line"><a id="l00481" name="l00481"></a><span class="lineno"> 481</span> </div>
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno"> 482</span> <span class="keywordtype">int</span> p = 1;</div>
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno"> 483</span> <a class="code hl_function" href="backend_2metal_2kernels_2fft_8h.html#a050ead8fa5cacdaec13d68ca3c0dcb81">perform_fft</a>(fft_idx, &amp;p, m, n, <a class="code hl_variable" href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a>);</div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno"> 484</span> </div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno"> 485</span> read_writer.write_strided(stride, overall_n);</div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno"> 486</span>}</div>
</div>
<div class="ttc" id="abackend_2metal_2allocator_8h_html_a15aa5cc1baf29be08d55cca88509e697"><div class="ttname"><a href="backend_2metal_2allocator_8h.html#a15aa5cc1baf29be08d55cca88509e697">buf</a></div><div class="ttdeci">MTL::Buffer * buf</div><div class="ttdef"><b>Definition</b> allocator.h:38</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a02e428463b66a6e0f059bf8fc4f3a073"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a02e428463b66a6e0f059bf8fc4f3a073">radix_7_steps_</a></div><div class="ttdeci">STEEL_CONST int radix_7_steps_</div><div class="ttdef"><b>Definition</b> fft.h:32</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a050ead8fa5cacdaec13d68ca3c0dcb81"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a050ead8fa5cacdaec13d68ca3c0dcb81">perform_fft</a></div><div class="ttdeci">METAL_FUNC void perform_fft(int fft_idx, thread int *p, int m, int n, threadgroup float2 *buf)</div><div class="ttdef"><b>Definition</b> fft.h:159</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a0abc609e9756475800e996775a96a87e"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a0abc609e9756475800e996775a96a87e">bluestein_fft</a></div><div class="ttdeci">void bluestein_fft(const device in_T *in, device out_T *out, const device float2 *w_q, const device float2 *w_k, constant const int &amp;length, constant const int &amp;n, constant const int &amp;batch_size, uint3 elem, uint3 grid)</div><div class="ttdef"><b>Definition</b> fft.h:374</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a23a773ae455da5d0b9b5508ee2e7694b"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a23a773ae455da5d0b9b5508ee2e7694b">inv_</a></div><div class="ttdeci">STEEL_CONST bool inv_</div><div class="ttdef"><b>Definition</b> fft.h:23</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a278d980ed397e6841ce0af44b9aa4396"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a278d980ed397e6841ce0af44b9aa4396">radix_butterfly</a></div><div class="ttdeci">METAL_FUNC void radix_butterfly(int i, int p, thread float2 *x, thread short *indices, thread float2 *y)</div><div class="ttdef"><b>Definition</b> fft.h:54</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a28d683cf067736d76f867f30c066317e"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a28d683cf067736d76f867f30c066317e">MAX_OUTPUT_SIZE</a></div><div class="ttdeci">#define MAX_OUTPUT_SIZE</div><div class="ttdef"><b>Definition</b> fft.h:20</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a4010b0e151e5f01e610e9c32234458c7"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a4010b0e151e5f01e610e9c32234458c7">fft</a></div><div class="ttdeci">void fft(const device in_T *in, device out_T *out, constant const int &amp;n, constant const int &amp;batch_size, uint3 elem, uint3 grid)</div><div class="ttdef"><b>Definition</b> fft.h:180</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a40c698855591f5d73b0d9258049571a2"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a40c698855591f5d73b0d9258049571a2">radix_13_steps_</a></div><div class="ttdeci">STEEL_CONST int radix_13_steps_</div><div class="ttdef"><b>Definition</b> fft.h:29</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a5d03e78eedb9a084645f8f63185bcf2f"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a5d03e78eedb9a084645f8f63185bcf2f">rader_m_</a></div><div class="ttdeci">STEEL_CONST int rader_m_</div><div class="ttdef"><b>Definition</b> fft.h:27</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a6558a8205ee4c3e4767bafa93f7606de"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a6558a8205ee4c3e4767bafa93f7606de">four_step_fft</a></div><div class="ttdeci">void four_step_fft(const device in_T *in, device out_T *out, constant const int &amp;n1, constant const int &amp;n2, constant const int &amp;batch_size, uint3 elem, uint3 grid)</div><div class="ttdef"><b>Definition</b> fft.h:443</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a6ba62eabfd5428644aabf89ddaa0128d"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a6ba62eabfd5428644aabf89ddaa0128d">RadixFunc</a></div><div class="ttdeci">void(* RadixFunc)(thread float2 *, thread float2 *)</div><div class="ttdef"><b>Definition</b> fft.h:50</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a6faebd7ba948a4b572b7933f6d3b8646"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a6faebd7ba948a4b572b7933f6d3b8646">rader_2_steps_</a></div><div class="ttdeci">STEEL_CONST int rader_2_steps_</div><div class="ttdef"><b>Definition</b> fft.h:47</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a794032d3a9acff0e31c77c69d0007f10"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a794032d3a9acff0e31c77c69d0007f10">RADIX_STEP</a></div><div class="ttdeci">#define RADIX_STEP(radix, radix_func, num_steps)</div><div class="ttdef"><b>Definition</b> fft.h:153</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a7b23fe1ca5b7f650cc3e8b03efc55434"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a7b23fe1ca5b7f650cc3e8b03efc55434">radix_3_steps_</a></div><div class="ttdeci">STEEL_CONST int radix_3_steps_</div><div class="ttdef"><b>Definition</b> fft.h:36</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a7b6e56afa21f022c5e754b000955735a"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a7b6e56afa21f022c5e754b000955735a">MAX_RADIX</a></div><div class="ttdeci">#define MAX_RADIX</div><div class="ttdef"><b>Definition</b> fft.h:17</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a7cea841e54e678c583aeb369ea7bf573"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a7cea841e54e678c583aeb369ea7bf573">radix_5_steps_</a></div><div class="ttdeci">STEEL_CONST int radix_5_steps_</div><div class="ttdef"><b>Definition</b> fft.h:34</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a7fe88d81170dc4e2e8993c58b887dce6"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a7fe88d81170dc4e2e8993c58b887dce6">rader_13_steps_</a></div><div class="ttdeci">STEEL_CONST int rader_13_steps_</div><div class="ttdef"><b>Definition</b> fft.h:39</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a92d77e600661bb6f4a7779b6529733b7"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a92d77e600661bb6f4a7779b6529733b7">radix_6_steps_</a></div><div class="ttdeci">STEEL_CONST int radix_6_steps_</div><div class="ttdef"><b>Definition</b> fft.h:33</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a97d2f30278a31635497d7c6c3443206a"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a97d2f30278a31635497d7c6c3443206a">rader_6_steps_</a></div><div class="ttdeci">STEEL_CONST int rader_6_steps_</div><div class="ttdef"><b>Definition</b> fft.h:43</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_a9946b98d3350cb1b3c08ad4f7b67f880"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#a9946b98d3350cb1b3c08ad4f7b67f880">rader_7_steps_</a></div><div class="ttdeci">STEEL_CONST int rader_7_steps_</div><div class="ttdef"><b>Definition</b> fft.h:42</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_aab5dd8c9141fbee09048ba6837ab8aae"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#aab5dd8c9141fbee09048ba6837ab8aae">rader_3_steps_</a></div><div class="ttdeci">STEEL_CONST int rader_3_steps_</div><div class="ttdef"><b>Definition</b> fft.h:46</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_aadbf4b8812c1489e78ea7d1184a0fdd9"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#aadbf4b8812c1489e78ea7d1184a0fdd9">radix_8_steps_</a></div><div class="ttdeci">STEEL_CONST int radix_8_steps_</div><div class="ttdef"><b>Definition</b> fft.h:31</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_aba8d32e0911499671df93678f39da08b"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#aba8d32e0911499671df93678f39da08b">radix_n_steps</a></div><div class="ttdeci">METAL_FUNC void radix_n_steps(int i, thread int *p, int m, int n, int num_steps, thread float2 *inputs, thread short *indices, thread float2 *values, threadgroup float2 *buf)</div><div class="ttdef"><b>Definition</b> fft.h:100</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_abeb0f8d030ee27c89882b87eed13be2d"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#abeb0f8d030ee27c89882b87eed13be2d">is_power_of_2_</a></div><div class="ttdeci">STEEL_CONST bool is_power_of_2_</div><div class="ttdef"><b>Definition</b> fft.h:24</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_acf9b1130c134093453d15eee02683c94"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#acf9b1130c134093453d15eee02683c94">elems_per_thread_</a></div><div class="ttdeci">STEEL_CONST int elems_per_thread_</div><div class="ttdef"><b>Definition</b> fft.h:25</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_ad123452303f6415904f3592f660769b8"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#ad123452303f6415904f3592f660769b8">rader_fft</a></div><div class="ttdeci">void rader_fft(const device in_T *in, device out_T *out, const device float2 *raders_b_q, const device short *raders_g_q, const device short *raders_g_minus_q, constant const int &amp;n, constant const int &amp;batch_size, constant const int &amp;rader_n, uint3 elem, uint3 grid)</div><div class="ttdef"><b>Definition</b> fft.h:219</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_ad28408cc4ff0a4f820afd1aa18ca9646"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#ad28408cc4ff0a4f820afd1aa18ca9646">radix_4_steps_</a></div><div class="ttdeci">STEEL_CONST int radix_4_steps_</div><div class="ttdef"><b>Definition</b> fft.h:35</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_ad64f06afe2ff8ada7449556e1c41b39a"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#ad64f06afe2ff8ada7449556e1c41b39a">rader_5_steps_</a></div><div class="ttdeci">STEEL_CONST int rader_5_steps_</div><div class="ttdef"><b>Definition</b> fft.h:44</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_adb9b3944eb792a4f518b5e151a3e1591"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#adb9b3944eb792a4f518b5e151a3e1591">rader_8_steps_</a></div><div class="ttdeci">STEEL_CONST int rader_8_steps_</div><div class="ttdef"><b>Definition</b> fft.h:41</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_add993232d88c3203960852a6de6a03c3"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#add993232d88c3203960852a6de6a03c3">rader_4_steps_</a></div><div class="ttdeci">STEEL_CONST int rader_4_steps_</div><div class="ttdef"><b>Definition</b> fft.h:45</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_ae1538cb224d84bfedf6655f8ea05aac8"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#ae1538cb224d84bfedf6655f8ea05aac8">rader_11_steps_</a></div><div class="ttdeci">STEEL_CONST int rader_11_steps_</div><div class="ttdef"><b>Definition</b> fft.h:40</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_ae76b69e0b030b8cf1ee7ca9011f3e504"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#ae76b69e0b030b8cf1ee7ca9011f3e504">radix_2_steps_</a></div><div class="ttdeci">STEEL_CONST int radix_2_steps_</div><div class="ttdef"><b>Definition</b> fft.h:37</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2fft_8h_html_af17a5682878a88283d995f2ca37681e4"><div class="ttname"><a href="backend_2metal_2kernels_2fft_8h.html#af17a5682878a88283d995f2ca37681e4">radix_11_steps_</a></div><div class="ttdeci">STEEL_CONST int radix_11_steps_</div><div class="ttdef"><b>Definition</b> fft.h:30</div></div>
<div class="ttc" id="anamespacemetal_html"><div class="ttname"><a href="namespacemetal.html">metal</a></div><div class="ttdef"><b>Definition</b> bf16.h:265</div></div>
<div class="ttc" id="anamespacemetal_html_a6653b28c9473087141eddce39878d4d3"><div class="ttname"><a href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a></div><div class="ttdeci">METAL_FUNC bfloat16_t min(bfloat16_t x, bfloat16_t y)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="aradix_8h_html"><div class="ttname"><a href="radix_8h.html">radix.h</a></div></div>
<div class="ttc" id="aradix_8h_html_a026e6779e6d2ecdef39ff4aad186091e"><div class="ttname"><a href="radix_8h.html#a026e6779e6d2ecdef39ff4aad186091e">radix5</a></div><div class="ttdeci">METAL_FUNC void radix5(thread float2 *x, thread float2 *y)</div><div class="ttdef"><b>Definition</b> radix.h:69</div></div>
<div class="ttc" id="aradix_8h_html_a12cb26bd3ad635d16a195ccea750256d"><div class="ttname"><a href="radix_8h.html#a12cb26bd3ad635d16a195ccea750256d">radix4</a></div><div class="ttdeci">METAL_FUNC void radix4(thread float2 *x, thread float2 *y)</div><div class="ttdef"><b>Definition</b> radix.h:56</div></div>
<div class="ttc" id="aradix_8h_html_a34f7dcefd29f8a7f6bddf9a17609a8a7"><div class="ttname"><a href="radix_8h.html#a34f7dcefd29f8a7f6bddf9a17609a8a7">radix11</a></div><div class="ttdeci">METAL_FUNC void radix11(thread float2 *x, thread float2 *y)</div><div class="ttdef"><b>Definition</b> radix.h:201</div></div>
<div class="ttc" id="aradix_8h_html_a497b31cfa28418e1c2fad53d09f7bc0b"><div class="ttname"><a href="radix_8h.html#a497b31cfa28418e1c2fad53d09f7bc0b">radix3</a></div><div class="ttdeci">METAL_FUNC void radix3(thread float2 *x, thread float2 *y)</div><div class="ttdef"><b>Definition</b> radix.h:41</div></div>
<div class="ttc" id="aradix_8h_html_a5bfc53b531214c9ce277bebc18aa67d6"><div class="ttname"><a href="radix_8h.html#a5bfc53b531214c9ce277bebc18aa67d6">complex_mul</a></div><div class="ttdeci">METAL_FUNC float2 complex_mul(float2 a, float2 b)</div><div class="ttdef"><b>Definition</b> radix.h:19</div></div>
<div class="ttc" id="aradix_8h_html_a6b306e1afe1c5b6af4cd80aa02adb138"><div class="ttname"><a href="radix_8h.html#a6b306e1afe1c5b6af4cd80aa02adb138">radix8</a></div><div class="ttdeci">METAL_FUNC void radix8(thread float2 *x, thread float2 *y)</div><div class="ttdef"><b>Definition</b> radix.h:151</div></div>
<div class="ttc" id="aradix_8h_html_a6d37e483d806c550deefabf56caf4ec8"><div class="ttname"><a href="radix_8h.html#a6d37e483d806c550deefabf56caf4ec8">radix7</a></div><div class="ttdeci">METAL_FUNC void radix7(thread float2 *x, thread float2 *y)</div><div class="ttdef"><b>Definition</b> radix.h:122</div></div>
<div class="ttc" id="aradix_8h_html_a745e50244f1470bba233d8b6b993729c"><div class="ttname"><a href="radix_8h.html#a745e50244f1470bba233d8b6b993729c">radix2</a></div><div class="ttdeci">METAL_FUNC void radix2(thread float2 *x, thread float2 *y)</div><div class="ttdef"><b>Definition</b> radix.h:36</div></div>
<div class="ttc" id="aradix_8h_html_a833b7b31facbd62f6971bb108c54d1db"><div class="ttname"><a href="radix_8h.html#a833b7b31facbd62f6971bb108c54d1db">radix13</a></div><div class="ttdeci">METAL_FUNC void radix13(thread float2 *x, thread float2 *y)</div><div class="ttdef"><b>Definition</b> radix.h:290</div></div>
<div class="ttc" id="aradix_8h_html_ac5cf950316b9445296ee9ecfc56a56bd"><div class="ttname"><a href="radix_8h.html#ac5cf950316b9445296ee9ecfc56a56bd">get_twiddle</a></div><div class="ttdeci">METAL_FUNC float2 get_twiddle(int k, int p)</div><div class="ttdef"><b>Definition</b> radix.h:29</div></div>
<div class="ttc" id="aradix_8h_html_afaaa5de58a97f0a5e6a84fc0d598a884"><div class="ttname"><a href="radix_8h.html#afaaa5de58a97f0a5e6a84fc0d598a884">radix6</a></div><div class="ttdeci">METAL_FUNC void radix6(thread float2 *x, thread float2 *y)</div><div class="ttdef"><b>Definition</b> radix.h:96</div></div>
<div class="ttc" id="areadwrite_8h_html"><div class="ttname"><a href="readwrite_8h.html">readwrite.h</a></div></div>
<div class="ttc" id="asteel_2defines_8h_html"><div class="ttname"><a href="steel_2defines_8h.html">defines.h</a></div></div>
<div class="ttc" id="asteel_2defines_8h_html_a5a5c3095b132a7589bc19cd5cb80e2c6"><div class="ttname"><a href="steel_2defines_8h.html#a5a5c3095b132a7589bc19cd5cb80e2c6">STEEL_PRAGMA_UNROLL</a></div><div class="ttdeci">#define STEEL_PRAGMA_UNROLL</div><div class="ttdef"><b>Definition</b> defines.h:4</div></div>
<div class="ttc" id="asteel_2defines_8h_html_a90b91c866313ffa46eff6d9cc944ad2b"><div class="ttname"><a href="steel_2defines_8h.html#a90b91c866313ffa46eff6d9cc944ad2b">STEEL_CONST</a></div><div class="ttdeci">#define STEEL_CONST</div><div class="ttdef"><b>Definition</b> defines.h:3</div></div>
<div class="ttc" id="astruct_read_writer_html"><div class="ttname"><a href="struct_read_writer.html">ReadWriter</a></div><div class="ttdef"><b>Definition</b> readwrite.h:35</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,142 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/reduction/ops.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li><li class="navelem"><a class="el" href="dir_f60cd69d27fd3faa641c79056fff0e2d.html">reduction</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#var-members">Variables</a> </div>
<div class="headertitle"><div class="title">ops.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;metal_atomic&gt;</code><br />
<code>#include &lt;metal_simdgroup&gt;</code><br />
</div>
<p><a href="backend_2metal_2kernels_2reduction_2ops_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">union &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="unionbool4__or__uint.html">bool4_or_uint</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_none.html">None</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_and.html">And&lt; U &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_or.html">Or&lt; U &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sum.html">Sum&lt; U &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_prod.html">Prod&lt; U &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_min.html">Min&lt; U &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_max.html">Max&lt; U &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a515b75d563a93d3c09ee677948dc83e3" id="r_a515b75d563a93d3c09ee677948dc83e3"><td class="memItemLeft" align="right" valign="top">static constant constexpr const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a515b75d563a93d3c09ee677948dc83e3">simd_size</a> = 32</td></tr>
<tr class="separator:a515b75d563a93d3c09ee677948dc83e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a515b75d563a93d3c09ee677948dc83e3" name="a515b75d563a93d3c09ee677948dc83e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a515b75d563a93d3c09ee677948dc83e3">&#9670;&#160;</a></span>simd_size</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">constant constexpr const uint8_t simd_size = 32</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,379 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/reduction/ops.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li><li class="navelem"><a class="el" href="dir_f60cd69d27fd3faa641c79056fff0e2d.html">reduction</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">ops.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2metal_2kernels_2reduction_2ops_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023-2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;metal_atomic&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;metal_simdgroup&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"><a class="line" href="backend_2metal_2kernels_2reduction_2ops_8h.html#a515b75d563a93d3c09ee677948dc83e3"> 8</a></span><span class="keyword">static</span> constant <span class="keyword">constexpr</span> <span class="keyword">const</span> uint8_t <a class="code hl_variable" href="backend_2metal_2kernels_2reduction_2ops_8h.html#a515b75d563a93d3c09ee677948dc83e3">simd_size</a> = 32;</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
<div class="foldopen" id="foldopen00010" data-start="{" data-end="};">
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"><a class="line" href="unionbool4__or__uint.html"> 10</a></span><span class="keyword">union </span><a class="code hl_union" href="unionbool4__or__uint.html">bool4_or_uint</a> {</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="unionbool4__or__uint.html#a47d77eac47598fe420f8f04a615f76ca"> 11</a></span> bool4 <a class="code hl_variable" href="unionbool4__or__uint.html#a47d77eac47598fe420f8f04a615f76ca">b</a>;</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="unionbool4__or__uint.html#ab24d95aaf4203ddf3e6b1ed19397ced7"> 12</a></span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="unionbool4__or__uint.html#ab24d95aaf4203ddf3e6b1ed19397ced7">i</a>;</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span>};</div>
</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="foldopen" id="foldopen00015" data-start="{" data-end="};">
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="struct_none.html"> 15</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_none.html">None</a> {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</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="struct_none.html#a9d7414f58b3a526758007a4a1da72c74"> 17</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_none.html#a9d7414f58b3a526758007a4a1da72c74">atomic_update</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* out, T val, uint offset = 0) {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <a class="code hl_function" href="atomic_8h.html#a8108e66ef9a5fa8c62e6a7c6504c43aa">mlx_atomic_store_explicit</a>(out, val, offset);</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> }</div>
</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span>};</div>
</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </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 = <span class="keywordtype">bool</span>&gt;</div>
<div class="foldopen" id="foldopen00023" data-start="{" data-end="};">
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="struct_and.html"> 23</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_and.html">And</a> {</div>
<div class="foldopen" id="foldopen00024" data-start="{" data-end="}">
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="struct_and.html#ab4df5517e050cfa7257c34c6b0bd980b"> 24</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_and.html#ab4df5517e050cfa7257c34c6b0bd980b">simd_reduce</a>(<span class="keywordtype">bool</span> val) {</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordflow">return</span> simd_all(val);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> };</div>
</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="struct_and.html#ab55eac58830ae01c45f18377eff021ea"> 28</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">bool</span> <a class="code hl_variable" href="struct_and.html#ab55eac58830ae01c45f18377eff021ea">init</a> = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> </div>
<div class="foldopen" id="foldopen00030" data-start="{" data-end="}">
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="struct_and.html#a9ddf6d3f16dee000a5f0a30af4d43a7f"> 30</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_and.html#a9ddf6d3f16dee000a5f0a30af4d43a7f">atomic_update</a>(</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;unsigned int&gt;</a>* out,</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordtype">bool</span> val,</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordtype">int</span> elem_idx,</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordtype">int</span> offset = 0) {</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordflow">if</span> (!val) {</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <a class="code hl_union" href="unionbool4__or__uint.html">bool4_or_uint</a> <a class="code hl_function" href="struct_and.html#a514334a0fd865164d9c83fc07d499783">update</a>;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <a class="code hl_function" href="struct_and.html#a514334a0fd865164d9c83fc07d499783">update</a>.<a class="code hl_variable" href="unionbool4__or__uint.html#a47d77eac47598fe420f8f04a615f76ca">b</a> = {<span class="keyword">true</span>, <span class="keyword">true</span>, <span class="keyword">true</span>, <span class="keyword">true</span>};</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <a class="code hl_function" href="struct_and.html#a514334a0fd865164d9c83fc07d499783">update</a>.b[elem_idx] = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <a class="code hl_function" href="atomic_8h.html#a65bd5cae890db9b927d853a52bdc06e8">mlx_atomic_fetch_and_explicit</a>(out, <a class="code hl_function" href="struct_and.html#a514334a0fd865164d9c83fc07d499783">update</a>.i, offset);</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> }</div>
</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
<div class="foldopen" id="foldopen00043" data-start="{" data-end="}">
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="struct_and.html#af4a5c9f276d21580c0acaf1ff7064c57"> 43</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_and.html#af4a5c9f276d21580c0acaf1ff7064c57">atomic_update</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;bool&gt;</a>* out, <span class="keywordtype">bool</span> val, uint offset = 0) {</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">if</span> (!val) {</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <a class="code hl_function" href="atomic_8h.html#a8108e66ef9a5fa8c62e6a7c6504c43aa">mlx_atomic_store_explicit</a>(out, val, offset);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> }</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> }</div>
</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="comment">// Non atomic update</span></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="struct_and.html#a514334a0fd865164d9c83fc07d499783"> 50</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_and.html#a514334a0fd865164d9c83fc07d499783">update</a>(device <span class="keywordtype">bool</span>* out, <span class="keywordtype">bool</span> val) {</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> *out &amp;= val;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> }</div>
</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> </div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="comment">// Operator</span></div>
<div class="foldopen" id="foldopen00055" data-start="{" data-end="}">
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="struct_and.html#a52fcfa8e7e83e7be6313eb57c998bf47"> 55</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_and.html#a52fcfa8e7e83e7be6313eb57c998bf47">operator()</a>(<span class="keywordtype">bool</span> a, <span class="keywordtype">bool</span> b) {</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordflow">return</span> a &amp;&amp; b;</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>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> U = <span class="keywordtype">bool</span>&gt;</div>
<div class="foldopen" id="foldopen00061" data-start="{" data-end="};">
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="struct_or.html"> 61</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_or.html">Or</a> {</div>
<div class="foldopen" id="foldopen00062" data-start="{" data-end="}">
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="struct_or.html#aef6b5abbbf3fd22981b8d27562022605"> 62</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_or.html#aef6b5abbbf3fd22981b8d27562022605">simd_reduce</a>(<span class="keywordtype">bool</span> val) {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">return</span> simd_any(val);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> };</div>
</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="struct_or.html#a6734c64e8048a209047fa18dd8bd49e8"> 66</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">bool</span> <a class="code hl_variable" href="struct_or.html#a6734c64e8048a209047fa18dd8bd49e8">init</a> = <span class="keyword">false</span>;</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="struct_or.html#a40840c0506bf4ed9a0771ba42c9ebb0f"> 68</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_or.html#a40840c0506bf4ed9a0771ba42c9ebb0f">atomic_update</a>(</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;unsigned int&gt;</a>* out,</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordtype">bool</span> val,</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> uint elem_idx,</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> uint offset = 0) {</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">if</span> (val) {</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <a class="code hl_union" href="unionbool4__or__uint.html">bool4_or_uint</a> <a class="code hl_function" href="struct_or.html#a942628b1b3c6be9f486c15081a0cba8e">update</a>;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <a class="code hl_function" href="struct_or.html#a942628b1b3c6be9f486c15081a0cba8e">update</a>.<a class="code hl_variable" href="unionbool4__or__uint.html#a47d77eac47598fe420f8f04a615f76ca">b</a> = {<span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>, <span class="keyword">false</span>};</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <a class="code hl_function" href="struct_or.html#a942628b1b3c6be9f486c15081a0cba8e">update</a>.b[elem_idx] = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <a class="code hl_function" href="atomic_8h.html#a995c2d054cc4faa7b86e9a8719ff3e6f">mlx_atomic_fetch_or_explicit</a>(out, <a class="code hl_function" href="struct_or.html#a942628b1b3c6be9f486c15081a0cba8e">update</a>.i, offset);</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> }</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> }</div>
</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> </div>
<div class="foldopen" id="foldopen00081" data-start="{" data-end="}">
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="struct_or.html#aad1e6b5b015cd0910625da725afabdf3"> 81</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_or.html#aad1e6b5b015cd0910625da725afabdf3">atomic_update</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;bool&gt;</a>* out, <span class="keywordtype">bool</span> val, uint offset = 0) {</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">if</span> (val) {</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <a class="code hl_function" href="atomic_8h.html#a8108e66ef9a5fa8c62e6a7c6504c43aa">mlx_atomic_store_explicit</a>(out, val, offset);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> }</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> }</div>
</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> </div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="comment">// Non atomic update</span></div>
<div class="foldopen" id="foldopen00088" data-start="{" data-end="}">
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="struct_or.html#a942628b1b3c6be9f486c15081a0cba8e"> 88</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_or.html#a942628b1b3c6be9f486c15081a0cba8e">update</a>(device <span class="keywordtype">bool</span>* out, <span class="keywordtype">bool</span> val) {</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> *out |= val;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> }</div>
</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="comment">// Operator</span></div>
<div class="foldopen" id="foldopen00093" data-start="{" data-end="}">
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="struct_or.html#a3798a4c73565aee2430459146305e44f"> 93</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_or.html#a3798a4c73565aee2430459146305e44f">operator()</a>(<span class="keywordtype">bool</span> a, <span class="keywordtype">bool</span> b) {</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">return</span> a || b;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> }</div>
</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span>};</div>
</div>
<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><span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt;</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="struct_sum.html"> 99</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_sum.html">Sum</a> {</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00101" data-start="{" data-end="}">
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="struct_sum.html#acf10e0604098391526da3b8271928b5c"> 101</a></span> T <a class="code hl_function" href="struct_sum.html#acf10e0604098391526da3b8271928b5c">simd_reduce</a>(T val) {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">return</span> simd_sum(val);</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> };</div>
</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"><a class="line" href="struct_sum.html#a433bf0fe3ce751c18e5269bbc19daa65"> 105</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant U <a class="code hl_variable" href="struct_sum.html#a433bf0fe3ce751c18e5269bbc19daa65">init</a> = U(0);</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> </div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</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="struct_sum.html#a3188318e74823f00b9367317ec22ad6b"> 108</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_sum.html#a3188318e74823f00b9367317ec22ad6b">atomic_update</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* out, T val, uint offset = 0) {</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <a class="code hl_function" href="atomic_8h.html#a37cbd062017e3d056782dcfa7f5f6add">mlx_atomic_fetch_add_explicit</a>(out, val, offset);</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> </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="comment">// Operator</span></div>
<div class="foldopen" id="foldopen00113" data-start="{" data-end="}">
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"><a class="line" href="struct_sum.html#af9bfdc5603dd2b888d9e1416b70aefcc"> 113</a></span> U <a class="code hl_function" href="struct_sum.html#af9bfdc5603dd2b888d9e1416b70aefcc">operator()</a>(U a, U b) {</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keywordflow">return</span> a + b;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> }</div>
</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span>};</div>
</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> </div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt;</div>
<div class="foldopen" id="foldopen00119" data-start="{" data-end="};">
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"><a class="line" href="struct_prod.html"> 119</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_prod.html">Prod</a> {</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00121" data-start="{" data-end="}">
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"><a class="line" href="struct_prod.html#ab0d7a38360b971b4d99c4ad2db310069"> 121</a></span> T <a class="code hl_function" href="struct_prod.html#ab0d7a38360b971b4d99c4ad2db310069">simd_reduce</a>(T val) {</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">return</span> simd_product(val);</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</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="struct_prod.html#ac99f3882b6c3c0c17d70a82f2f2f2c56"> 125</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant U <a class="code hl_variable" href="struct_prod.html#ac99f3882b6c3c0c17d70a82f2f2f2c56">init</a> = U(1);</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> </div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00128" data-start="{" data-end="}">
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="struct_prod.html#a7ad8c7c18b1c54ff1d158683744a324d"> 128</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_prod.html#a7ad8c7c18b1c54ff1d158683744a324d">atomic_update</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* out, T val, uint offset = 0) {</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <a class="code hl_function" href="atomic_8h.html#adea4b9574507634f411de665f4db7c3c">mlx_atomic_fetch_mul_explicit</a>(out, val, offset);</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> }</div>
</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="comment">// Operator</span></div>
<div class="foldopen" id="foldopen00133" data-start="{" data-end="}">
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="struct_prod.html#a4388efe5b733627175602c3f2d727c04"> 133</a></span> U <a class="code hl_function" href="struct_prod.html#a4388efe5b733627175602c3f2d727c04">operator()</a>(U a, U b) {</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordflow">return</span> a * b;</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> }</div>
</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span>};</div>
</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> </div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt;</div>
<div class="foldopen" id="foldopen00139" data-start="{" data-end="};">
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"><a class="line" href="struct_min.html"> 139</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_min.html">Min</a> {</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00141" data-start="{" data-end="}">
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"><a class="line" href="struct_min.html#afe8d7cefac624fd4267c1b252ac38528"> 141</a></span> T <a class="code hl_function" href="struct_min.html#afe8d7cefac624fd4267c1b252ac38528">simd_reduce</a>(T val) {</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordflow">return</span> simd_min(val);</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> };</div>
</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> </div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"><a class="line" href="struct_min.html#a322a8241f9e9f60ffa040e68c02af97c"> 145</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant U <a class="code hl_variable" href="struct_min.html#a322a8241f9e9f60ffa040e68c02af97c">init</a> = <a class="code hl_struct" href="struct_limits.html">Limits&lt;U&gt;::max</a>;</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="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00148" data-start="{" data-end="}">
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"><a class="line" href="struct_min.html#a2377172960d21faa67b13c6b1eec5c69"> 148</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_min.html#a2377172960d21faa67b13c6b1eec5c69">atomic_update</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* out, T val, uint offset = 0) {</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <a class="code hl_function" href="atomic_8h.html#ab962bd4d6ee8040e930e03f54c5ac16a">mlx_atomic_fetch_min_explicit</a>(out, val, offset);</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> }</div>
</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="comment">// Operator</span></div>
<div class="foldopen" id="foldopen00153" data-start="{" data-end="}">
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"><a class="line" href="struct_min.html#a3078861291a63404eee67ed057bc489a"> 153</a></span> U <a class="code hl_function" href="struct_min.html#a3078861291a63404eee67ed057bc489a">operator()</a>(U a, U b) {</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordflow">return</span> a &lt; b ? a : b;</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> }</div>
</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span>};</div>
</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="keyword">template</span> &lt;<span class="keyword">typename</span> U&gt;</div>
<div class="foldopen" id="foldopen00159" data-start="{" data-end="};">
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"><a class="line" href="struct_max.html"> 159</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_max.html">Max</a> {</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00161" data-start="{" data-end="}">
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"><a class="line" href="struct_max.html#a4f74440c6f1ce8247d5a87c2a8882080"> 161</a></span> T <a class="code hl_function" href="struct_max.html#a4f74440c6f1ce8247d5a87c2a8882080">simd_reduce</a>(T val) {</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="keywordflow">return</span> simd_max(val);</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> };</div>
</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> </div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"><a class="line" href="struct_max.html#aa985471d570c1009e5cbb174efcb9131"> 165</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant U <a class="code hl_variable" href="struct_max.html#aa985471d570c1009e5cbb174efcb9131">init</a> = <a class="code hl_struct" href="struct_limits.html">Limits&lt;U&gt;::min</a>;</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="struct_max.html#ac478a5cd1f567164d786240589d9260c"> 168</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="struct_max.html#ac478a5cd1f567164d786240589d9260c">atomic_update</a>(device <a class="code hl_struct" href="structmlx__atomic.html">mlx_atomic&lt;T&gt;</a>* out, T val, uint offset = 0) {</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <a class="code hl_function" href="atomic_8h.html#aafeb87661c0b216d994677807a78f6d7">mlx_atomic_fetch_max_explicit</a>(out, val, offset);</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> }</div>
</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> </div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="comment">// Operator</span></div>
<div class="foldopen" id="foldopen00173" data-start="{" data-end="}">
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"><a class="line" href="struct_max.html#a5bcf100d50dc6c06833fd6e3e0345007"> 173</a></span> U <a class="code hl_function" href="struct_max.html#a5bcf100d50dc6c06833fd6e3e0345007">operator()</a>(U a, U b) {</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="keywordflow">return</span> a &gt; b ? a : b;</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> }</div>
</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span>};</div>
</div>
<div class="ttc" id="aatomic_8h_html_a37cbd062017e3d056782dcfa7f5f6add"><div class="ttname"><a href="atomic_8h.html#a37cbd062017e3d056782dcfa7f5f6add">mlx_atomic_fetch_add_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_add_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:81</div></div>
<div class="ttc" id="aatomic_8h_html_a65bd5cae890db9b927d853a52bdc06e8"><div class="ttname"><a href="atomic_8h.html#a65bd5cae890db9b927d853a52bdc06e8">mlx_atomic_fetch_and_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_and_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:51</div></div>
<div class="ttc" id="aatomic_8h_html_a8108e66ef9a5fa8c62e6a7c6504c43aa"><div class="ttname"><a href="atomic_8h.html#a8108e66ef9a5fa8c62e6a7c6504c43aa">mlx_atomic_store_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_store_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:46</div></div>
<div class="ttc" id="aatomic_8h_html_a995c2d054cc4faa7b86e9a8719ff3e6f"><div class="ttname"><a href="atomic_8h.html#a995c2d054cc4faa7b86e9a8719ff3e6f">mlx_atomic_fetch_or_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_or_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:60</div></div>
<div class="ttc" id="aatomic_8h_html_aafeb87661c0b216d994677807a78f6d7"><div class="ttname"><a href="atomic_8h.html#aafeb87661c0b216d994677807a78f6d7">mlx_atomic_fetch_max_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_max_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:73</div></div>
<div class="ttc" id="aatomic_8h_html_ab962bd4d6ee8040e930e03f54c5ac16a"><div class="ttname"><a href="atomic_8h.html#ab962bd4d6ee8040e930e03f54c5ac16a">mlx_atomic_fetch_min_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_min_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:65</div></div>
<div class="ttc" id="aatomic_8h_html_adea4b9574507634f411de665f4db7c3c"><div class="ttname"><a href="atomic_8h.html#adea4b9574507634f411de665f4db7c3c">mlx_atomic_fetch_mul_explicit</a></div><div class="ttdeci">METAL_FUNC void mlx_atomic_fetch_mul_explicit(device mlx_atomic&lt; T &gt; *object, T val, uint offset)</div><div class="ttdef"><b>Definition</b> atomic.h:89</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2reduction_2ops_8h_html_a515b75d563a93d3c09ee677948dc83e3"><div class="ttname"><a href="backend_2metal_2kernels_2reduction_2ops_8h.html#a515b75d563a93d3c09ee677948dc83e3">simd_size</a></div><div class="ttdeci">static constant constexpr const uint8_t simd_size</div><div class="ttdef"><b>Definition</b> ops.h:8</div></div>
<div class="ttc" id="astruct_and_html"><div class="ttname"><a href="struct_and.html">And</a></div><div class="ttdef"><b>Definition</b> ops.h:23</div></div>
<div class="ttc" id="astruct_and_html_a514334a0fd865164d9c83fc07d499783"><div class="ttname"><a href="struct_and.html#a514334a0fd865164d9c83fc07d499783">And::update</a></div><div class="ttdeci">void update(device bool *out, bool val)</div><div class="ttdef"><b>Definition</b> ops.h:50</div></div>
<div class="ttc" id="astruct_and_html_a52fcfa8e7e83e7be6313eb57c998bf47"><div class="ttname"><a href="struct_and.html#a52fcfa8e7e83e7be6313eb57c998bf47">And::operator()</a></div><div class="ttdeci">bool operator()(bool a, bool b)</div><div class="ttdef"><b>Definition</b> ops.h:55</div></div>
<div class="ttc" id="astruct_and_html_a9ddf6d3f16dee000a5f0a30af4d43a7f"><div class="ttname"><a href="struct_and.html#a9ddf6d3f16dee000a5f0a30af4d43a7f">And::atomic_update</a></div><div class="ttdeci">void atomic_update(device mlx_atomic&lt; unsigned int &gt; *out, bool val, int elem_idx, int offset=0)</div><div class="ttdef"><b>Definition</b> ops.h:30</div></div>
<div class="ttc" id="astruct_and_html_ab4df5517e050cfa7257c34c6b0bd980b"><div class="ttname"><a href="struct_and.html#ab4df5517e050cfa7257c34c6b0bd980b">And::simd_reduce</a></div><div class="ttdeci">bool simd_reduce(bool val)</div><div class="ttdef"><b>Definition</b> ops.h:24</div></div>
<div class="ttc" id="astruct_and_html_ab55eac58830ae01c45f18377eff021ea"><div class="ttname"><a href="struct_and.html#ab55eac58830ae01c45f18377eff021ea">And::init</a></div><div class="ttdeci">static constexpr constant bool init</div><div class="ttdef"><b>Definition</b> ops.h:28</div></div>
<div class="ttc" id="astruct_and_html_af4a5c9f276d21580c0acaf1ff7064c57"><div class="ttname"><a href="struct_and.html#af4a5c9f276d21580c0acaf1ff7064c57">And::atomic_update</a></div><div class="ttdeci">void atomic_update(device mlx_atomic&lt; bool &gt; *out, bool val, uint offset=0)</div><div class="ttdef"><b>Definition</b> ops.h:43</div></div>
<div class="ttc" id="astruct_limits_html"><div class="ttname"><a href="struct_limits.html">Limits</a></div><div class="ttdef"><b>Definition</b> utils.h:17</div></div>
<div class="ttc" id="astruct_max_html"><div class="ttname"><a href="struct_max.html">Max</a></div><div class="ttdef"><b>Definition</b> ops.h:159</div></div>
<div class="ttc" id="astruct_max_html_a4f74440c6f1ce8247d5a87c2a8882080"><div class="ttname"><a href="struct_max.html#a4f74440c6f1ce8247d5a87c2a8882080">Max::simd_reduce</a></div><div class="ttdeci">T simd_reduce(T val)</div><div class="ttdef"><b>Definition</b> ops.h:161</div></div>
<div class="ttc" id="astruct_max_html_a5bcf100d50dc6c06833fd6e3e0345007"><div class="ttname"><a href="struct_max.html#a5bcf100d50dc6c06833fd6e3e0345007">Max::operator()</a></div><div class="ttdeci">U operator()(U a, U b)</div><div class="ttdef"><b>Definition</b> ops.h:173</div></div>
<div class="ttc" id="astruct_max_html_aa985471d570c1009e5cbb174efcb9131"><div class="ttname"><a href="struct_max.html#aa985471d570c1009e5cbb174efcb9131">Max::init</a></div><div class="ttdeci">static constexpr constant U init</div><div class="ttdef"><b>Definition</b> ops.h:165</div></div>
<div class="ttc" id="astruct_max_html_ac478a5cd1f567164d786240589d9260c"><div class="ttname"><a href="struct_max.html#ac478a5cd1f567164d786240589d9260c">Max::atomic_update</a></div><div class="ttdeci">void atomic_update(device mlx_atomic&lt; T &gt; *out, T val, uint offset=0)</div><div class="ttdef"><b>Definition</b> ops.h:168</div></div>
<div class="ttc" id="astruct_min_html"><div class="ttname"><a href="struct_min.html">Min</a></div><div class="ttdef"><b>Definition</b> ops.h:139</div></div>
<div class="ttc" id="astruct_min_html_a2377172960d21faa67b13c6b1eec5c69"><div class="ttname"><a href="struct_min.html#a2377172960d21faa67b13c6b1eec5c69">Min::atomic_update</a></div><div class="ttdeci">void atomic_update(device mlx_atomic&lt; T &gt; *out, T val, uint offset=0)</div><div class="ttdef"><b>Definition</b> ops.h:148</div></div>
<div class="ttc" id="astruct_min_html_a3078861291a63404eee67ed057bc489a"><div class="ttname"><a href="struct_min.html#a3078861291a63404eee67ed057bc489a">Min::operator()</a></div><div class="ttdeci">U operator()(U a, U b)</div><div class="ttdef"><b>Definition</b> ops.h:153</div></div>
<div class="ttc" id="astruct_min_html_a322a8241f9e9f60ffa040e68c02af97c"><div class="ttname"><a href="struct_min.html#a322a8241f9e9f60ffa040e68c02af97c">Min::init</a></div><div class="ttdeci">static constexpr constant U init</div><div class="ttdef"><b>Definition</b> ops.h:145</div></div>
<div class="ttc" id="astruct_min_html_afe8d7cefac624fd4267c1b252ac38528"><div class="ttname"><a href="struct_min.html#afe8d7cefac624fd4267c1b252ac38528">Min::simd_reduce</a></div><div class="ttdeci">T simd_reduce(T val)</div><div class="ttdef"><b>Definition</b> ops.h:141</div></div>
<div class="ttc" id="astruct_none_html"><div class="ttname"><a href="struct_none.html">None</a></div><div class="ttdef"><b>Definition</b> ops.h:15</div></div>
<div class="ttc" id="astruct_none_html_a9d7414f58b3a526758007a4a1da72c74"><div class="ttname"><a href="struct_none.html#a9d7414f58b3a526758007a4a1da72c74">None::atomic_update</a></div><div class="ttdeci">void atomic_update(device mlx_atomic&lt; T &gt; *out, T val, uint offset=0)</div><div class="ttdef"><b>Definition</b> ops.h:17</div></div>
<div class="ttc" id="astruct_or_html"><div class="ttname"><a href="struct_or.html">Or</a></div><div class="ttdef"><b>Definition</b> ops.h:61</div></div>
<div class="ttc" id="astruct_or_html_a3798a4c73565aee2430459146305e44f"><div class="ttname"><a href="struct_or.html#a3798a4c73565aee2430459146305e44f">Or::operator()</a></div><div class="ttdeci">bool operator()(bool a, bool b)</div><div class="ttdef"><b>Definition</b> ops.h:93</div></div>
<div class="ttc" id="astruct_or_html_a40840c0506bf4ed9a0771ba42c9ebb0f"><div class="ttname"><a href="struct_or.html#a40840c0506bf4ed9a0771ba42c9ebb0f">Or::atomic_update</a></div><div class="ttdeci">void atomic_update(device mlx_atomic&lt; unsigned int &gt; *out, bool val, uint elem_idx, uint offset=0)</div><div class="ttdef"><b>Definition</b> ops.h:68</div></div>
<div class="ttc" id="astruct_or_html_a6734c64e8048a209047fa18dd8bd49e8"><div class="ttname"><a href="struct_or.html#a6734c64e8048a209047fa18dd8bd49e8">Or::init</a></div><div class="ttdeci">static constexpr constant bool init</div><div class="ttdef"><b>Definition</b> ops.h:66</div></div>
<div class="ttc" id="astruct_or_html_a942628b1b3c6be9f486c15081a0cba8e"><div class="ttname"><a href="struct_or.html#a942628b1b3c6be9f486c15081a0cba8e">Or::update</a></div><div class="ttdeci">void update(device bool *out, bool val)</div><div class="ttdef"><b>Definition</b> ops.h:88</div></div>
<div class="ttc" id="astruct_or_html_aad1e6b5b015cd0910625da725afabdf3"><div class="ttname"><a href="struct_or.html#aad1e6b5b015cd0910625da725afabdf3">Or::atomic_update</a></div><div class="ttdeci">void atomic_update(device mlx_atomic&lt; bool &gt; *out, bool val, uint offset=0)</div><div class="ttdef"><b>Definition</b> ops.h:81</div></div>
<div class="ttc" id="astruct_or_html_aef6b5abbbf3fd22981b8d27562022605"><div class="ttname"><a href="struct_or.html#aef6b5abbbf3fd22981b8d27562022605">Or::simd_reduce</a></div><div class="ttdeci">bool simd_reduce(bool val)</div><div class="ttdef"><b>Definition</b> ops.h:62</div></div>
<div class="ttc" id="astruct_prod_html"><div class="ttname"><a href="struct_prod.html">Prod</a></div><div class="ttdef"><b>Definition</b> ops.h:119</div></div>
<div class="ttc" id="astruct_prod_html_a4388efe5b733627175602c3f2d727c04"><div class="ttname"><a href="struct_prod.html#a4388efe5b733627175602c3f2d727c04">Prod::operator()</a></div><div class="ttdeci">U operator()(U a, U b)</div><div class="ttdef"><b>Definition</b> ops.h:133</div></div>
<div class="ttc" id="astruct_prod_html_a7ad8c7c18b1c54ff1d158683744a324d"><div class="ttname"><a href="struct_prod.html#a7ad8c7c18b1c54ff1d158683744a324d">Prod::atomic_update</a></div><div class="ttdeci">void atomic_update(device mlx_atomic&lt; T &gt; *out, T val, uint offset=0)</div><div class="ttdef"><b>Definition</b> ops.h:128</div></div>
<div class="ttc" id="astruct_prod_html_ab0d7a38360b971b4d99c4ad2db310069"><div class="ttname"><a href="struct_prod.html#ab0d7a38360b971b4d99c4ad2db310069">Prod::simd_reduce</a></div><div class="ttdeci">T simd_reduce(T val)</div><div class="ttdef"><b>Definition</b> ops.h:121</div></div>
<div class="ttc" id="astruct_prod_html_ac99f3882b6c3c0c17d70a82f2f2f2c56"><div class="ttname"><a href="struct_prod.html#ac99f3882b6c3c0c17d70a82f2f2f2c56">Prod::init</a></div><div class="ttdeci">static constexpr constant U init</div><div class="ttdef"><b>Definition</b> ops.h:125</div></div>
<div class="ttc" id="astruct_sum_html"><div class="ttname"><a href="struct_sum.html">Sum</a></div><div class="ttdef"><b>Definition</b> ops.h:99</div></div>
<div class="ttc" id="astruct_sum_html_a3188318e74823f00b9367317ec22ad6b"><div class="ttname"><a href="struct_sum.html#a3188318e74823f00b9367317ec22ad6b">Sum::atomic_update</a></div><div class="ttdeci">void atomic_update(device mlx_atomic&lt; T &gt; *out, T val, uint offset=0)</div><div class="ttdef"><b>Definition</b> ops.h:108</div></div>
<div class="ttc" id="astruct_sum_html_a433bf0fe3ce751c18e5269bbc19daa65"><div class="ttname"><a href="struct_sum.html#a433bf0fe3ce751c18e5269bbc19daa65">Sum::init</a></div><div class="ttdeci">static constexpr constant U init</div><div class="ttdef"><b>Definition</b> ops.h:105</div></div>
<div class="ttc" id="astruct_sum_html_acf10e0604098391526da3b8271928b5c"><div class="ttname"><a href="struct_sum.html#acf10e0604098391526da3b8271928b5c">Sum::simd_reduce</a></div><div class="ttdeci">T simd_reduce(T val)</div><div class="ttdef"><b>Definition</b> ops.h:101</div></div>
<div class="ttc" id="astruct_sum_html_af9bfdc5603dd2b888d9e1416b70aefcc"><div class="ttname"><a href="struct_sum.html#af9bfdc5603dd2b888d9e1416b70aefcc">Sum::operator()</a></div><div class="ttdeci">U operator()(U a, U b)</div><div class="ttdef"><b>Definition</b> ops.h:113</div></div>
<div class="ttc" id="astructmlx__atomic_html"><div class="ttname"><a href="structmlx__atomic.html">mlx_atomic</a></div><div class="ttdef"><b>Definition</b> atomic.h:25</div></div>
<div class="ttc" id="aunionbool4__or__uint_html"><div class="ttname"><a href="unionbool4__or__uint.html">bool4_or_uint</a></div><div class="ttdef"><b>Definition</b> ops.h:10</div></div>
<div class="ttc" id="aunionbool4__or__uint_html_a47d77eac47598fe420f8f04a615f76ca"><div class="ttname"><a href="unionbool4__or__uint.html#a47d77eac47598fe420f8f04a615f76ca">bool4_or_uint::b</a></div><div class="ttdeci">bool4 b</div><div class="ttdef"><b>Definition</b> ops.h:11</div></div>
<div class="ttc" id="aunionbool4__or__uint_html_ab24d95aaf4203ddf3e6b1ed19397ced7"><div class="ttname"><a href="unionbool4__or__uint.html#ab24d95aaf4203ddf3e6b1ed19397ced7">bool4_or_uint::i</a></div><div class="ttdeci">unsigned int i</div><div class="ttdef"><b>Definition</b> ops.h:12</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/steel/gemm/transforms.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li><li class="navelem"><a class="el" href="dir_76215a6c54e2b67053e723fc2395583c.html">steel</a></li><li class="navelem"><a class="el" href="dir_6768c99e6145fb9510ccdb40db8ede25.html">gemm</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> </div>
<div class="headertitle"><div class="title">transforms.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="backend_2metal_2kernels_2steel_2utils_8h_source.html">mlx/backend/metal/kernels/steel/utils.h</a>&quot;</code><br />
</div>
<p><a href="backend_2metal_2kernels_2steel_2gemm_2transforms_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1steel_1_1_transform_none.html">mlx::steel::TransformNone&lt; OutT, InT &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1steel_1_1_transform_add.html">mlx::steel::TransformAdd&lt; OutT, InT &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1steel_1_1_transform_axpby.html">mlx::steel::TransformAxpby&lt; OutT, InT &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1steel_1_1_accum_helper.html">mlx::steel::AccumHelper&lt; T &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmlx_1_1steel_1_1_block_swizzle.html">mlx::steel::BlockSwizzle</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacemlx" id="r_namespacemlx"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx.html">mlx</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1steel" id="r_namespacemlx_1_1steel"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1steel.html">mlx::steel</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,206 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/steel/gemm/transforms.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li><li class="navelem"><a class="el" href="dir_76215a6c54e2b67053e723fc2395583c.html">steel</a></li><li class="navelem"><a class="el" href="dir_6768c99e6145fb9510ccdb40db8ede25.html">gemm</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">transforms.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2metal_2kernels_2steel_2gemm_2transforms_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &quot;<a class="code" href="backend_2metal_2kernels_2steel_2utils_8h.html">mlx/backend/metal/kernels/steel/utils.h</a>&quot;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// Transforms and Epilogues</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemlx.html">mlx</a> {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="keyword">namespace </span>steel {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> OutT, <span class="keyword">typename</span> InT&gt;</div>
<div class="foldopen" id="foldopen00015" data-start="{" data-end="};">
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_transform_none.html"> 15</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1steel_1_1_transform_none.html">TransformNone</a> {</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_1steel_1_1_transform_none.html#a84daa89be5b3348b5715bf8c5a01da75"> 16</a></span> <span class="keyword">static</span> METAL_FUNC OutT <a class="code hl_function" href="structmlx_1_1steel_1_1_transform_none.html#a84daa89be5b3348b5715bf8c5a01da75">apply</a>(InT x) {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>OutT<span class="keyword">&gt;</span>(x);</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> }</div>
</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
<div class="foldopen" id="foldopen00020" data-start="{" data-end="}">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_transform_none.html#ae4c397038f386b13eaa386638a0fce90"> 20</a></span> <span class="keyword">static</span> METAL_FUNC OutT <a class="code hl_function" href="structmlx_1_1steel_1_1_transform_none.html#ae4c397038f386b13eaa386638a0fce90">apply</a>(InT x, OutT) {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>OutT<span class="keyword">&gt;</span>(x);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> }</div>
</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span>};</div>
</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> OutT, <span class="keyword">typename</span> InT&gt;</div>
<div class="foldopen" id="foldopen00026" data-start="{" data-end="};">
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_transform_add.html"> 26</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1steel_1_1_transform_add.html">TransformAdd</a> {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_transform_add.html#a7c1b7292910b74281e5296b3dac157ae"> 27</a></span> <a class="code hl_function" href="structmlx_1_1steel_1_1_transform_add.html#a7c1b7292910b74281e5296b3dac157ae">TransformAdd</a>(<span class="keyword">const</span> <span class="keywordtype">float</span>, <span class="keyword">const</span> <span class="keywordtype">float</span>) {}</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="foldopen" id="foldopen00029" data-start="{" data-end="}">
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_transform_add.html#afbb688d84443fd622b4dd2768cfe0acf"> 29</a></span> <span class="keyword">static</span> METAL_FUNC OutT <a class="code hl_function" href="structmlx_1_1steel_1_1_transform_add.html#afbb688d84443fd622b4dd2768cfe0acf">apply</a>(InT x) {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>OutT<span class="keyword">&gt;</span>(x);</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> }</div>
</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </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="structmlx_1_1steel_1_1_transform_add.html#a4923b0059d88099b2739f2cf0273ea19"> 33</a></span> <span class="keyword">static</span> METAL_FUNC OutT <a class="code hl_function" href="structmlx_1_1steel_1_1_transform_add.html#a4923b0059d88099b2739f2cf0273ea19">apply</a>(InT x, OutT c) {</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>OutT<span class="keyword">&gt;</span>(x) + c;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> }</div>
</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span>};</div>
</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> OutT, <span class="keyword">typename</span> InT&gt;</div>
<div class="foldopen" id="foldopen00039" data-start="{" data-end="};">
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_transform_axpby.html"> 39</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1steel_1_1_transform_axpby.html">TransformAxpby</a> {</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_transform_axpby.html#ab3223b49c6b3b7f89eba91aeaff9dcff"> 40</a></span> <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code hl_variable" href="structmlx_1_1steel_1_1_transform_axpby.html#ab3223b49c6b3b7f89eba91aeaff9dcff">alpha</a>;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_transform_axpby.html#a5fc726f085bafd1acbc391886f7fb8b6"> 41</a></span> <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code hl_variable" href="structmlx_1_1steel_1_1_transform_axpby.html#a5fc726f085bafd1acbc391886f7fb8b6">beta</a>;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> </div>
<div class="foldopen" id="foldopen00043" data-start="{" data-end="}">
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_transform_axpby.html#ad7d11c53de13646b725921391d15bbe9"> 43</a></span> <a class="code hl_function" href="structmlx_1_1steel_1_1_transform_axpby.html#ad7d11c53de13646b725921391d15bbe9">TransformAxpby</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> alpha_, <span class="keyword">const</span> <span class="keywordtype">float</span> beta_)</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> : <a class="code hl_variable" href="structmlx_1_1steel_1_1_transform_axpby.html#ab3223b49c6b3b7f89eba91aeaff9dcff">alpha</a>(alpha_), <a class="code hl_variable" href="structmlx_1_1steel_1_1_transform_axpby.html#a5fc726f085bafd1acbc391886f7fb8b6">beta</a>(beta_) {}</div>
</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
<div class="foldopen" id="foldopen00046" data-start="{" data-end="}">
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_transform_axpby.html#a14ad48b0189d6bdde06c66f1b567ae87"> 46</a></span> <span class="keyword">static</span> METAL_FUNC OutT <a class="code hl_function" href="structmlx_1_1steel_1_1_transform_axpby.html#a14ad48b0189d6bdde06c66f1b567ae87">apply</a>(InT x) {</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>OutT<span class="keyword">&gt;</span>(x);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> }</div>
</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </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="structmlx_1_1steel_1_1_transform_axpby.html#aaf3a45e25d7abf7a34b48cc612e631ba"> 50</a></span> METAL_FUNC OutT <a class="code hl_function" href="structmlx_1_1steel_1_1_transform_axpby.html#aaf3a45e25d7abf7a34b48cc612e631ba">apply</a>(InT x, OutT c)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>OutT<span class="keyword">&gt;</span>(x * <a class="code hl_variable" href="structmlx_1_1steel_1_1_transform_axpby.html#ab3223b49c6b3b7f89eba91aeaff9dcff">alpha</a> + (<a class="code hl_variable" href="structmlx_1_1steel_1_1_transform_axpby.html#a5fc726f085bafd1acbc391886f7fb8b6">beta</a> * c));</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> }</div>
</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span>};</div>
</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00056" data-start="{" data-end="};">
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_accum_helper.html"> 56</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1steel_1_1_accum_helper.html">AccumHelper</a> {</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_accum_helper.html#ae52abf69e7ba6af1a73d65d57182ed26"> 57</a></span> <span class="keyword">typedef</span> <span class="keywordtype">float</span> <a class="code hl_typedef" href="structmlx_1_1steel_1_1_accum_helper.html#ae52abf69e7ba6af1a73d65d57182ed26">accum_type</a>;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span>};</div>
</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </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="structmlx_1_1steel_1_1_block_swizzle.html"> 60</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structmlx_1_1steel_1_1_block_swizzle.html">BlockSwizzle</a> {</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keyword">static</span> METAL_FUNC int2</div>
<div class="foldopen" id="foldopen00062" data-start="{" data-end="}">
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="structmlx_1_1steel_1_1_block_swizzle.html#a98e558d63826d2aaa06d3e65a06d2760"> 62</a></span> <a class="code hl_function" href="structmlx_1_1steel_1_1_block_swizzle.html#a98e558d63826d2aaa06d3e65a06d2760">swizzle</a>(uint3 tid [[threadgroup_position_in_grid]], <span class="keyword">const</span> <span class="keywordtype">int</span> swizzle_log) {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keyword">const</span> <span class="keywordtype">int</span> tid_x = (tid.x) &gt;&gt; swizzle_log;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keyword">const</span> <span class="keywordtype">int</span> tid_y =</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> ((tid.y) &lt;&lt; swizzle_log) + ((tid.x) &amp; ((1 &lt;&lt; swizzle_log) - 1));</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">return</span> int2(tid_x, tid_y);</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>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span>} <span class="comment">// namespace steel</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span>} <span class="comment">// namespace mlx</span></div>
<div class="ttc" id="abackend_2metal_2kernels_2steel_2utils_8h_html"><div class="ttname"><a href="backend_2metal_2kernels_2steel_2utils_8h.html">utils.h</a></div></div>
<div class="ttc" id="anamespacemlx_html"><div class="ttname"><a href="namespacemlx.html">mlx</a></div><div class="ttdef"><b>Definition</b> allocator.h:7</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_accum_helper_html"><div class="ttname"><a href="structmlx_1_1steel_1_1_accum_helper.html">mlx::steel::AccumHelper</a></div><div class="ttdef"><b>Definition</b> transforms.h:56</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_accum_helper_html_ae52abf69e7ba6af1a73d65d57182ed26"><div class="ttname"><a href="structmlx_1_1steel_1_1_accum_helper.html#ae52abf69e7ba6af1a73d65d57182ed26">mlx::steel::AccumHelper::accum_type</a></div><div class="ttdeci">float accum_type</div><div class="ttdef"><b>Definition</b> transforms.h:57</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_block_swizzle_html"><div class="ttname"><a href="structmlx_1_1steel_1_1_block_swizzle.html">mlx::steel::BlockSwizzle</a></div><div class="ttdef"><b>Definition</b> transforms.h:60</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_block_swizzle_html_a98e558d63826d2aaa06d3e65a06d2760"><div class="ttname"><a href="structmlx_1_1steel_1_1_block_swizzle.html#a98e558d63826d2aaa06d3e65a06d2760">mlx::steel::BlockSwizzle::swizzle</a></div><div class="ttdeci">static METAL_FUNC int2 swizzle(uint3 tid, const int swizzle_log)</div><div class="ttdef"><b>Definition</b> transforms.h:62</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_add_html"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_add.html">mlx::steel::TransformAdd</a></div><div class="ttdef"><b>Definition</b> transforms.h:26</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_add_html_a4923b0059d88099b2739f2cf0273ea19"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_add.html#a4923b0059d88099b2739f2cf0273ea19">mlx::steel::TransformAdd::apply</a></div><div class="ttdeci">static METAL_FUNC OutT apply(InT x, OutT c)</div><div class="ttdef"><b>Definition</b> transforms.h:33</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_add_html_a7c1b7292910b74281e5296b3dac157ae"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_add.html#a7c1b7292910b74281e5296b3dac157ae">mlx::steel::TransformAdd::TransformAdd</a></div><div class="ttdeci">TransformAdd(const float, const float)</div><div class="ttdef"><b>Definition</b> transforms.h:27</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_add_html_afbb688d84443fd622b4dd2768cfe0acf"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_add.html#afbb688d84443fd622b4dd2768cfe0acf">mlx::steel::TransformAdd::apply</a></div><div class="ttdeci">static METAL_FUNC OutT apply(InT x)</div><div class="ttdef"><b>Definition</b> transforms.h:29</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_axpby_html"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_axpby.html">mlx::steel::TransformAxpby</a></div><div class="ttdef"><b>Definition</b> transforms.h:39</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_axpby_html_a14ad48b0189d6bdde06c66f1b567ae87"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_axpby.html#a14ad48b0189d6bdde06c66f1b567ae87">mlx::steel::TransformAxpby::apply</a></div><div class="ttdeci">static METAL_FUNC OutT apply(InT x)</div><div class="ttdef"><b>Definition</b> transforms.h:46</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_axpby_html_a5fc726f085bafd1acbc391886f7fb8b6"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_axpby.html#a5fc726f085bafd1acbc391886f7fb8b6">mlx::steel::TransformAxpby::beta</a></div><div class="ttdeci">const float beta</div><div class="ttdef"><b>Definition</b> transforms.h:41</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_axpby_html_aaf3a45e25d7abf7a34b48cc612e631ba"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_axpby.html#aaf3a45e25d7abf7a34b48cc612e631ba">mlx::steel::TransformAxpby::apply</a></div><div class="ttdeci">METAL_FUNC OutT apply(InT x, OutT c) const</div><div class="ttdef"><b>Definition</b> transforms.h:50</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_axpby_html_ab3223b49c6b3b7f89eba91aeaff9dcff"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_axpby.html#ab3223b49c6b3b7f89eba91aeaff9dcff">mlx::steel::TransformAxpby::alpha</a></div><div class="ttdeci">const float alpha</div><div class="ttdef"><b>Definition</b> transforms.h:40</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_axpby_html_ad7d11c53de13646b725921391d15bbe9"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_axpby.html#ad7d11c53de13646b725921391d15bbe9">mlx::steel::TransformAxpby::TransformAxpby</a></div><div class="ttdeci">TransformAxpby(const float alpha_, const float beta_)</div><div class="ttdef"><b>Definition</b> transforms.h:43</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_none_html"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_none.html">mlx::steel::TransformNone</a></div><div class="ttdef"><b>Definition</b> transforms.h:15</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_none_html_a84daa89be5b3348b5715bf8c5a01da75"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_none.html#a84daa89be5b3348b5715bf8c5a01da75">mlx::steel::TransformNone::apply</a></div><div class="ttdeci">static METAL_FUNC OutT apply(InT x)</div><div class="ttdef"><b>Definition</b> transforms.h:16</div></div>
<div class="ttc" id="astructmlx_1_1steel_1_1_transform_none_html_ae4c397038f386b13eaa386638a0fce90"><div class="ttname"><a href="structmlx_1_1steel_1_1_transform_none.html#ae4c397038f386b13eaa386638a0fce90">mlx::steel::TransformNone::apply</a></div><div class="ttdeci">static METAL_FUNC OutT apply(InT x, OutT)</div><div class="ttdef"><b>Definition</b> transforms.h:20</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,178 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/steel/utils.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li><li class="navelem"><a class="el" href="dir_76215a6c54e2b67053e723fc2395583c.html">steel</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">utils.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;metal_stdlib&gt;</code><br />
</div>
<p><a href="backend_2metal_2kernels_2steel_2utils_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aaf4974425147d6f26d031691e321637f" id="r_aaf4974425147d6f26d031691e321637f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC ulong2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aaf4974425147d6f26d031691e321637f">elem_to_loc_broadcast</a> (uint elem, constant const int *shape, constant const size_t *a_strides, constant const size_t *b_strides, int ndim)</td></tr>
<tr class="separator:aaf4974425147d6f26d031691e321637f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42bd57d203a40d3d7d429f2333590a3c" id="r_a42bd57d203a40d3d7d429f2333590a3c"><td class="memItemLeft" align="right" valign="top">METAL_FUNC ulong3&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a42bd57d203a40d3d7d429f2333590a3c">elem_to_loc_broadcast</a> (uint elem, constant const int *shape, constant const size_t *a_strides, constant const size_t *b_strides, constant const size_t *c_strides, int ndim)</td></tr>
<tr class="separator:a42bd57d203a40d3d7d429f2333590a3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a42bd57d203a40d3d7d429f2333590a3c" name="a42bd57d203a40d3d7d429f2333590a3c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a42bd57d203a40d3d7d429f2333590a3c">&#9670;&#160;</a></span>elem_to_loc_broadcast() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">METAL_FUNC ulong3 elem_to_loc_broadcast </td>
<td>(</td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int *</td> <td class="paramname"><span class="paramname"><em>shape</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t *</td> <td class="paramname"><span class="paramname"><em>a_strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t *</td> <td class="paramname"><span class="paramname"><em>b_strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t *</td> <td class="paramname"><span class="paramname"><em>c_strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>ndim</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aaf4974425147d6f26d031691e321637f" name="aaf4974425147d6f26d031691e321637f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf4974425147d6f26d031691e321637f">&#9670;&#160;</a></span>elem_to_loc_broadcast() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">METAL_FUNC ulong2 elem_to_loc_broadcast </td>
<td>(</td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int *</td> <td class="paramname"><span class="paramname"><em>shape</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t *</td> <td class="paramname"><span class="paramname"><em>a_strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t *</td> <td class="paramname"><span class="paramname"><em>b_strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>ndim</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,139 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/steel/utils.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li><li class="navelem"><a class="el" href="dir_76215a6c54e2b67053e723fc2395583c.html">steel</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">utils.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2metal_2kernels_2steel_2utils_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;metal_stdlib&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="foldopen" id="foldopen00007" data-start="{" data-end="}">
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2steel_2utils_8h.html#aaf4974425147d6f26d031691e321637f"> 7</a></span>METAL_FUNC ulong2 <a class="code hl_function" href="backend_2metal_2kernels_2steel_2utils_8h.html#aaf4974425147d6f26d031691e321637f">elem_to_loc_broadcast</a>(</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> uint elem,</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>* shape,</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span>* a_strides,</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span>* b_strides,</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> <span class="keywordtype">int</span> ndim) {</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> ulong loc_a{0};</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> ulong loc_b{0};</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = ndim - 1; i &gt;= 0 &amp;&amp; elem &gt; 0; --i) {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keywordtype">int</span> pos_in_dim = (elem % shape[i]);</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> elem /= shape[i];</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> loc_a += pos_in_dim * a_strides[i];</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> loc_b += pos_in_dim * b_strides[i];</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> }</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">return</span> ulong2(loc_a, loc_b);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span>}</div>
</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="foldopen" id="foldopen00024" data-start="{" data-end="}">
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2steel_2utils_8h.html#a42bd57d203a40d3d7d429f2333590a3c"> 24</a></span>METAL_FUNC ulong3 <a class="code hl_function" href="backend_2metal_2kernels_2steel_2utils_8h.html#aaf4974425147d6f26d031691e321637f">elem_to_loc_broadcast</a>(</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> uint elem,</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>* shape,</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span>* a_strides,</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span>* b_strides,</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span>* c_strides,</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordtype">int</span> ndim) {</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> ulong loc_a{0};</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> ulong loc_b{0};</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> ulong loc_c{0};</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = ndim - 1; i &gt;= 0 &amp;&amp; elem &gt; 0; --i) {</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">int</span> pos_in_dim = (elem % shape[i]);</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> elem /= shape[i];</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> loc_a += pos_in_dim * a_strides[i];</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> loc_b += pos_in_dim * b_strides[i];</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> loc_c += pos_in_dim * c_strides[i];</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="keywordflow">return</span> ulong3(loc_a, loc_b, loc_c);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span>}</div>
</div>
<div class="ttc" id="abackend_2metal_2kernels_2steel_2utils_8h_html_aaf4974425147d6f26d031691e321637f"><div class="ttname"><a href="backend_2metal_2kernels_2steel_2utils_8h.html#aaf4974425147d6f26d031691e321637f">elem_to_loc_broadcast</a></div><div class="ttdeci">METAL_FUNC ulong2 elem_to_loc_broadcast(uint elem, constant const int *shape, constant const size_t *a_strides, constant const size_t *b_strides, int ndim)</div><div class="ttdef"><b>Definition</b> utils.h:7</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,884 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/utils.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">utils.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;metal_math&gt;</code><br />
<code>#include &quot;<a class="el" href="backend_2metal_2kernels_2bf16_8h_source.html">mlx/backend/metal/kernels/bf16.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="backend_2metal_2kernels_2complex_8h_source.html">mlx/backend/metal/kernels/complex.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="defines_8h_source.html">mlx/backend/metal/kernels/defines.h</a>&quot;</code><br />
</div>
<p><a href="backend_2metal_2kernels_2utils_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits.html">Limits&lt; U &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits_3_01uint8__t_01_4.html">Limits&lt; uint8_t &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits_3_01uint16__t_01_4.html">Limits&lt; uint16_t &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits_3_01uint32__t_01_4.html">Limits&lt; uint32_t &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits_3_01uint64__t_01_4.html">Limits&lt; uint64_t &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits_3_01int8__t_01_4.html">Limits&lt; int8_t &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits_3_01int16__t_01_4.html">Limits&lt; int16_t &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits_3_01int32__t_01_4.html">Limits&lt; int32_t &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits_3_01int64__t_01_4.html">Limits&lt; int64_t &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits_3_01half_01_4.html">Limits&lt; half &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits_3_01float_01_4.html">Limits&lt; float &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits_3_01bfloat16__t_01_4.html">Limits&lt; bfloat16_t &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_limits_3_01bool_01_4.html">Limits&lt; bool &gt;</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:abedffa358e7ba7782cc78d6772064c7c" id="r_abedffa358e7ba7782cc78d6772064c7c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#abedffa358e7ba7782cc78d6772064c7c">instantiate_default_limit</a>(type)</td></tr>
<tr class="separator:abedffa358e7ba7782cc78d6772064c7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e520e23f58ca645dea1ac20998d987a" id="r_a1e520e23f58ca645dea1ac20998d987a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1e520e23f58ca645dea1ac20998d987a">instantiate_float_limit</a>(type)</td></tr>
<tr class="separator:a1e520e23f58ca645dea1ac20998d987a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a069b682d7d21827461544817d722bfd3" id="r_a069b682d7d21827461544817d722bfd3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a069b682d7d21827461544817d722bfd3">MLX_MTL_PRAGMA_UNROLL</a>&#160;&#160;&#160;_Pragma(&quot;clang loop unroll(full)&quot;)</td></tr>
<tr class="separator:a069b682d7d21827461544817d722bfd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:acb8ddf4a29129846b673c50ba7078773" id="r_acb8ddf4a29129846b673c50ba7078773"><td class="memItemLeft" align="right" valign="top">typedef half&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acb8ddf4a29129846b673c50ba7078773">float16_t</a></td></tr>
<tr class="separator:acb8ddf4a29129846b673c50ba7078773"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a2e49fa7ab8f6348543455c6c45d7e2a9" id="r_a2e49fa7ab8f6348543455c6c45d7e2a9"><td class="memTemplParams" colspan="2">template&lt;typename stride_t &gt; </td></tr>
<tr class="memitem:a2e49fa7ab8f6348543455c6c45d7e2a9"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC stride_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a2e49fa7ab8f6348543455c6c45d7e2a9">elem_to_loc</a> (uint elem, device const int *shape, device const stride_t *strides, int ndim)</td></tr>
<tr class="separator:a2e49fa7ab8f6348543455c6c45d7e2a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8fd0c8fc6058e650fc99bca8b6acd7d1" id="r_a8fd0c8fc6058e650fc99bca8b6acd7d1"><td class="memTemplParams" colspan="2">template&lt;typename stride_t &gt; </td></tr>
<tr class="memitem:a8fd0c8fc6058e650fc99bca8b6acd7d1"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC stride_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a8fd0c8fc6058e650fc99bca8b6acd7d1">elem_to_loc</a> (uint elem, constant const int *shape, constant const stride_t *strides, int ndim)</td></tr>
<tr class="separator:a8fd0c8fc6058e650fc99bca8b6acd7d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a37e00d94751710e81c9632bca2f91e51" id="r_a37e00d94751710e81c9632bca2f91e51"><td class="memTemplParams" colspan="2">template&lt;typename stride_t &gt; </td></tr>
<tr class="memitem:a37e00d94751710e81c9632bca2f91e51"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC stride_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a37e00d94751710e81c9632bca2f91e51">elem_to_loc</a> (uint3 elem, constant const int *shape, constant const stride_t *strides, int ndim)</td></tr>
<tr class="separator:a37e00d94751710e81c9632bca2f91e51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a196a07022b812b241d4c06192c0fa83d" id="r_a196a07022b812b241d4c06192c0fa83d"><td class="memTemplParams" colspan="2">template&lt;typename stride_t &gt; </td></tr>
<tr class="memitem:a196a07022b812b241d4c06192c0fa83d"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC stride_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a196a07022b812b241d4c06192c0fa83d">elem_to_loc_1</a> (uint elem, constant const stride_t &amp;stride)</td></tr>
<tr class="separator:a196a07022b812b241d4c06192c0fa83d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6c45cacca97899cd362df49c06fea79" id="r_ad6c45cacca97899cd362df49c06fea79"><td class="memTemplParams" colspan="2">template&lt;typename stride_t &gt; </td></tr>
<tr class="memitem:ad6c45cacca97899cd362df49c06fea79"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC stride_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ad6c45cacca97899cd362df49c06fea79">elem_to_loc_2</a> (uint2 elem, constant const stride_t strides[2])</td></tr>
<tr class="separator:ad6c45cacca97899cd362df49c06fea79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c34ed54714c69e6e1b44344f9e6e330" id="r_a2c34ed54714c69e6e1b44344f9e6e330"><td class="memTemplParams" colspan="2">template&lt;typename stride_t &gt; </td></tr>
<tr class="memitem:a2c34ed54714c69e6e1b44344f9e6e330"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC stride_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a2c34ed54714c69e6e1b44344f9e6e330">elem_to_loc_3</a> (uint3 elem, constant const stride_t strides[3])</td></tr>
<tr class="separator:a2c34ed54714c69e6e1b44344f9e6e330"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa25c926e32ba8f05de765c662326d955" id="r_aa25c926e32ba8f05de765c662326d955"><td class="memTemplParams" colspan="2">template&lt;int NDIM&gt; </td></tr>
<tr class="memitem:aa25c926e32ba8f05de765c662326d955"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC size_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aa25c926e32ba8f05de765c662326d955">elem_to_loc_nd</a> (uint elem, device const int *shape, device const size_t *strides)</td></tr>
<tr class="separator:aa25c926e32ba8f05de765c662326d955"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d04f0d0718d0a5796ce5ca1a289d942" id="r_a0d04f0d0718d0a5796ce5ca1a289d942"><td class="memTemplParams" colspan="2">template&lt;int NDIM&gt; </td></tr>
<tr class="memitem:a0d04f0d0718d0a5796ce5ca1a289d942"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC size_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a0d04f0d0718d0a5796ce5ca1a289d942">elem_to_loc_nd</a> (uint3 elem, constant const int shape[NDIM], constant const size_t strides[NDIM])</td></tr>
<tr class="separator:a0d04f0d0718d0a5796ce5ca1a289d942"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7d74fb6d5fed31513b6b7defcf45921" id="r_ac7d74fb6d5fed31513b6b7defcf45921"><td class="memTemplParams" colspan="2">template&lt;int NDIM&gt; </td></tr>
<tr class="memitem:ac7d74fb6d5fed31513b6b7defcf45921"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC int64_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ac7d74fb6d5fed31513b6b7defcf45921">elem_to_loc_nd</a> (uint elem, constant const int shape[NDIM], constant const int64_t strides[NDIM])</td></tr>
<tr class="separator:ac7d74fb6d5fed31513b6b7defcf45921"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4fec636fff34a288ccd56ce202703232" id="r_a4fec636fff34a288ccd56ce202703232"><td class="memTemplParams" colspan="2">template&lt;int NDIM&gt; </td></tr>
<tr class="memitem:a4fec636fff34a288ccd56ce202703232"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC int64_t&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a4fec636fff34a288ccd56ce202703232">elem_to_loc_nd</a> (uint3 elem, constant const int shape[NDIM], constant const int64_t strides[NDIM])</td></tr>
<tr class="separator:a4fec636fff34a288ccd56ce202703232"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4069a6398757e8158c14551539083181" id="r_a4069a6398757e8158c14551539083181"><td class="memItemLeft" align="right" valign="top">METAL_FUNC uint2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4069a6398757e8158c14551539083181">elem_to_loc_2_nd</a> (uint3 elem, constant const int *shape, constant const size_t *a_strides, constant const size_t *b_strides, int ndim)</td></tr>
<tr class="separator:a4069a6398757e8158c14551539083181"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59d3221f4fbcc7e340af0a743fae054b" id="r_a59d3221f4fbcc7e340af0a743fae054b"><td class="memItemLeft" align="right" valign="top">METAL_FUNC uint3&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a59d3221f4fbcc7e340af0a743fae054b">elem_to_loc_3_nd</a> (uint3 elem, constant const int *shape, constant const size_t *a_strides, constant const size_t *b_strides, constant const size_t *c_strides, int ndim)</td></tr>
<tr class="separator:a59d3221f4fbcc7e340af0a743fae054b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2eae434d62466c9a072a8339162113ca" id="r_a2eae434d62466c9a072a8339162113ca"><td class="memTemplParams" colspan="2">template&lt;int NDIM&gt; </td></tr>
<tr class="memitem:a2eae434d62466c9a072a8339162113ca"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC uint2&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a2eae434d62466c9a072a8339162113ca">elem_to_loc_2_nd</a> (uint3 elem, constant const int shape[NDIM], constant const size_t a_strides[NDIM], constant const size_t b_strides[NDIM])</td></tr>
<tr class="separator:a2eae434d62466c9a072a8339162113ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a418562e11bdfc92130e445ac01e53924" id="r_a418562e11bdfc92130e445ac01e53924"><td class="memTemplParams" colspan="2">template&lt;int NDIM&gt; </td></tr>
<tr class="memitem:a418562e11bdfc92130e445ac01e53924"><td class="memTemplItemLeft" align="right" valign="top">METAL_FUNC uint3&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a418562e11bdfc92130e445ac01e53924">elem_to_loc_3_nd</a> (uint3 elem, constant const int shape[NDIM], constant const size_t a_strides[NDIM], constant const size_t b_strides[NDIM], constant const size_t c_strides[NDIM])</td></tr>
<tr class="separator:a418562e11bdfc92130e445ac01e53924"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51c19db777f43943e4b35f25dd88d49d" id="r_a51c19db777f43943e4b35f25dd88d49d"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a51c19db777f43943e4b35f25dd88d49d">ceildiv</a> (size_t N, size_t M)</td></tr>
<tr class="memdesc:a51c19db777f43943e4b35f25dd88d49d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute ceil((float)N/(float)M) <br /></td></tr>
<tr class="separator:a51c19db777f43943e4b35f25dd88d49d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27c03f2f90ab56db2e4d59559a3d2e9a" id="r_a27c03f2f90ab56db2e4d59559a3d2e9a"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a27c03f2f90ab56db2e4d59559a3d2e9a">log1p</a> (float x)</td></tr>
<tr class="separator:a27c03f2f90ab56db2e4d59559a3d2e9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3501b665c8837eabf9789ea27a7d6946" id="r_a3501b665c8837eabf9789ea27a7d6946"><td class="memItemLeft" align="right" valign="top"><a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a3501b665c8837eabf9789ea27a7d6946">log1p</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a3501b665c8837eabf9789ea27a7d6946"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba6279624b1d30c525efee856a222b5c" id="r_aba6279624b1d30c525efee856a222b5c"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aba6279624b1d30c525efee856a222b5c">simd_shuffle_down</a> (uint64_t data, uint16_t delta)</td></tr>
<tr class="separator:aba6279624b1d30c525efee856a222b5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c1e4d782fcc56e1ab5565cef12430dd" id="r_a0c1e4d782fcc56e1ab5565cef12430dd"><td class="memItemLeft" align="right" valign="top">int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0c1e4d782fcc56e1ab5565cef12430dd">simd_shuffle_down</a> (int64_t data, uint16_t delta)</td></tr>
<tr class="separator:a0c1e4d782fcc56e1ab5565cef12430dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48ae83a8caf5c74810df60b6c6cdb062" id="r_a48ae83a8caf5c74810df60b6c6cdb062"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a48ae83a8caf5c74810df60b6c6cdb062">simd_shuffle_down</a> (bool data, uint16_t delta)</td></tr>
<tr class="separator:a48ae83a8caf5c74810df60b6c6cdb062"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="abedffa358e7ba7782cc78d6772064c7c" name="abedffa358e7ba7782cc78d6772064c7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abedffa358e7ba7782cc78d6772064c7c">&#9670;&#160;</a></span>instantiate_default_limit</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define instantiate_default_limit</td>
<td>(</td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">type</span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"> <span class="keyword">template</span> &lt;&gt; \</div>
<div class="line"> <span class="keyword">struct </span><a class="code hl_struct" href="struct_limits.html">Limits</a>&lt;type&gt; { \</div>
<div class="line"> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant type <a class="code hl_variable" href="struct_limits.html#a2f0673b6f9da89ce1d64f9f3d74f50a8">max</a> = metal::numeric_limits&lt;type&gt;::max(); \</div>
<div class="line"> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant type <a class="code hl_variable" href="struct_limits.html#a6e81584ba65a4dc6ff9366b458e3a20e">min</a> = metal::numeric_limits&lt;type&gt;::min(); \</div>
<div class="line"> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant type <a class="code hl_variable" href="struct_limits.html#a5a3eae6d244fbea2aa7b9200001463e5">finite_max</a> = \</div>
<div class="line"> metal::numeric_limits&lt;type&gt;::max(); \</div>
<div class="line"> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant type <a class="code hl_variable" href="struct_limits.html#ae7469d21f2688797ca3e388d919ef05e">finite_min</a> = \</div>
<div class="line"> metal::numeric_limits&lt;type&gt;::min(); \</div>
<div class="line"> };</div>
<div class="ttc" id="astruct_limits_html"><div class="ttname"><a href="struct_limits.html">Limits</a></div><div class="ttdef"><b>Definition</b> utils.h:17</div></div>
<div class="ttc" id="astruct_limits_html_a2f0673b6f9da89ce1d64f9f3d74f50a8"><div class="ttname"><a href="struct_limits.html#a2f0673b6f9da89ce1d64f9f3d74f50a8">Limits::max</a></div><div class="ttdeci">static const constant U max</div><div class="ttdef"><b>Definition</b> utils.h:18</div></div>
<div class="ttc" id="astruct_limits_html_a5a3eae6d244fbea2aa7b9200001463e5"><div class="ttname"><a href="struct_limits.html#a5a3eae6d244fbea2aa7b9200001463e5">Limits::finite_max</a></div><div class="ttdeci">static const constant U finite_max</div><div class="ttdef"><b>Definition</b> utils.h:20</div></div>
<div class="ttc" id="astruct_limits_html_a6e81584ba65a4dc6ff9366b458e3a20e"><div class="ttname"><a href="struct_limits.html#a6e81584ba65a4dc6ff9366b458e3a20e">Limits::min</a></div><div class="ttdeci">static const constant U min</div><div class="ttdef"><b>Definition</b> utils.h:19</div></div>
<div class="ttc" id="astruct_limits_html_ae7469d21f2688797ca3e388d919ef05e"><div class="ttname"><a href="struct_limits.html#ae7469d21f2688797ca3e388d919ef05e">Limits::finite_min</a></div><div class="ttdeci">static const constant U finite_min</div><div class="ttdef"><b>Definition</b> utils.h:21</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a1e520e23f58ca645dea1ac20998d987a" name="a1e520e23f58ca645dea1ac20998d987a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1e520e23f58ca645dea1ac20998d987a">&#9670;&#160;</a></span>instantiate_float_limit</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define instantiate_float_limit</td>
<td>(</td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">type</span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line"> <span class="keyword">template</span> &lt;&gt; \</div>
<div class="line"> <span class="keyword">struct </span><a class="code hl_struct" href="struct_limits.html">Limits</a>&lt;type&gt; { \</div>
<div class="line"> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant type <a class="code hl_variable" href="struct_limits.html#a2f0673b6f9da89ce1d64f9f3d74f50a8">max</a> = \</div>
<div class="line"> metal::numeric_limits&lt;type&gt;::infinity(); \</div>
<div class="line"> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant type <a class="code hl_variable" href="struct_limits.html#a6e81584ba65a4dc6ff9366b458e3a20e">min</a> = \</div>
<div class="line"> -metal::numeric_limits&lt;type&gt;::infinity(); \</div>
<div class="line"> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant type <a class="code hl_variable" href="struct_limits.html#a5a3eae6d244fbea2aa7b9200001463e5">finite_max</a> = \</div>
<div class="line"> metal::numeric_limits&lt;type&gt;::max(); \</div>
<div class="line"> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant type <a class="code hl_variable" href="struct_limits.html#ae7469d21f2688797ca3e388d919ef05e">finite_min</a> = \</div>
<div class="line"> -metal::numeric_limits&lt;type&gt;::max(); \</div>
<div class="line"> };</div>
</div><!-- fragment -->
</div>
</div>
<a id="a069b682d7d21827461544817d722bfd3" name="a069b682d7d21827461544817d722bfd3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a069b682d7d21827461544817d722bfd3">&#9670;&#160;</a></span>MLX_MTL_PRAGMA_UNROLL</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MLX_MTL_PRAGMA_UNROLL&#160;&#160;&#160;_Pragma(&quot;clang loop unroll(full)&quot;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="acb8ddf4a29129846b673c50ba7078773" name="acb8ddf4a29129846b673c50ba7078773"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acb8ddf4a29129846b673c50ba7078773">&#9670;&#160;</a></span>float16_t</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef half <a class="el" href="#acb8ddf4a29129846b673c50ba7078773">float16_t</a></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a51c19db777f43943e4b35f25dd88d49d" name="a51c19db777f43943e4b35f25dd88d49d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51c19db777f43943e4b35f25dd88d49d">&#9670;&#160;</a></span>ceildiv()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t ceildiv </td>
<td>(</td>
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>N</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>M</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Compute ceil((float)N/(float)M) </p>
</div>
</div>
<a id="a8fd0c8fc6058e650fc99bca8b6acd7d1" name="a8fd0c8fc6058e650fc99bca8b6acd7d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8fd0c8fc6058e650fc99bca8b6acd7d1">&#9670;&#160;</a></span>elem_to_loc() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename stride_t &gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC stride_t elem_to_loc </td>
<td>(</td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int *</td> <td class="paramname"><span class="paramname"><em>shape</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const stride_t *</td> <td class="paramname"><span class="paramname"><em>strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>ndim</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a2e49fa7ab8f6348543455c6c45d7e2a9" name="a2e49fa7ab8f6348543455c6c45d7e2a9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2e49fa7ab8f6348543455c6c45d7e2a9">&#9670;&#160;</a></span>elem_to_loc() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename stride_t &gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC stride_t elem_to_loc </td>
<td>(</td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">device const int *</td> <td class="paramname"><span class="paramname"><em>shape</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">device const stride_t *</td> <td class="paramname"><span class="paramname"><em>strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>ndim</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a37e00d94751710e81c9632bca2f91e51" name="a37e00d94751710e81c9632bca2f91e51"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a37e00d94751710e81c9632bca2f91e51">&#9670;&#160;</a></span>elem_to_loc() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename stride_t &gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC stride_t elem_to_loc </td>
<td>(</td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int *</td> <td class="paramname"><span class="paramname"><em>shape</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const stride_t *</td> <td class="paramname"><span class="paramname"><em>strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>ndim</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a196a07022b812b241d4c06192c0fa83d" name="a196a07022b812b241d4c06192c0fa83d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a196a07022b812b241d4c06192c0fa83d">&#9670;&#160;</a></span>elem_to_loc_1()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename stride_t &gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC stride_t elem_to_loc_1 </td>
<td>(</td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const stride_t &amp;</td> <td class="paramname"><span class="paramname"><em>stride</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ad6c45cacca97899cd362df49c06fea79" name="ad6c45cacca97899cd362df49c06fea79"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6c45cacca97899cd362df49c06fea79">&#9670;&#160;</a></span>elem_to_loc_2()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename stride_t &gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC stride_t elem_to_loc_2 </td>
<td>(</td>
<td class="paramtype">uint2</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const stride_t</td> <td class="paramname"><span class="paramname"><em>strides</em>[2]</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a4069a6398757e8158c14551539083181" name="a4069a6398757e8158c14551539083181"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4069a6398757e8158c14551539083181">&#9670;&#160;</a></span>elem_to_loc_2_nd() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">METAL_FUNC uint2 elem_to_loc_2_nd </td>
<td>(</td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int *</td> <td class="paramname"><span class="paramname"><em>shape</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t *</td> <td class="paramname"><span class="paramname"><em>a_strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t *</td> <td class="paramname"><span class="paramname"><em>b_strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>ndim</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a2eae434d62466c9a072a8339162113ca" name="a2eae434d62466c9a072a8339162113ca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2eae434d62466c9a072a8339162113ca">&#9670;&#160;</a></span>elem_to_loc_2_nd() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int NDIM&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC uint2 elem_to_loc_2_nd </td>
<td>(</td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int</td> <td class="paramname"><span class="paramname"><em>shape</em>[NDIM], </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t</td> <td class="paramname"><span class="paramname"><em>a_strides</em>[NDIM], </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t</td> <td class="paramname"><span class="paramname"><em>b_strides</em>[NDIM]</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a2c34ed54714c69e6e1b44344f9e6e330" name="a2c34ed54714c69e6e1b44344f9e6e330"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2c34ed54714c69e6e1b44344f9e6e330">&#9670;&#160;</a></span>elem_to_loc_3()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename stride_t &gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC stride_t elem_to_loc_3 </td>
<td>(</td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const stride_t</td> <td class="paramname"><span class="paramname"><em>strides</em>[3]</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a59d3221f4fbcc7e340af0a743fae054b" name="a59d3221f4fbcc7e340af0a743fae054b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59d3221f4fbcc7e340af0a743fae054b">&#9670;&#160;</a></span>elem_to_loc_3_nd() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">METAL_FUNC uint3 elem_to_loc_3_nd </td>
<td>(</td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int *</td> <td class="paramname"><span class="paramname"><em>shape</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t *</td> <td class="paramname"><span class="paramname"><em>a_strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t *</td> <td class="paramname"><span class="paramname"><em>b_strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t *</td> <td class="paramname"><span class="paramname"><em>c_strides</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>ndim</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a418562e11bdfc92130e445ac01e53924" name="a418562e11bdfc92130e445ac01e53924"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a418562e11bdfc92130e445ac01e53924">&#9670;&#160;</a></span>elem_to_loc_3_nd() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int NDIM&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC uint3 elem_to_loc_3_nd </td>
<td>(</td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int</td> <td class="paramname"><span class="paramname"><em>shape</em>[NDIM], </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t</td> <td class="paramname"><span class="paramname"><em>a_strides</em>[NDIM], </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t</td> <td class="paramname"><span class="paramname"><em>b_strides</em>[NDIM], </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t</td> <td class="paramname"><span class="paramname"><em>c_strides</em>[NDIM]</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ac7d74fb6d5fed31513b6b7defcf45921" name="ac7d74fb6d5fed31513b6b7defcf45921"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac7d74fb6d5fed31513b6b7defcf45921">&#9670;&#160;</a></span>elem_to_loc_nd() <span class="overload">[1/4]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int NDIM&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC int64_t elem_to_loc_nd </td>
<td>(</td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int</td> <td class="paramname"><span class="paramname"><em>shape</em>[NDIM], </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int64_t</td> <td class="paramname"><span class="paramname"><em>strides</em>[NDIM]</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aa25c926e32ba8f05de765c662326d955" name="aa25c926e32ba8f05de765c662326d955"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa25c926e32ba8f05de765c662326d955">&#9670;&#160;</a></span>elem_to_loc_nd() <span class="overload">[2/4]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int NDIM&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC size_t elem_to_loc_nd </td>
<td>(</td>
<td class="paramtype">uint</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">device const int *</td> <td class="paramname"><span class="paramname"><em>shape</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">device const size_t *</td> <td class="paramname"><span class="paramname"><em>strides</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a4fec636fff34a288ccd56ce202703232" name="a4fec636fff34a288ccd56ce202703232"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4fec636fff34a288ccd56ce202703232">&#9670;&#160;</a></span>elem_to_loc_nd() <span class="overload">[3/4]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int NDIM&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC int64_t elem_to_loc_nd </td>
<td>(</td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int</td> <td class="paramname"><span class="paramname"><em>shape</em>[NDIM], </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int64_t</td> <td class="paramname"><span class="paramname"><em>strides</em>[NDIM]</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a0d04f0d0718d0a5796ce5ca1a289d942" name="a0d04f0d0718d0a5796ce5ca1a289d942"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0d04f0d0718d0a5796ce5ca1a289d942">&#9670;&#160;</a></span>elem_to_loc_nd() <span class="overload">[4/4]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;int NDIM&gt; </div>
<table class="memname">
<tr>
<td class="memname">METAL_FUNC size_t elem_to_loc_nd </td>
<td>(</td>
<td class="paramtype">uint3</td> <td class="paramname"><span class="paramname"><em>elem</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const int</td> <td class="paramname"><span class="paramname"><em>shape</em>[NDIM], </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">constant const size_t</td> <td class="paramname"><span class="paramname"><em>strides</em>[NDIM]</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a3501b665c8837eabf9789ea27a7d6946" name="a3501b665c8837eabf9789ea27a7d6946"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3501b665c8837eabf9789ea27a7d6946">&#9670;&#160;</a></span>log1p() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> log1p </td>
<td>(</td>
<td class="paramtype"><a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a></td> <td class="paramname"><span class="paramname"><em>x</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a27c03f2f90ab56db2e4d59559a3d2e9a" name="a27c03f2f90ab56db2e4d59559a3d2e9a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27c03f2f90ab56db2e4d59559a3d2e9a">&#9670;&#160;</a></span>log1p() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">float log1p </td>
<td>(</td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>x</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a48ae83a8caf5c74810df60b6c6cdb062" name="a48ae83a8caf5c74810df60b6c6cdb062"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a48ae83a8caf5c74810df60b6c6cdb062">&#9670;&#160;</a></span>simd_shuffle_down() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool simd_shuffle_down </td>
<td>(</td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>data</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint16_t</td> <td class="paramname"><span class="paramname"><em>delta</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a0c1e4d782fcc56e1ab5565cef12430dd" name="a0c1e4d782fcc56e1ab5565cef12430dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c1e4d782fcc56e1ab5565cef12430dd">&#9670;&#160;</a></span>simd_shuffle_down() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int64_t simd_shuffle_down </td>
<td>(</td>
<td class="paramtype">int64_t</td> <td class="paramname"><span class="paramname"><em>data</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint16_t</td> <td class="paramname"><span class="paramname"><em>delta</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aba6279624b1d30c525efee856a222b5c" name="aba6279624b1d30c525efee856a222b5c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba6279624b1d30c525efee856a222b5c">&#9670;&#160;</a></span>simd_shuffle_down() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">uint64_t simd_shuffle_down </td>
<td>(</td>
<td class="paramtype">uint64_t</td> <td class="paramname"><span class="paramname"><em>data</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint16_t</td> <td class="paramname"><span class="paramname"><em>delta</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,493 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/utils.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">utils.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2metal_2kernels_2utils_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023-2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;metal_math&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &quot;<a class="code" href="backend_2metal_2kernels_2bf16_8h.html">mlx/backend/metal/kernels/bf16.h</a>&quot;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;<a class="code" href="backend_2metal_2kernels_2complex_8h.html">mlx/backend/metal/kernels/complex.h</a>&quot;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &quot;<a class="code" href="defines_8h.html">mlx/backend/metal/kernels/defines.h</a>&quot;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#acb8ddf4a29129846b673c50ba7078773"> 10</a></span><span class="keyword">typedef</span> half <a class="code hl_typedef" href="backend_2metal_2kernels_2utils_8h.html#acb8ddf4a29129846b673c50ba7078773">float16_t</a>;</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">// Type limits utils</span></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> &lt;<span class="keyword">typename</span> U&gt;</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="struct_limits.html"> 17</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_limits.html">Limits</a> {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="struct_limits.html#a2f0673b6f9da89ce1d64f9f3d74f50a8"> 18</a></span> <span class="keyword">static</span> <span class="keyword">const</span> constant U <a class="code hl_variable" href="struct_limits.html#a2f0673b6f9da89ce1d64f9f3d74f50a8">max</a> = metal::numeric_limits&lt;U&gt;::max();</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="struct_limits.html#a6e81584ba65a4dc6ff9366b458e3a20e"> 19</a></span> <span class="keyword">static</span> <span class="keyword">const</span> constant U <a class="code hl_variable" href="struct_limits.html#a6e81584ba65a4dc6ff9366b458e3a20e">min</a> = metal::numeric_limits&lt;U&gt;::min();</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="struct_limits.html#a5a3eae6d244fbea2aa7b9200001463e5"> 20</a></span> <span class="keyword">static</span> <span class="keyword">const</span> constant U <a class="code hl_variable" href="struct_limits.html#a5a3eae6d244fbea2aa7b9200001463e5">finite_max</a> = metal::numeric_limits&lt;U&gt;::max();</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="struct_limits.html#ae7469d21f2688797ca3e388d919ef05e"> 21</a></span> <span class="keyword">static</span> <span class="keyword">const</span> constant U <a class="code hl_variable" href="struct_limits.html#ae7469d21f2688797ca3e388d919ef05e">finite_min</a> = metal::numeric_limits&lt;U&gt;::min();</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span>};</div>
</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="foldopen" id="foldopen00024" data-start="" data-end="">
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#abedffa358e7ba7782cc78d6772064c7c"> 24</a></span><span class="preprocessor">#define instantiate_default_limit(type) \</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor"> template &lt;&gt; \</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor"> struct Limits&lt;type&gt; { \</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor"> static constexpr constant type max = metal::numeric_limits&lt;type&gt;::max(); \</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="preprocessor"> static constexpr constant type min = metal::numeric_limits&lt;type&gt;::min(); \</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor"> static constexpr constant type finite_max = \</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="preprocessor"> metal::numeric_limits&lt;type&gt;::max(); \</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor"> static constexpr constant type finite_min = \</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor"> metal::numeric_limits&lt;type&gt;::min(); \</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="preprocessor"> };</span></div>
</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="struct_limits_3_01uint8__t_01_4.html#a55f48b89033e8c8683f8540ec6b23f02"> 35</a></span><a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#abedffa358e7ba7782cc78d6772064c7c">instantiate_default_limit</a>(uint8_t);</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="struct_limits_3_01uint16__t_01_4.html#a9d517d8265ea1898b6b16e91b8595146"> 36</a></span><a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#abedffa358e7ba7782cc78d6772064c7c">instantiate_default_limit</a>(uint16_t);</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="struct_limits_3_01uint32__t_01_4.html#a0698139f3fe440d7aa08ac5029d72235"> 37</a></span><a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#abedffa358e7ba7782cc78d6772064c7c">instantiate_default_limit</a>(uint32_t);</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="struct_limits_3_01uint64__t_01_4.html#aff101ff38be5ccdbb9790aecb3069071"> 38</a></span><a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#abedffa358e7ba7782cc78d6772064c7c">instantiate_default_limit</a>(uint64_t);</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="struct_limits_3_01int8__t_01_4.html#a24cdab873e0fb778393c69f1dc9ecf73"> 39</a></span><a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#abedffa358e7ba7782cc78d6772064c7c">instantiate_default_limit</a>(int8_t);</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="struct_limits_3_01int16__t_01_4.html#acb2936d1cdbf347a9a014c8e036a5782"> 40</a></span><a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#abedffa358e7ba7782cc78d6772064c7c">instantiate_default_limit</a>(int16_t);</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="struct_limits_3_01int32__t_01_4.html#aa9ed9f0e8c7400d8fc92e1cba9588794"> 41</a></span><a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#abedffa358e7ba7782cc78d6772064c7c">instantiate_default_limit</a>(int32_t);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="struct_limits_3_01int64__t_01_4.html#a6c7254b641878fa0fb9538814c45457a"> 42</a></span><a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#abedffa358e7ba7782cc78d6772064c7c">instantiate_default_limit</a>(int64_t);</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
<div class="foldopen" id="foldopen00044" data-start="" data-end="">
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a1e520e23f58ca645dea1ac20998d987a"> 44</a></span><span class="preprocessor">#define instantiate_float_limit(type) \</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="preprocessor"> template &lt;&gt; \</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="preprocessor"> struct Limits&lt;type&gt; { \</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="preprocessor"> static constexpr constant type max = \</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="preprocessor"> metal::numeric_limits&lt;type&gt;::infinity(); \</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="preprocessor"> static constexpr constant type min = \</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="preprocessor"> -metal::numeric_limits&lt;type&gt;::infinity(); \</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="preprocessor"> static constexpr constant type finite_max = \</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="preprocessor"> metal::numeric_limits&lt;type&gt;::max(); \</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="preprocessor"> static constexpr constant type finite_min = \</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="preprocessor"> -metal::numeric_limits&lt;type&gt;::max(); \</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="preprocessor"> };</span></div>
</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"><a class="line" href="struct_limits_3_01half_01_4.html#aedaf0190aabf23da20510e558e2690b4"> 57</a></span><a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#a1e520e23f58ca645dea1ac20998d987a">instantiate_float_limit</a>(half);</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="struct_limits_3_01float_01_4.html#a291eea590113fc1858b7f83f2e0c977d"> 58</a></span><a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#a1e520e23f58ca645dea1ac20998d987a">instantiate_float_limit</a>(<span class="keywordtype">float</span>);</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="struct_limits_3_01bfloat16__t_01_4.html#a6337dc35207b3f6f7185cd73eabac211"> 59</a></span><a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#a1e520e23f58ca645dea1ac20998d987a">instantiate_float_limit</a>(<a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>);</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span><span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00062" data-start="{" data-end="};">
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="struct_limits_3_01bool_01_4.html"> 62</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_limits.html">Limits</a>&lt;bool&gt; {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="struct_limits_3_01bool_01_4.html#acbd2132145888d51220558a101ffcff4"> 63</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">bool</span> <a class="code hl_variable" href="struct_limits.html#a2f0673b6f9da89ce1d64f9f3d74f50a8">max</a> = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="struct_limits_3_01bool_01_4.html#a139f787b57536d455490b8ef801d37cc"> 64</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> constant <span class="keywordtype">bool</span> <a class="code hl_variable" href="struct_limits.html#a6e81584ba65a4dc6ff9366b458e3a20e">min</a> = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span>};</div>
</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="comment">// Indexing utils</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a069b682d7d21827461544817d722bfd3"> 71</a></span><span class="preprocessor">#define MLX_MTL_PRAGMA_UNROLL _Pragma(&quot;clang loop unroll(full)&quot;)</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span><span class="comment">// Single Array with generic dims</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> str<span class="keywordtype">id</span>e_t&gt;</div>
<div class="foldopen" id="foldopen00077" data-start="{" data-end="}">
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a2e49fa7ab8f6348543455c6c45d7e2a9"> 77</a></span>METAL_FUNC stride_t <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a2e49fa7ab8f6348543455c6c45d7e2a9">elem_to_loc</a>(</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> uint elem,</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> device <span class="keyword">const</span> <span class="keywordtype">int</span>* shape,</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> device <span class="keyword">const</span> stride_t* strides,</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordtype">int</span> ndim) {</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> stride_t loc = 0;</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = ndim - 1; i &gt;= 0 &amp;&amp; elem &gt; 0; --i) {</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> loc += (elem % shape[i]) * strides[i];</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> elem /= shape[i];</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> }</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">return</span> loc;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span>}</div>
</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> str<span class="keywordtype">id</span>e_t&gt;</div>
<div class="foldopen" id="foldopen00091" data-start="{" data-end="}">
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a8fd0c8fc6058e650fc99bca8b6acd7d1"> 91</a></span>METAL_FUNC stride_t <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a2e49fa7ab8f6348543455c6c45d7e2a9">elem_to_loc</a>(</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> uint elem,</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>* shape,</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> constant <span class="keyword">const</span> stride_t* strides,</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordtype">int</span> ndim) {</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> stride_t loc = 0;</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = ndim - 1; i &gt;= 0 &amp;&amp; elem &gt; 0; --i) {</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> loc += (elem % shape[i]) * strides[i];</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> elem /= shape[i];</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> }</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordflow">return</span> loc;</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span>}</div>
</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> </div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="comment">// Non templated version to handle arbitrary dims</span></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> str<span class="keywordtype">id</span>e_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="backend_2metal_2kernels_2utils_8h.html#a37e00d94751710e81c9632bca2f91e51"> 106</a></span>METAL_FUNC stride_t <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a2e49fa7ab8f6348543455c6c45d7e2a9">elem_to_loc</a>(</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> uint3 elem,</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>* shape,</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> constant <span class="keyword">const</span> stride_t* strides,</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordtype">int</span> ndim) {</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> stride_t loc = elem.x * strides[ndim - 1] + elem.y * strides[ndim - 2];</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> d = ndim - 3; d &gt;= 0; --d) {</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> loc += (elem.z % shape[d]) * strides[d];</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> elem.z /= shape[d];</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> }</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">return</span> loc;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span>}</div>
</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span><span class="comment">// Single Array with fixed N dims</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> </div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> str<span class="keywordtype">id</span>e_t&gt;</div>
<div class="foldopen" id="foldopen00123" data-start="{" data-end="}">
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a196a07022b812b241d4c06192c0fa83d"> 123</a></span>METAL_FUNC stride_t <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a196a07022b812b241d4c06192c0fa83d">elem_to_loc_1</a>(uint elem, constant <span class="keyword">const</span> stride_t&amp; stride) {</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keywordflow">return</span> elem * stride;</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span>}</div>
</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> </div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> str<span class="keywordtype">id</span>e_t&gt;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span>METAL_FUNC stride_t</div>
<div class="foldopen" id="foldopen00129" data-start="{" data-end="}">
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#ad6c45cacca97899cd362df49c06fea79"> 129</a></span><a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#ad6c45cacca97899cd362df49c06fea79">elem_to_loc_2</a>(uint2 elem, constant <span class="keyword">const</span> stride_t strides[2]) {</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="keywordflow">return</span> elem.x * strides[1] + elem.y * strides[0];</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span>}</div>
</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> </div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> str<span class="keywordtype">id</span>e_t&gt;</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span>METAL_FUNC stride_t</div>
<div class="foldopen" id="foldopen00135" data-start="{" data-end="}">
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a2c34ed54714c69e6e1b44344f9e6e330"> 135</a></span><a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a2c34ed54714c69e6e1b44344f9e6e330">elem_to_loc_3</a>(uint3 elem, constant <span class="keyword">const</span> stride_t strides[3]) {</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keywordflow">return</span> elem.x * strides[2] + elem.y * strides[1] + elem.z * strides[0];</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span>}</div>
</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> </div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span><span class="keyword">template</span> &lt;<span class="keywordtype">int</span> NDIM&gt;</div>
<div class="foldopen" id="foldopen00140" data-start="{" data-end="}">
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#aa25c926e32ba8f05de765c662326d955"> 140</a></span>METAL_FUNC <span class="keywordtype">size_t</span> <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#aa25c926e32ba8f05de765c662326d955">elem_to_loc_nd</a>(</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> uint elem,</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> device <span class="keyword">const</span> <span class="keywordtype">int</span>* shape,</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> device <span class="keyword">const</span> <span class="keywordtype">size_t</span>* strides) {</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordtype">size_t</span> loc = (elem % shape[NDIM - 1]) * strides[NDIM - 1];</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#a069b682d7d21827461544817d722bfd3">MLX_MTL_PRAGMA_UNROLL</a></div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> d = NDIM - 2; d &gt;= 0; --d) {</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> elem /= shape[d + 1];</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> loc += (elem % shape[d]) * strides[d];</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> loc;</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="keywordtype">int</span> NDIM&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="backend_2metal_2kernels_2utils_8h.html#a0d04f0d0718d0a5796ce5ca1a289d942"> 156</a></span>METAL_FUNC <span class="keywordtype">size_t</span> <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#aa25c926e32ba8f05de765c662326d955">elem_to_loc_nd</a>(</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> uint3 elem,</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span> shape[NDIM],</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span> strides[NDIM]) {</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="keywordtype">size_t</span> loc = elem.x * strides[NDIM - 1] + elem.y * strides[NDIM - 2];</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> d = NDIM - 3; d &gt;= 0; --d) {</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> loc += (elem.z % shape[d]) * strides[d];</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> elem.z /= shape[d];</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> }</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keywordflow">return</span> loc;</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span>}</div>
</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span><span class="keyword">template</span> &lt;<span class="keywordtype">int</span> NDIM&gt;</div>
<div class="foldopen" id="foldopen00169" data-start="{" data-end="}">
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#ac7d74fb6d5fed31513b6b7defcf45921"> 169</a></span>METAL_FUNC int64_t <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#aa25c926e32ba8f05de765c662326d955">elem_to_loc_nd</a>(</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> uint elem,</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span> shape[NDIM],</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> constant <span class="keyword">const</span> int64_t strides[NDIM]) {</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> int64_t loc = (elem % shape[NDIM - 1]) * strides[NDIM - 1];</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> <a class="code hl_define" href="backend_2metal_2kernels_2utils_8h.html#a069b682d7d21827461544817d722bfd3">MLX_MTL_PRAGMA_UNROLL</a></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> d = NDIM - 2; d &gt;= 0; --d) {</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> elem /= shape[d + 1];</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> loc += (elem % shape[d]) * strides[d];</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> }</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> <span class="keywordflow">return</span> loc;</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span>}</div>
</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> </div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span><span class="keyword">template</span> &lt;<span class="keywordtype">int</span> NDIM&gt;</div>
<div class="foldopen" id="foldopen00185" data-start="{" data-end="}">
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a4fec636fff34a288ccd56ce202703232"> 185</a></span>METAL_FUNC int64_t <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#aa25c926e32ba8f05de765c662326d955">elem_to_loc_nd</a>(</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> uint3 elem,</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span> shape[NDIM],</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> constant <span class="keyword">const</span> int64_t strides[NDIM]) {</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> int64_t loc = elem.x * strides[NDIM - 1] + elem.y * strides[NDIM - 2];</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> d = NDIM - 3; d &gt;= 0; --d) {</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> loc += (elem.z % shape[d]) * strides[d];</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> elem.z /= shape[d];</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> loc;</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span>}</div>
</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> </div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span><span class="comment">// Multiple Arrays with generic dims</span></div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> </div>
<div class="foldopen" id="foldopen00200" data-start="{" data-end="}">
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a4069a6398757e8158c14551539083181"> 200</a></span>METAL_FUNC uint2 <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a4069a6398757e8158c14551539083181">elem_to_loc_2_nd</a>(</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> uint3 elem,</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>* shape,</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span>* a_strides,</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span>* b_strides,</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> <span class="keywordtype">int</span> ndim) {</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> uint2 loc = {</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> <span class="keyword">static_cast&lt;</span>uint<span class="keyword">&gt;</span>(</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> elem.x * a_strides[ndim - 1] + elem.y * a_strides[ndim - 2]),</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <span class="keyword">static_cast&lt;</span>uint<span class="keyword">&gt;</span>(</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> elem.x * b_strides[ndim - 1] + elem.y * b_strides[ndim - 2])};</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> d = ndim - 3; d &gt;= 0; --d) {</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> uint l = elem.z % shape[d];</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> loc.x += l * a_strides[d];</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> loc.y += l * b_strides[d];</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> elem.z /= shape[d];</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> }</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> <span class="keywordflow">return</span> loc;</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span>}</div>
</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> </div>
<div class="foldopen" id="foldopen00220" data-start="{" data-end="}">
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a59d3221f4fbcc7e340af0a743fae054b"> 220</a></span>METAL_FUNC uint3 <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a59d3221f4fbcc7e340af0a743fae054b">elem_to_loc_3_nd</a>(</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> uint3 elem,</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span>* shape,</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span>* a_strides,</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span>* b_strides,</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span>* c_strides,</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> <span class="keywordtype">int</span> ndim) {</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> uint3 loc = {</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> <span class="keyword">static_cast&lt;</span>uint<span class="keyword">&gt;</span>(</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> elem.x * a_strides[ndim - 1] + elem.y * a_strides[ndim - 2]),</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> <span class="keyword">static_cast&lt;</span>uint<span class="keyword">&gt;</span>(</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> elem.x * b_strides[ndim - 1] + elem.y * b_strides[ndim - 2]),</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="keyword">static_cast&lt;</span>uint<span class="keyword">&gt;</span>(</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> elem.x * c_strides[ndim - 1] + elem.y * c_strides[ndim - 2])};</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> d = ndim - 3; d &gt;= 0; --d) {</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> uint l = elem.z % shape[d];</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> loc.x += l * a_strides[d];</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> loc.y += l * b_strides[d];</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> loc.z += l * c_strides[d];</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> elem.z /= shape[d];</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> }</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> <span class="keywordflow">return</span> loc;</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span>}</div>
</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> </div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span><span class="comment">// Multiple Arrays with fixed N dims</span></div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> </div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span><span class="keyword">template</span> &lt;<span class="keywordtype">int</span> NDIM&gt;</div>
<div class="foldopen" id="foldopen00248" data-start="{" data-end="}">
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a2eae434d62466c9a072a8339162113ca"> 248</a></span>METAL_FUNC uint2 <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a4069a6398757e8158c14551539083181">elem_to_loc_2_nd</a>(</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> uint3 elem,</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span> shape[NDIM],</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span> a_strides[NDIM],</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span> b_strides[NDIM]) {</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> uint2 loc = {</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> <span class="keyword">static_cast&lt;</span>uint<span class="keyword">&gt;</span>(</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> elem.x * a_strides[NDIM - 1] + elem.y * a_strides[NDIM - 2]),</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> <span class="keyword">static_cast&lt;</span>uint<span class="keyword">&gt;</span>(</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> elem.x * b_strides[NDIM - 1] + elem.y * b_strides[NDIM - 2])};</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> d = NDIM - 3; d &gt;= 0; --d) {</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> uint l = elem.z % shape[d];</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> loc.x += l * a_strides[d];</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> loc.y += l * b_strides[d];</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> elem.z /= shape[d];</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> }</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> <span class="keywordflow">return</span> loc;</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span>}</div>
</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> </div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span><span class="keyword">template</span> &lt;<span class="keywordtype">int</span> NDIM&gt;</div>
<div class="foldopen" id="foldopen00268" data-start="{" data-end="}">
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a418562e11bdfc92130e445ac01e53924"> 268</a></span>METAL_FUNC uint3 <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a59d3221f4fbcc7e340af0a743fae054b">elem_to_loc_3_nd</a>(</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> uint3 elem,</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> constant <span class="keyword">const</span> <span class="keywordtype">int</span> shape[NDIM],</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span> a_strides[NDIM],</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span> b_strides[NDIM],</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> constant <span class="keyword">const</span> <span class="keywordtype">size_t</span> c_strides[NDIM]) {</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> uint3 loc = {</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> <span class="keyword">static_cast&lt;</span>uint<span class="keyword">&gt;</span>(</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> elem.x * a_strides[NDIM - 1] + elem.y * a_strides[NDIM - 2]),</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> <span class="keyword">static_cast&lt;</span>uint<span class="keyword">&gt;</span>(</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> elem.x * b_strides[NDIM - 1] + elem.y * b_strides[NDIM - 2]),</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> <span class="keyword">static_cast&lt;</span>uint<span class="keyword">&gt;</span>(</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> elem.x * c_strides[NDIM - 1] + elem.y * c_strides[NDIM - 2])};</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> d = NDIM - 3; d &gt;= 0; --d) {</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> uint l = elem.z % shape[d];</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> loc.x += l * a_strides[d];</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> loc.y += l * b_strides[d];</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> loc.z += l * c_strides[d];</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> elem.z /= shape[d];</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> }</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> <span class="keywordflow">return</span> loc;</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span>}</div>
</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> </div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span><span class="comment">// Calculation utils</span></div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> </div>
<div class="foldopen" id="foldopen00296" data-start="{" data-end="}">
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a51c19db777f43943e4b35f25dd88d49d"> 296</a></span><span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a51c19db777f43943e4b35f25dd88d49d">ceildiv</a>(<span class="keywordtype">size_t</span> N, <span class="keywordtype">size_t</span> M) {</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> <span class="keywordflow">return</span> (N + M - 1) / M;</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span>}</div>
</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> </div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span><span class="comment">// https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html#1202</span></div>
<div class="foldopen" id="foldopen00301" data-start="{" data-end="}">
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a27c03f2f90ab56db2e4d59559a3d2e9a"> 301</a></span><span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a27c03f2f90ab56db2e4d59559a3d2e9a">log1p</a>(<span class="keywordtype">float</span> x) {</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> <span class="keywordtype">float</span> xp1 = 1.0f + x;</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> <span class="keywordflow">if</span> (xp1 == <a class="code hl_struct" href="struct_limits.html">Limits&lt;float&gt;::max</a>) {</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="struct_limits.html">Limits&lt;float&gt;::max</a>;</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> }</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> <span class="keywordflow">if</span> (xp1 == 1.0f) {</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> <span class="keywordflow">return</span> x;</div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> }</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> </div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> <span class="keywordflow">return</span> x * (<a class="code hl_function" href="namespacemetal.html#a423a9f4f2fc7ef5ec7eda061277b51b6">metal::log</a>(xp1) / (xp1 - 1.0f));</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span>}</div>
</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> </div>
<div class="foldopen" id="foldopen00313" data-start="{" data-end="}">
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a3501b665c8837eabf9789ea27a7d6946"> 313</a></span><span class="keyword">inline</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a27c03f2f90ab56db2e4d59559a3d2e9a">log1p</a>(<a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> x) {</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> <span class="keywordtype">float</span> xp1 = 1.0f + <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span>(x);</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> <span class="keywordflow">if</span> (xp1 == <a class="code hl_struct" href="struct_limits.html">Limits&lt;float&gt;::max</a>) {</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> <span class="keywordflow">return</span> <a class="code hl_struct" href="struct_limits.html">Limits&lt;bfloat16_t&gt;::max</a>;</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span> }</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span> <span class="keywordflow">if</span> (xp1 == 1.0f) {</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> <span class="keywordflow">return</span> x;</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> }</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> </div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> <span class="keywordflow">return</span> <a class="code hl_typedef" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>(x * (<a class="code hl_function" href="namespacemetal.html#a423a9f4f2fc7ef5ec7eda061277b51b6">metal::log</a>(xp1) / (xp1 - 1.0f)));</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span>}</div>
</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> </div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span><span class="comment">// SIMD shuffle ops</span></div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> </div>
<div class="foldopen" id="foldopen00329" data-start="{" data-end="}">
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#aba6279624b1d30c525efee856a222b5c"> 329</a></span><span class="keyword">inline</span> uint64_t <a class="code hl_function" href="namespacemetal.html#af6e2dd7ae087aba6abac4f0350b7611c">simd_shuffle_down</a>(uint64_t data, uint16_t delta) {</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</span> <span class="keywordflow">return</span> as_type&lt;uint64_t&gt;(</div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span> <a class="code hl_function" href="namespacemetal.html#af6e2dd7ae087aba6abac4f0350b7611c">metal::simd_shuffle_down</a>(as_type&lt;uint2&gt;(data), delta));</div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span>}</div>
</div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"> 333</span> </div>
<div class="foldopen" id="foldopen00334" data-start="{" data-end="}">
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a0c1e4d782fcc56e1ab5565cef12430dd"> 334</a></span><span class="keyword">inline</span> int64_t <a class="code hl_function" href="namespacemetal.html#af6e2dd7ae087aba6abac4f0350b7611c">simd_shuffle_down</a>(int64_t data, uint16_t delta) {</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> <span class="keywordflow">return</span> as_type&lt;int64_t&gt;(</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span> <a class="code hl_function" href="namespacemetal.html#af6e2dd7ae087aba6abac4f0350b7611c">metal::simd_shuffle_down</a>(as_type&lt;uint2&gt;(data), delta));</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span>}</div>
</div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> </div>
<div class="foldopen" id="foldopen00339" data-start="{" data-end="}">
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"><a class="line" href="backend_2metal_2kernels_2utils_8h.html#a48ae83a8caf5c74810df60b6c6cdb062"> 339</a></span><span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="namespacemetal.html#af6e2dd7ae087aba6abac4f0350b7611c">simd_shuffle_down</a>(<span class="keywordtype">bool</span> data, uint16_t delta) {</div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemetal.html#af6e2dd7ae087aba6abac4f0350b7611c">simd_shuffle_down</a>(<span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(data), delta);</div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span>}</div>
</div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html">bf16.h</a></div></div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html_a7782de82393104dd4ad754ce3b316e82"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a></div><div class="ttdeci">struct _MLX_BFloat16 bfloat16_t</div><div class="ttdef"><b>Definition</b> bf16.h:257</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2complex_8h_html"><div class="ttname"><a href="backend_2metal_2kernels_2complex_8h.html">complex.h</a></div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_a069b682d7d21827461544817d722bfd3"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#a069b682d7d21827461544817d722bfd3">MLX_MTL_PRAGMA_UNROLL</a></div><div class="ttdeci">#define MLX_MTL_PRAGMA_UNROLL</div><div class="ttdef"><b>Definition</b> utils.h:71</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_a196a07022b812b241d4c06192c0fa83d"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#a196a07022b812b241d4c06192c0fa83d">elem_to_loc_1</a></div><div class="ttdeci">METAL_FUNC stride_t elem_to_loc_1(uint elem, constant const stride_t &amp;stride)</div><div class="ttdef"><b>Definition</b> utils.h:123</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_a1e520e23f58ca645dea1ac20998d987a"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#a1e520e23f58ca645dea1ac20998d987a">instantiate_float_limit</a></div><div class="ttdeci">#define instantiate_float_limit(type)</div><div class="ttdef"><b>Definition</b> utils.h:44</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_a27c03f2f90ab56db2e4d59559a3d2e9a"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#a27c03f2f90ab56db2e4d59559a3d2e9a">log1p</a></div><div class="ttdeci">float log1p(float x)</div><div class="ttdef"><b>Definition</b> utils.h:301</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_a2c34ed54714c69e6e1b44344f9e6e330"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#a2c34ed54714c69e6e1b44344f9e6e330">elem_to_loc_3</a></div><div class="ttdeci">METAL_FUNC stride_t elem_to_loc_3(uint3 elem, constant const stride_t strides[3])</div><div class="ttdef"><b>Definition</b> utils.h:135</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_a2e49fa7ab8f6348543455c6c45d7e2a9"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#a2e49fa7ab8f6348543455c6c45d7e2a9">elem_to_loc</a></div><div class="ttdeci">METAL_FUNC stride_t elem_to_loc(uint elem, device const int *shape, device const stride_t *strides, int ndim)</div><div class="ttdef"><b>Definition</b> utils.h:77</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_a4069a6398757e8158c14551539083181"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#a4069a6398757e8158c14551539083181">elem_to_loc_2_nd</a></div><div class="ttdeci">METAL_FUNC uint2 elem_to_loc_2_nd(uint3 elem, constant const int *shape, constant const size_t *a_strides, constant const size_t *b_strides, int ndim)</div><div class="ttdef"><b>Definition</b> utils.h:200</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_a51c19db777f43943e4b35f25dd88d49d"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#a51c19db777f43943e4b35f25dd88d49d">ceildiv</a></div><div class="ttdeci">size_t ceildiv(size_t N, size_t M)</div><div class="ttdoc">Compute ceil((float)N/(float)M)</div><div class="ttdef"><b>Definition</b> utils.h:296</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_a59d3221f4fbcc7e340af0a743fae054b"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#a59d3221f4fbcc7e340af0a743fae054b">elem_to_loc_3_nd</a></div><div class="ttdeci">METAL_FUNC uint3 elem_to_loc_3_nd(uint3 elem, constant const int *shape, constant const size_t *a_strides, constant const size_t *b_strides, constant const size_t *c_strides, int ndim)</div><div class="ttdef"><b>Definition</b> utils.h:220</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_aa25c926e32ba8f05de765c662326d955"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#aa25c926e32ba8f05de765c662326d955">elem_to_loc_nd</a></div><div class="ttdeci">METAL_FUNC size_t elem_to_loc_nd(uint elem, device const int *shape, device const size_t *strides)</div><div class="ttdef"><b>Definition</b> utils.h:140</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_abedffa358e7ba7782cc78d6772064c7c"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#abedffa358e7ba7782cc78d6772064c7c">instantiate_default_limit</a></div><div class="ttdeci">#define instantiate_default_limit(type)</div><div class="ttdef"><b>Definition</b> utils.h:24</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_acb8ddf4a29129846b673c50ba7078773"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#acb8ddf4a29129846b673c50ba7078773">float16_t</a></div><div class="ttdeci">half float16_t</div><div class="ttdef"><b>Definition</b> utils.h:10</div></div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_ad6c45cacca97899cd362df49c06fea79"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#ad6c45cacca97899cd362df49c06fea79">elem_to_loc_2</a></div><div class="ttdeci">METAL_FUNC stride_t elem_to_loc_2(uint2 elem, constant const stride_t strides[2])</div><div class="ttdef"><b>Definition</b> utils.h:129</div></div>
<div class="ttc" id="adefines_8h_html"><div class="ttname"><a href="defines_8h.html">defines.h</a></div></div>
<div class="ttc" id="anamespacemetal_html_a423a9f4f2fc7ef5ec7eda061277b51b6"><div class="ttname"><a href="namespacemetal.html#a423a9f4f2fc7ef5ec7eda061277b51b6">metal::log</a></div><div class="ttdeci">METAL_FUNC bfloat16_t log(bfloat16_t x)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="anamespacemetal_html_af6e2dd7ae087aba6abac4f0350b7611c"><div class="ttname"><a href="namespacemetal.html#af6e2dd7ae087aba6abac4f0350b7611c">metal::simd_shuffle_down</a></div><div class="ttdeci">METAL_FUNC bfloat16_t simd_shuffle_down(bfloat16_t data, ushort delta)</div><div class="ttdef"><b>Definition</b> bf16_math.h:391</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_html"><div class="ttname"><a href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a></div><div class="ttdef"><b>Definition</b> bf16.h:54</div></div>
<div class="ttc" id="astruct_limits_html"><div class="ttname"><a href="struct_limits.html">Limits</a></div><div class="ttdef"><b>Definition</b> utils.h:17</div></div>
<div class="ttc" id="astruct_limits_html_a2f0673b6f9da89ce1d64f9f3d74f50a8"><div class="ttname"><a href="struct_limits.html#a2f0673b6f9da89ce1d64f9f3d74f50a8">Limits::max</a></div><div class="ttdeci">static const constant U max</div><div class="ttdef"><b>Definition</b> utils.h:18</div></div>
<div class="ttc" id="astruct_limits_html_a5a3eae6d244fbea2aa7b9200001463e5"><div class="ttname"><a href="struct_limits.html#a5a3eae6d244fbea2aa7b9200001463e5">Limits::finite_max</a></div><div class="ttdeci">static const constant U finite_max</div><div class="ttdef"><b>Definition</b> utils.h:20</div></div>
<div class="ttc" id="astruct_limits_html_a6e81584ba65a4dc6ff9366b458e3a20e"><div class="ttname"><a href="struct_limits.html#a6e81584ba65a4dc6ff9366b458e3a20e">Limits::min</a></div><div class="ttdeci">static const constant U min</div><div class="ttdef"><b>Definition</b> utils.h:19</div></div>
<div class="ttc" id="astruct_limits_html_ae7469d21f2688797ca3e388d919ef05e"><div class="ttname"><a href="struct_limits.html#ae7469d21f2688797ca3e388d919ef05e">Limits::finite_min</a></div><div class="ttdeci">static const constant U finite_min</div><div class="ttdef"><b>Definition</b> utils.h:21</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,102 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/utils.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#namespaces">Namespaces</a> </div>
<div class="headertitle"><div class="title">utils.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="array_8h_source.html">mlx/array.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="backend_2metal_2device_8h_source.html">mlx/backend/metal/device.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="primitives_8h_source.html">mlx/primitives.h</a>&quot;</code><br />
</div>
<p><a href="backend_2metal_2utils_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacemlx" id="r_namespacemlx"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx.html">mlx</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemlx_1_1core" id="r_namespacemlx_1_1core"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemlx_1_1core.html">mlx::core</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,257 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/utils.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">utils.h</div></div>
</div><!--header-->
<div class="contents">
<a href="backend_2metal_2utils_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023-2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &quot;<a class="code" href="array_8h.html">mlx/array.h</a>&quot;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &quot;<a class="code" href="backend_2metal_2device_8h.html">mlx/backend/metal/device.h</a>&quot;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include &quot;<a class="code" href="primitives_8h.html">mlx/primitives.h</a>&quot;</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.html">mlx::core</a> {</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">namespace </span>{</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">using </span>metal::CommandEncoder;</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="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="keyword">inline</span> <span class="keywordtype">void</span> set_vector_bytes(</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> CommandEncoder&amp; enc,</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keyword">const</span> std::vector&lt;T&gt;&amp; vec,</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keywordtype">size_t</span> nelems,</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keywordtype">int</span> idx) {</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> enc-&gt;setBytes(vec.data(), nelems * <span class="keyword">sizeof</span>(T), idx);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span>}</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="keyword">inline</span> <span class="keywordtype">void</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span>set_vector_bytes(CommandEncoder&amp; enc, <span class="keyword">const</span> std::vector&lt;T&gt;&amp; vec, <span class="keywordtype">int</span> idx) {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordflow">return</span> set_vector_bytes(enc, vec, vec.size(), idx);</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span>}</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span>std::string type_to_name(<span class="keyword">const</span> array&amp; a) {</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> std::string tname;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">switch</span> (a.dtype()) {</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a113d2bac7e4aa6a4cb4a5c3242527b82">bool_</a>:</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> tname = <span class="stringliteral">&quot;bool_&quot;</span>;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a9778d50afbf456b0bd738751243b3b68">uint8</a>:</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> tname = <span class="stringliteral">&quot;uint8&quot;</span>;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a312a70c487366968af5e6cbf5038c812">uint16</a>:</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> tname = <span class="stringliteral">&quot;uint16&quot;</span>;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#ac63820d6fe10545907c33faf466a929e">uint32</a>:</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> tname = <span class="stringliteral">&quot;uint32&quot;</span>;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a1f42e3dd4787d2ecec7114a12daefec8">uint64</a>:</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> tname = <span class="stringliteral">&quot;uint64&quot;</span>;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a892e934e146dd938d144cee8813ca672">int8</a>:</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> tname = <span class="stringliteral">&quot;int8&quot;</span>;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a71ebba4ad1afa730962f0692c4f42f07">int16</a>:</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> tname = <span class="stringliteral">&quot;int16&quot;</span>;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a5d6373aad1444edc9de1eb07bfe5cad3">int32</a>:</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> tname = <span class="stringliteral">&quot;int32&quot;</span>;</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a9019bdc191054ada0a502c7c34cef5b8">int64</a>:</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> tname = <span class="stringliteral">&quot;int64&quot;</span>;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#abf228ee9d8ec48c03bb15adcc4e1f3ec">float16</a>:</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> tname = <span class="stringliteral">&quot;float16&quot;</span>;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a6894543b340321193dfb8052c438a319">float32</a>:</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> tname = <span class="stringliteral">&quot;float32&quot;</span>;</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#a514cf8b4e6f0a6af3a867e752f4338f7">bfloat16</a>:</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> tname = <span class="stringliteral">&quot;bfloat16&quot;</span>;</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordflow">case</span> <a class="code hl_variable" href="namespacemlx_1_1core.html#af99db87e0078bfcdb383f5689bc874d4">complex64</a>:</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> tname = <span class="stringliteral">&quot;complex64&quot;</span>;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> }</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">return</span> tname;</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"> 75</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span>MTL::Size get_block_dims(<span class="keywordtype">int</span> dim0, <span class="keywordtype">int</span> dim1, <span class="keywordtype">int</span> dim2) {</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordtype">int</span> pows[3] = {0, 0, 0};</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordtype">int</span> <a class="code hl_function" href="group__ops.html#gade905ee92eb6ab7edfc312aeddfbaeb6">sum</a> = 0;</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">while</span> (<span class="keyword">true</span>) {</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordtype">int</span> presum = <a class="code hl_function" href="group__ops.html#gade905ee92eb6ab7edfc312aeddfbaeb6">sum</a>;</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// Check all the pows</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">if</span> (dim0 &gt;= (1 &lt;&lt; (pows[0] + 1))) {</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> pows[0]++;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <a class="code hl_function" href="group__ops.html#gade905ee92eb6ab7edfc312aeddfbaeb6">sum</a>++;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> }</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="group__ops.html#gade905ee92eb6ab7edfc312aeddfbaeb6">sum</a> == 10) {</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> }</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordflow">if</span> (dim1 &gt;= (1 &lt;&lt; (pows[1] + 1))) {</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> pows[1]++;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <a class="code hl_function" href="group__ops.html#gade905ee92eb6ab7edfc312aeddfbaeb6">sum</a>++;</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> }</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="group__ops.html#gade905ee92eb6ab7edfc312aeddfbaeb6">sum</a> == 10) {</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> }</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="keywordflow">if</span> (dim2 &gt;= (1 &lt;&lt; (pows[2] + 1))) {</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> pows[2]++;</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <a class="code hl_function" href="group__ops.html#gade905ee92eb6ab7edfc312aeddfbaeb6">sum</a>++;</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> }</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="group__ops.html#gade905ee92eb6ab7edfc312aeddfbaeb6">sum</a> == presum || <a class="code hl_function" href="group__ops.html#gade905ee92eb6ab7edfc312aeddfbaeb6">sum</a> == 10) {</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordflow">break</span>;</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> }</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordflow">return</span> MTL::Size{1ul &lt;&lt; pows[0], 1ul &lt;&lt; pows[1], 1ul &lt;&lt; pows[2]};</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span>}</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> </div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="keyword">inline</span> NS::String* make_string(std::ostringstream&amp; os) {</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> std::string <span class="keywordtype">string</span> = os.str();</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">return</span> NS::String::string(<span class="keywordtype">string</span>.c_str(), NS::UTF8StringEncoding);</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span>}</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="keyword">inline</span> <span class="keywordtype">void</span> debug_set_stream_queue_label(MTL::CommandQueue* queue, <span class="keywordtype">int</span> index) {</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span><span class="preprocessor">#ifdef MLX_METAL_DEBUG</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> std::ostringstream label;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> label &lt;&lt; <span class="stringliteral">&quot;Stream &quot;</span> &lt;&lt; index;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> queue-&gt;setLabel(make_string(label));</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span>}</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span><span class="keyword">inline</span> <span class="keywordtype">void</span> debug_set_primitive_buffer_label(</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> MTL::CommandBuffer* command_buffer,</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> Primitive&amp; primitive) {</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span><span class="preprocessor">#ifdef MLX_METAL_DEBUG</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> std::ostringstream label;</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> cbuf_label = command_buffer-&gt;label(); cbuf_label) {</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> label &lt;&lt; cbuf_label-&gt;utf8String();</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> }</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> primitive.print(label);</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> command_buffer-&gt;setLabel(make_string(label));</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span>}</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> </div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span><span class="keywordtype">bool</span> is_power_of_2(<span class="keywordtype">int</span> n) {</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordflow">return</span> ((n &amp; (n - 1)) == 0) &amp;&amp; n != 0;</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span>}</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> </div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span><span class="keywordtype">int</span> next_power_of_2(<span class="keywordtype">int</span> n) {</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordflow">if</span> (is_power_of_2(n)) {</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <span class="keywordflow">return</span> n;</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> }</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemetal.html#acd288d4552215bd10455584a214c57b8">pow</a>(2, std::ceil(std::log2(n)));</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> </div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span>} <span class="comment">// namespace</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span>} <span class="comment">// namespace mlx::core</span></div>
<div class="ttc" id="aarray_8h_html"><div class="ttname"><a href="array_8h.html">array.h</a></div></div>
<div class="ttc" id="abackend_2metal_2device_8h_html"><div class="ttname"><a href="backend_2metal_2device_8h.html">device.h</a></div></div>
<div class="ttc" id="agroup__ops_html_gade905ee92eb6ab7edfc312aeddfbaeb6"><div class="ttname"><a href="group__ops.html#gade905ee92eb6ab7edfc312aeddfbaeb6">mlx::core::sum</a></div><div class="ttdeci">array sum(const array &amp;a, bool keepdims, StreamOrDevice s={})</div><div class="ttdoc">Sums the elements of an array.</div></div>
<div class="ttc" id="anamespacemetal_html_acd288d4552215bd10455584a214c57b8"><div class="ttname"><a href="namespacemetal.html#acd288d4552215bd10455584a214c57b8">metal::pow</a></div><div class="ttdeci">METAL_FUNC bfloat16_t pow(bfloat16_t x, bfloat16_t y)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html"><div class="ttname"><a href="namespacemlx_1_1core.html">mlx::core</a></div><div class="ttdef"><b>Definition</b> allocator.h:7</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a113d2bac7e4aa6a4cb4a5c3242527b82"><div class="ttname"><a href="namespacemlx_1_1core.html#a113d2bac7e4aa6a4cb4a5c3242527b82">mlx::core::bool_</a></div><div class="ttdeci">constexpr Dtype bool_</div><div class="ttdef"><b>Definition</b> dtype.h:60</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a1f42e3dd4787d2ecec7114a12daefec8"><div class="ttname"><a href="namespacemlx_1_1core.html#a1f42e3dd4787d2ecec7114a12daefec8">mlx::core::uint64</a></div><div class="ttdeci">constexpr Dtype uint64</div><div class="ttdef"><b>Definition</b> dtype.h:65</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a312a70c487366968af5e6cbf5038c812"><div class="ttname"><a href="namespacemlx_1_1core.html#a312a70c487366968af5e6cbf5038c812">mlx::core::uint16</a></div><div class="ttdeci">constexpr Dtype uint16</div><div class="ttdef"><b>Definition</b> dtype.h:63</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a514cf8b4e6f0a6af3a867e752f4338f7"><div class="ttname"><a href="namespacemlx_1_1core.html#a514cf8b4e6f0a6af3a867e752f4338f7">mlx::core::bfloat16</a></div><div class="ttdeci">constexpr Dtype bfloat16</div><div class="ttdef"><b>Definition</b> dtype.h:74</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a5d6373aad1444edc9de1eb07bfe5cad3"><div class="ttname"><a href="namespacemlx_1_1core.html#a5d6373aad1444edc9de1eb07bfe5cad3">mlx::core::int32</a></div><div class="ttdeci">constexpr Dtype int32</div><div class="ttdef"><b>Definition</b> dtype.h:69</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a6894543b340321193dfb8052c438a319"><div class="ttname"><a href="namespacemlx_1_1core.html#a6894543b340321193dfb8052c438a319">mlx::core::float32</a></div><div class="ttdeci">constexpr Dtype float32</div><div class="ttdef"><b>Definition</b> dtype.h:73</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a71ebba4ad1afa730962f0692c4f42f07"><div class="ttname"><a href="namespacemlx_1_1core.html#a71ebba4ad1afa730962f0692c4f42f07">mlx::core::int16</a></div><div class="ttdeci">constexpr Dtype int16</div><div class="ttdef"><b>Definition</b> dtype.h:68</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a892e934e146dd938d144cee8813ca672"><div class="ttname"><a href="namespacemlx_1_1core.html#a892e934e146dd938d144cee8813ca672">mlx::core::int8</a></div><div class="ttdeci">constexpr Dtype int8</div><div class="ttdef"><b>Definition</b> dtype.h:67</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a9019bdc191054ada0a502c7c34cef5b8"><div class="ttname"><a href="namespacemlx_1_1core.html#a9019bdc191054ada0a502c7c34cef5b8">mlx::core::int64</a></div><div class="ttdeci">constexpr Dtype int64</div><div class="ttdef"><b>Definition</b> dtype.h:70</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_a9778d50afbf456b0bd738751243b3b68"><div class="ttname"><a href="namespacemlx_1_1core.html#a9778d50afbf456b0bd738751243b3b68">mlx::core::uint8</a></div><div class="ttdeci">constexpr Dtype uint8</div><div class="ttdef"><b>Definition</b> dtype.h:62</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_abf228ee9d8ec48c03bb15adcc4e1f3ec"><div class="ttname"><a href="namespacemlx_1_1core.html#abf228ee9d8ec48c03bb15adcc4e1f3ec">mlx::core::float16</a></div><div class="ttdeci">constexpr Dtype float16</div><div class="ttdef"><b>Definition</b> dtype.h:72</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_ac63820d6fe10545907c33faf466a929e"><div class="ttname"><a href="namespacemlx_1_1core.html#ac63820d6fe10545907c33faf466a929e">mlx::core::uint32</a></div><div class="ttdeci">constexpr Dtype uint32</div><div class="ttdef"><b>Definition</b> dtype.h:64</div></div>
<div class="ttc" id="anamespacemlx_1_1core_html_af99db87e0078bfcdb383f5689bc874d4"><div class="ttname"><a href="namespacemlx_1_1core.html#af99db87e0078bfcdb383f5689bc874d4">mlx::core::complex64</a></div><div class="ttdeci">constexpr Dtype complex64</div><div class="ttdef"><b>Definition</b> dtype.h:75</div></div>
<div class="ttc" id="aprimitives_8h_html"><div class="ttname"><a href="primitives_8h.html">primitives.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

BIN
docs/build/html/bc_s.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

BIN
docs/build/html/bc_sd.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

594
docs/build/html/bf16__math_8h.html vendored Normal file
View File

@@ -0,0 +1,594 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/bf16_math.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">bf16_math.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="backend_2metal_2kernels_2bf16_8h_source.html">mlx/backend/metal/kernels/bf16.h</a>&quot;</code><br />
</div>
<p><a href="bf16__math_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacemetal" id="r_namespacemetal"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html">metal</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemetal_1_1fast" id="r_namespacemetal_1_1fast"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html">metal::fast</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacemetal_1_1precise" id="r_namespacemetal_1_1precise"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html">metal::precise</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a9e9f0fdd6e304522bc88acd22c576842" id="r_a9e9f0fdd6e304522bc88acd22c576842"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9e9f0fdd6e304522bc88acd22c576842">instantiate_metal_math_funcs</a>(itype, otype, ctype, mfast)</td></tr>
<tr class="separator:a9e9f0fdd6e304522bc88acd22c576842"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aecc11cb898846d01bfc9faa109fcf791" id="r_aecc11cb898846d01bfc9faa109fcf791"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aecc11cb898846d01bfc9faa109fcf791">instantiate_metal_simd_comm_funcs</a>( itype, otype, ctype, itype_to_ctype, ctype_to_otype)</td></tr>
<tr class="separator:aecc11cb898846d01bfc9faa109fcf791"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51688bc24fc9292aaec5f54a58eaa2d0" id="r_a51688bc24fc9292aaec5f54a58eaa2d0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a51688bc24fc9292aaec5f54a58eaa2d0">instantiate_metal_simd_reduction_funcs</a>(itype, otype, ctype)</td></tr>
<tr class="separator:a51688bc24fc9292aaec5f54a58eaa2d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51cfdd4502e755310f6f3456f039bea7" id="r_a51cfdd4502e755310f6f3456f039bea7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a51cfdd4502e755310f6f3456f039bea7">bfloat16_to_uint16</a>(x)&#160;&#160;&#160;x.bits_</td></tr>
<tr class="separator:a51cfdd4502e755310f6f3456f039bea7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a030d871474c0e7d907fccffcc8c047e0" id="r_a030d871474c0e7d907fccffcc8c047e0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a030d871474c0e7d907fccffcc8c047e0">uint16_to_bfloat16</a>(x)&#160;&#160;&#160;<a class="el" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>(x, <a class="el" href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">_MLX_BFloat16::bits_to_bfloat</a>())</td></tr>
<tr class="separator:a030d871474c0e7d907fccffcc8c047e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a87c5122c60f9a12afceb9925a5b78ffb" id="r_a87c5122c60f9a12afceb9925a5b78ffb"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a87c5122c60f9a12afceb9925a5b78ffb">metal::abs</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a87c5122c60f9a12afceb9925a5b78ffb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4537748b3c832b6569ff7ccb209fcb2" id="r_ad4537748b3c832b6569ff7ccb209fcb2"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ad4537748b3c832b6569ff7ccb209fcb2">metal::acos</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ad4537748b3c832b6569ff7ccb209fcb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d0efb92b7f61eff342d776bd6c5f3a0" id="r_a2d0efb92b7f61eff342d776bd6c5f3a0"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a2d0efb92b7f61eff342d776bd6c5f3a0">metal::acosh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a2d0efb92b7f61eff342d776bd6c5f3a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16e843194df3fd136404bf80ba5ac95c" id="r_a16e843194df3fd136404bf80ba5ac95c"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a16e843194df3fd136404bf80ba5ac95c">metal::asin</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a16e843194df3fd136404bf80ba5ac95c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abcc3251866930cfe880f89e7473d0e63" id="r_abcc3251866930cfe880f89e7473d0e63"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#abcc3251866930cfe880f89e7473d0e63">metal::asinh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:abcc3251866930cfe880f89e7473d0e63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80a771553d9a0012b93620d19c48b00f" id="r_a80a771553d9a0012b93620d19c48b00f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a80a771553d9a0012b93620d19c48b00f">metal::atan</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y_over_x)</td></tr>
<tr class="separator:a80a771553d9a0012b93620d19c48b00f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d430793eaa38ccf0d07145e3fcd1e61" id="r_a1d430793eaa38ccf0d07145e3fcd1e61"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a1d430793eaa38ccf0d07145e3fcd1e61">metal::atan2</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a1d430793eaa38ccf0d07145e3fcd1e61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57116427997ba71dd3863bfb15de33bf" id="r_a57116427997ba71dd3863bfb15de33bf"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a57116427997ba71dd3863bfb15de33bf">metal::atanh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a57116427997ba71dd3863bfb15de33bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad63204d38bc01df6ffc64583f7886b3c" id="r_ad63204d38bc01df6ffc64583f7886b3c"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ad63204d38bc01df6ffc64583f7886b3c">metal::ceil</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ad63204d38bc01df6ffc64583f7886b3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2fa4778a6fe2fa43253ea724e5a608a3" id="r_a2fa4778a6fe2fa43253ea724e5a608a3"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a2fa4778a6fe2fa43253ea724e5a608a3">metal::cos</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a2fa4778a6fe2fa43253ea724e5a608a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a68a88cc110830d057dbd71431b93c0" id="r_a8a68a88cc110830d057dbd71431b93c0"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a8a68a88cc110830d057dbd71431b93c0">metal::cosh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a8a68a88cc110830d057dbd71431b93c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c2f37939ad705ddea4409d3bedb8ce1" id="r_a5c2f37939ad705ddea4409d3bedb8ce1"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a5c2f37939ad705ddea4409d3bedb8ce1">metal::cospi</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a5c2f37939ad705ddea4409d3bedb8ce1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2aea493fc1a874970b77ed0031e965df" id="r_a2aea493fc1a874970b77ed0031e965df"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a2aea493fc1a874970b77ed0031e965df">metal::divide</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a2aea493fc1a874970b77ed0031e965df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2a0b3618d922ac014baac8189d44650" id="r_ac2a0b3618d922ac014baac8189d44650"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ac2a0b3618d922ac014baac8189d44650">metal::exp</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ac2a0b3618d922ac014baac8189d44650"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4c63707d13c89364496a48906631c204" id="r_a4c63707d13c89364496a48906631c204"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a4c63707d13c89364496a48906631c204">metal::exp10</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a4c63707d13c89364496a48906631c204"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a228201c20777848804a4d0589c1d33e7" id="r_a228201c20777848804a4d0589c1d33e7"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a228201c20777848804a4d0589c1d33e7">metal::exp2</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a228201c20777848804a4d0589c1d33e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a487eba718144be1325abcf66e109bb21" id="r_a487eba718144be1325abcf66e109bb21"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a487eba718144be1325abcf66e109bb21">metal::fabs</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a487eba718144be1325abcf66e109bb21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85a560794be56d8116889c1ee2d78761" id="r_a85a560794be56d8116889c1ee2d78761"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a85a560794be56d8116889c1ee2d78761">metal::fdim</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a85a560794be56d8116889c1ee2d78761"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a020790f30c28a9982c4a83deaa258277" id="r_a020790f30c28a9982c4a83deaa258277"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a020790f30c28a9982c4a83deaa258277">metal::floor</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a020790f30c28a9982c4a83deaa258277"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6301a78d69ff14a06194ca85a0c7d326" id="r_a6301a78d69ff14a06194ca85a0c7d326"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a6301a78d69ff14a06194ca85a0c7d326">metal::fma</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a6301a78d69ff14a06194ca85a0c7d326"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0558e56fdb94b456deea6a4eb53964ed" id="r_a0558e56fdb94b456deea6a4eb53964ed"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a0558e56fdb94b456deea6a4eb53964ed">metal::fmax</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a0558e56fdb94b456deea6a4eb53964ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0c1a7ba1a7449adc64d00b2a29e67f6" id="r_ae0c1a7ba1a7449adc64d00b2a29e67f6"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ae0c1a7ba1a7449adc64d00b2a29e67f6">metal::fmax3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:ae0c1a7ba1a7449adc64d00b2a29e67f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa35227450d943fb88cf43162aa9d8c49" id="r_aa35227450d943fb88cf43162aa9d8c49"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#aa35227450d943fb88cf43162aa9d8c49">metal::fmedian3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:aa35227450d943fb88cf43162aa9d8c49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66ac19825ea79b8294e243ae6d0b3d3c" id="r_a66ac19825ea79b8294e243ae6d0b3d3c"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a66ac19825ea79b8294e243ae6d0b3d3c">metal::fmin</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a66ac19825ea79b8294e243ae6d0b3d3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2acd25f2241f00aaf89ff48f132a879" id="r_ae2acd25f2241f00aaf89ff48f132a879"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ae2acd25f2241f00aaf89ff48f132a879">metal::fmin3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:ae2acd25f2241f00aaf89ff48f132a879"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ff952d4d596a7969b2a3035fc2fda58" id="r_a2ff952d4d596a7969b2a3035fc2fda58"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a2ff952d4d596a7969b2a3035fc2fda58">metal::fmod</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a2ff952d4d596a7969b2a3035fc2fda58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b1c15d251aeaacb1f4338a5e152ae78" id="r_a6b1c15d251aeaacb1f4338a5e152ae78"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a6b1c15d251aeaacb1f4338a5e152ae78">metal::fract</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a6b1c15d251aeaacb1f4338a5e152ae78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac89d4ef524d21a301da6c37dbd95ff9f" id="r_ac89d4ef524d21a301da6c37dbd95ff9f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ac89d4ef524d21a301da6c37dbd95ff9f">metal::frexp</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, thread int &amp;<a class="el" href="namespacemetal.html#ac2a0b3618d922ac014baac8189d44650">exp</a>)</td></tr>
<tr class="separator:ac89d4ef524d21a301da6c37dbd95ff9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3deed001738b6f03accd3c2195586c2b" id="r_a3deed001738b6f03accd3c2195586c2b"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a3deed001738b6f03accd3c2195586c2b">metal::ldexp</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, int k)</td></tr>
<tr class="separator:a3deed001738b6f03accd3c2195586c2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a423a9f4f2fc7ef5ec7eda061277b51b6" id="r_a423a9f4f2fc7ef5ec7eda061277b51b6"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a423a9f4f2fc7ef5ec7eda061277b51b6">metal::log</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a423a9f4f2fc7ef5ec7eda061277b51b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a042b98827baa910e9d726227cec55a80" id="r_a042b98827baa910e9d726227cec55a80"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a042b98827baa910e9d726227cec55a80">metal::log10</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a042b98827baa910e9d726227cec55a80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae894dd5fc13799f120b55cab6267c89c" id="r_ae894dd5fc13799f120b55cab6267c89c"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ae894dd5fc13799f120b55cab6267c89c">metal::log2</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ae894dd5fc13799f120b55cab6267c89c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a853c80479ab2264d9c4587c7bcac767b" id="r_a853c80479ab2264d9c4587c7bcac767b"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a853c80479ab2264d9c4587c7bcac767b">metal::max</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a853c80479ab2264d9c4587c7bcac767b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00f9c0ad66d969794614f56912eed9c9" id="r_a00f9c0ad66d969794614f56912eed9c9"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a00f9c0ad66d969794614f56912eed9c9">metal::max3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a00f9c0ad66d969794614f56912eed9c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3ff49457ce3c93fc1c0897fd1525157" id="r_aa3ff49457ce3c93fc1c0897fd1525157"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#aa3ff49457ce3c93fc1c0897fd1525157">metal::median3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:aa3ff49457ce3c93fc1c0897fd1525157"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6653b28c9473087141eddce39878d4d3" id="r_a6653b28c9473087141eddce39878d4d3"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a6653b28c9473087141eddce39878d4d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a005510c8c0f964ce2b8aad3ba76a7a3f" id="r_a005510c8c0f964ce2b8aad3ba76a7a3f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a005510c8c0f964ce2b8aad3ba76a7a3f">metal::min3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a005510c8c0f964ce2b8aad3ba76a7a3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9547fd7b09164931986f6db4813bd72d" id="r_a9547fd7b09164931986f6db4813bd72d"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a9547fd7b09164931986f6db4813bd72d">metal::nextafter</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a9547fd7b09164931986f6db4813bd72d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd288d4552215bd10455584a214c57b8" id="r_acd288d4552215bd10455584a214c57b8"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#acd288d4552215bd10455584a214c57b8">metal::pow</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:acd288d4552215bd10455584a214c57b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae529e431f178bafedc18a889323c0bc2" id="r_ae529e431f178bafedc18a889323c0bc2"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ae529e431f178bafedc18a889323c0bc2">metal::powr</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:ae529e431f178bafedc18a889323c0bc2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a29ab6060527120eee745aec0daa06e01" id="r_a29ab6060527120eee745aec0daa06e01"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a29ab6060527120eee745aec0daa06e01">metal::rint</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a29ab6060527120eee745aec0daa06e01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46c667e169ff9d51a9204a045305442f" id="r_a46c667e169ff9d51a9204a045305442f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a46c667e169ff9d51a9204a045305442f">metal::round</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a46c667e169ff9d51a9204a045305442f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1cf4b605c0aa7ff5bfe5e979a16f5157" id="r_a1cf4b605c0aa7ff5bfe5e979a16f5157"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a1cf4b605c0aa7ff5bfe5e979a16f5157">metal::rsqrt</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a1cf4b605c0aa7ff5bfe5e979a16f5157"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a619a159ca5f2ddfe3647d3a6bb6e804c" id="r_a619a159ca5f2ddfe3647d3a6bb6e804c"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a619a159ca5f2ddfe3647d3a6bb6e804c">metal::sin</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a619a159ca5f2ddfe3647d3a6bb6e804c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a83ba4235ae350ab8880a9df09158620b" id="r_a83ba4235ae350ab8880a9df09158620b"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a83ba4235ae350ab8880a9df09158620b">metal::sinh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a83ba4235ae350ab8880a9df09158620b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae9655f7fa2ba6c0625ca25fbb278e269" id="r_ae9655f7fa2ba6c0625ca25fbb278e269"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ae9655f7fa2ba6c0625ca25fbb278e269">metal::sinpi</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ae9655f7fa2ba6c0625ca25fbb278e269"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3f4d4852ca0e591104fbd8e5b50d31b" id="r_ab3f4d4852ca0e591104fbd8e5b50d31b"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ab3f4d4852ca0e591104fbd8e5b50d31b">metal::sqrt</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ab3f4d4852ca0e591104fbd8e5b50d31b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a862215a8ddacb086296ba02567c9b158" id="r_a862215a8ddacb086296ba02567c9b158"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a862215a8ddacb086296ba02567c9b158">metal::tan</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a862215a8ddacb086296ba02567c9b158"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa97fc50bd6addfc6de0aae8570fe963d" id="r_aa97fc50bd6addfc6de0aae8570fe963d"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#aa97fc50bd6addfc6de0aae8570fe963d">metal::tanh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:aa97fc50bd6addfc6de0aae8570fe963d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2046d163a525fc1822a9ec8a0aeaeb3" id="r_ae2046d163a525fc1822a9ec8a0aeaeb3"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ae2046d163a525fc1822a9ec8a0aeaeb3">metal::tanpi</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ae2046d163a525fc1822a9ec8a0aeaeb3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93cb75a11a362bfc8310ea19c554c887" id="r_a93cb75a11a362bfc8310ea19c554c887"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a93cb75a11a362bfc8310ea19c554c887">metal::trunc</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a93cb75a11a362bfc8310ea19c554c887"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90d2973f71f83180e7f02e38d11c7a8f" id="r_a90d2973f71f83180e7f02e38d11c7a8f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a90d2973f71f83180e7f02e38d11c7a8f">metal::fast::abs</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a90d2973f71f83180e7f02e38d11c7a8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a805ce5c3a94b618b7349d70bbb82f0b2" id="r_a805ce5c3a94b618b7349d70bbb82f0b2"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a805ce5c3a94b618b7349d70bbb82f0b2">metal::fast::acos</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a805ce5c3a94b618b7349d70bbb82f0b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb656fc3406649a238b6f1e0509de751" id="r_afb656fc3406649a238b6f1e0509de751"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#afb656fc3406649a238b6f1e0509de751">metal::fast::acosh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:afb656fc3406649a238b6f1e0509de751"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a769455a283da99654b6e42c3acf13eb1" id="r_a769455a283da99654b6e42c3acf13eb1"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a769455a283da99654b6e42c3acf13eb1">metal::fast::asin</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a769455a283da99654b6e42c3acf13eb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4367034b7b3e14310803bb2be975a556" id="r_a4367034b7b3e14310803bb2be975a556"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a4367034b7b3e14310803bb2be975a556">metal::fast::asinh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a4367034b7b3e14310803bb2be975a556"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a769503b4b7f89071d0983258c5a3ac5a" id="r_a769503b4b7f89071d0983258c5a3ac5a"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a769503b4b7f89071d0983258c5a3ac5a">metal::fast::atan</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y_over_x)</td></tr>
<tr class="separator:a769503b4b7f89071d0983258c5a3ac5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00e687ea46f5affe26e6aef8fd62b89a" id="r_a00e687ea46f5affe26e6aef8fd62b89a"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a00e687ea46f5affe26e6aef8fd62b89a">metal::fast::atan2</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a00e687ea46f5affe26e6aef8fd62b89a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af24608fc605db9a14427d37c36dc1c53" id="r_af24608fc605db9a14427d37c36dc1c53"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#af24608fc605db9a14427d37c36dc1c53">metal::fast::atanh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:af24608fc605db9a14427d37c36dc1c53"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97b0bbd79f1f45d9d3104d712914e6b8" id="r_a97b0bbd79f1f45d9d3104d712914e6b8"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a97b0bbd79f1f45d9d3104d712914e6b8">metal::fast::ceil</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a97b0bbd79f1f45d9d3104d712914e6b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a75b6bb32fa3870eda46a7bfc9f481f88" id="r_a75b6bb32fa3870eda46a7bfc9f481f88"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a75b6bb32fa3870eda46a7bfc9f481f88">metal::fast::cos</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a75b6bb32fa3870eda46a7bfc9f481f88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31544ad9de28012a4ddda86e3966a77e" id="r_a31544ad9de28012a4ddda86e3966a77e"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a31544ad9de28012a4ddda86e3966a77e">metal::fast::cosh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a31544ad9de28012a4ddda86e3966a77e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9906b41f75319b384ffb570cc94d67ce" id="r_a9906b41f75319b384ffb570cc94d67ce"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a9906b41f75319b384ffb570cc94d67ce">metal::fast::cospi</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a9906b41f75319b384ffb570cc94d67ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae70bc2185e4649369cf7b15f5e1d48be" id="r_ae70bc2185e4649369cf7b15f5e1d48be"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#ae70bc2185e4649369cf7b15f5e1d48be">metal::fast::divide</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:ae70bc2185e4649369cf7b15f5e1d48be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3dbd387b63373c29e3449609f763ede" id="r_ad3dbd387b63373c29e3449609f763ede"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#ad3dbd387b63373c29e3449609f763ede">metal::fast::exp</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ad3dbd387b63373c29e3449609f763ede"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a453122f982485cbb4e471b3ac282ee5e" id="r_a453122f982485cbb4e471b3ac282ee5e"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a453122f982485cbb4e471b3ac282ee5e">metal::fast::exp10</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a453122f982485cbb4e471b3ac282ee5e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac092b65a46720adaf22f6266671d2d71" id="r_ac092b65a46720adaf22f6266671d2d71"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#ac092b65a46720adaf22f6266671d2d71">metal::fast::exp2</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ac092b65a46720adaf22f6266671d2d71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a129fbd68c9df1a437e8959a25187f554" id="r_a129fbd68c9df1a437e8959a25187f554"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a129fbd68c9df1a437e8959a25187f554">metal::fast::fabs</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a129fbd68c9df1a437e8959a25187f554"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a667df76100d5ea0ce5860ddae3e5a00b" id="r_a667df76100d5ea0ce5860ddae3e5a00b"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a667df76100d5ea0ce5860ddae3e5a00b">metal::fast::fdim</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a667df76100d5ea0ce5860ddae3e5a00b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac012ce1701c2339914f15cce9f2c632f" id="r_ac012ce1701c2339914f15cce9f2c632f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#ac012ce1701c2339914f15cce9f2c632f">metal::fast::floor</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ac012ce1701c2339914f15cce9f2c632f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebcd6e951da6f7157ec219eb7a8f1ddd" id="r_aebcd6e951da6f7157ec219eb7a8f1ddd"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#aebcd6e951da6f7157ec219eb7a8f1ddd">metal::fast::fma</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:aebcd6e951da6f7157ec219eb7a8f1ddd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26e3257cf877154f8a0d434be0bdb034" id="r_a26e3257cf877154f8a0d434be0bdb034"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a26e3257cf877154f8a0d434be0bdb034">metal::fast::fmax</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a26e3257cf877154f8a0d434be0bdb034"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c6a3a389f348e1f92e8392b765a32c7" id="r_a5c6a3a389f348e1f92e8392b765a32c7"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a5c6a3a389f348e1f92e8392b765a32c7">metal::fast::fmax3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a5c6a3a389f348e1f92e8392b765a32c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a923869181c3f576f2d86fba5bfa85633" id="r_a923869181c3f576f2d86fba5bfa85633"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a923869181c3f576f2d86fba5bfa85633">metal::fast::fmedian3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a923869181c3f576f2d86fba5bfa85633"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e202ec52bf12bfabdf2265b300acbfa" id="r_a7e202ec52bf12bfabdf2265b300acbfa"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a7e202ec52bf12bfabdf2265b300acbfa">metal::fast::fmin</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a7e202ec52bf12bfabdf2265b300acbfa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9531c6a4a520927523961e6eb6b94c1a" id="r_a9531c6a4a520927523961e6eb6b94c1a"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a9531c6a4a520927523961e6eb6b94c1a">metal::fast::fmin3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a9531c6a4a520927523961e6eb6b94c1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adbec09f18a89f773d7e368ef04a69526" id="r_adbec09f18a89f773d7e368ef04a69526"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#adbec09f18a89f773d7e368ef04a69526">metal::fast::fmod</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:adbec09f18a89f773d7e368ef04a69526"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8bb448827503e485eb649eb3edb2d4c" id="r_aa8bb448827503e485eb649eb3edb2d4c"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#aa8bb448827503e485eb649eb3edb2d4c">metal::fast::fract</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:aa8bb448827503e485eb649eb3edb2d4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a23902df22aeaa859ef673a36381387c2" id="r_a23902df22aeaa859ef673a36381387c2"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a23902df22aeaa859ef673a36381387c2">metal::fast::frexp</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, thread int &amp;<a class="el" href="namespacemetal_1_1fast.html#ad3dbd387b63373c29e3449609f763ede">exp</a>)</td></tr>
<tr class="separator:a23902df22aeaa859ef673a36381387c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb045765987e76c7ad4b511fab0c867e" id="r_adb045765987e76c7ad4b511fab0c867e"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#adb045765987e76c7ad4b511fab0c867e">metal::fast::ldexp</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, int k)</td></tr>
<tr class="separator:adb045765987e76c7ad4b511fab0c867e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef942e7f9e5c2e58c58644ab1bdd58d1" id="r_aef942e7f9e5c2e58c58644ab1bdd58d1"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#aef942e7f9e5c2e58c58644ab1bdd58d1">metal::fast::log</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:aef942e7f9e5c2e58c58644ab1bdd58d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d1150cf2deee5100a7ea2988b3bb39e" id="r_a0d1150cf2deee5100a7ea2988b3bb39e"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a0d1150cf2deee5100a7ea2988b3bb39e">metal::fast::log10</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a0d1150cf2deee5100a7ea2988b3bb39e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a986ef245dd433ae62af864f5cbb07118" id="r_a986ef245dd433ae62af864f5cbb07118"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a986ef245dd433ae62af864f5cbb07118">metal::fast::log2</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a986ef245dd433ae62af864f5cbb07118"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a747e2e58092a27fb8b4dd3d16934fb52" id="r_a747e2e58092a27fb8b4dd3d16934fb52"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a747e2e58092a27fb8b4dd3d16934fb52">metal::fast::max</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a747e2e58092a27fb8b4dd3d16934fb52"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fc2cf18ffa8149561864c86dba0f803" id="r_a6fc2cf18ffa8149561864c86dba0f803"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a6fc2cf18ffa8149561864c86dba0f803">metal::fast::max3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a6fc2cf18ffa8149561864c86dba0f803"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a742b55f1e4369921ee7f60d70185bfbc" id="r_a742b55f1e4369921ee7f60d70185bfbc"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a742b55f1e4369921ee7f60d70185bfbc">metal::fast::median3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a742b55f1e4369921ee7f60d70185bfbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e958e56a4712687c381a0b64d123e61" id="r_a3e958e56a4712687c381a0b64d123e61"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a3e958e56a4712687c381a0b64d123e61">metal::fast::min</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a3e958e56a4712687c381a0b64d123e61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a606a4c1b34ce05ea89ca5af81724036f" id="r_a606a4c1b34ce05ea89ca5af81724036f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a606a4c1b34ce05ea89ca5af81724036f">metal::fast::min3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a606a4c1b34ce05ea89ca5af81724036f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4583e8be04fc0bd475b97b0934604f23" id="r_a4583e8be04fc0bd475b97b0934604f23"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a4583e8be04fc0bd475b97b0934604f23">metal::fast::nextafter</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a4583e8be04fc0bd475b97b0934604f23"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade2367eaec894bd2e14a1351c363e003" id="r_ade2367eaec894bd2e14a1351c363e003"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#ade2367eaec894bd2e14a1351c363e003">metal::fast::pow</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:ade2367eaec894bd2e14a1351c363e003"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4293cbc94175b4dcc724fe4747eb5d5a" id="r_a4293cbc94175b4dcc724fe4747eb5d5a"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a4293cbc94175b4dcc724fe4747eb5d5a">metal::fast::powr</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a4293cbc94175b4dcc724fe4747eb5d5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa613bc252f8d8069e175ec9e9d05a7ec" id="r_aa613bc252f8d8069e175ec9e9d05a7ec"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#aa613bc252f8d8069e175ec9e9d05a7ec">metal::fast::rint</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:aa613bc252f8d8069e175ec9e9d05a7ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4cb687257a004726d49e496417eaa40f" id="r_a4cb687257a004726d49e496417eaa40f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a4cb687257a004726d49e496417eaa40f">metal::fast::round</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a4cb687257a004726d49e496417eaa40f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa62097c750f1e4b69d09277f19976ab1" id="r_aa62097c750f1e4b69d09277f19976ab1"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#aa62097c750f1e4b69d09277f19976ab1">metal::fast::rsqrt</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:aa62097c750f1e4b69d09277f19976ab1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3af771cfe7a135104f9d063147dba270" id="r_a3af771cfe7a135104f9d063147dba270"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a3af771cfe7a135104f9d063147dba270">metal::fast::sin</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a3af771cfe7a135104f9d063147dba270"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a990d90b3440e38d1fb4ff5065c6c189b" id="r_a990d90b3440e38d1fb4ff5065c6c189b"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a990d90b3440e38d1fb4ff5065c6c189b">metal::fast::sinh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a990d90b3440e38d1fb4ff5065c6c189b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab07a32fe544aa304577d29e0251e87b2" id="r_ab07a32fe544aa304577d29e0251e87b2"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#ab07a32fe544aa304577d29e0251e87b2">metal::fast::sinpi</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ab07a32fe544aa304577d29e0251e87b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4218a85c7d8a74cb8055b4755205627e" id="r_a4218a85c7d8a74cb8055b4755205627e"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a4218a85c7d8a74cb8055b4755205627e">metal::fast::sqrt</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a4218a85c7d8a74cb8055b4755205627e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae34754afa152a6170ac2ae3294174506" id="r_ae34754afa152a6170ac2ae3294174506"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#ae34754afa152a6170ac2ae3294174506">metal::fast::tan</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ae34754afa152a6170ac2ae3294174506"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13e6e6ae087b7c558e9a94ddbc864d43" id="r_a13e6e6ae087b7c558e9a94ddbc864d43"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a13e6e6ae087b7c558e9a94ddbc864d43">metal::fast::tanh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a13e6e6ae087b7c558e9a94ddbc864d43"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39b2952d4adf1400016c63243798aaf8" id="r_a39b2952d4adf1400016c63243798aaf8"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#a39b2952d4adf1400016c63243798aaf8">metal::fast::tanpi</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a39b2952d4adf1400016c63243798aaf8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa62e1075e86c626d97038f16e9433415" id="r_aa62e1075e86c626d97038f16e9433415"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1fast.html#aa62e1075e86c626d97038f16e9433415">metal::fast::trunc</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:aa62e1075e86c626d97038f16e9433415"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a99f2b2746e813b9ca7b4249afbaf2a14" id="r_a99f2b2746e813b9ca7b4249afbaf2a14"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a99f2b2746e813b9ca7b4249afbaf2a14">metal::precise::abs</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a99f2b2746e813b9ca7b4249afbaf2a14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a2bcc89fc0b7e74f0453f82f89a8604" id="r_a8a2bcc89fc0b7e74f0453f82f89a8604"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a8a2bcc89fc0b7e74f0453f82f89a8604">metal::precise::acos</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a8a2bcc89fc0b7e74f0453f82f89a8604"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f489fabffab969b8677b56bb1136067" id="r_a1f489fabffab969b8677b56bb1136067"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a1f489fabffab969b8677b56bb1136067">metal::precise::acosh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a1f489fabffab969b8677b56bb1136067"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc7b8b6e12e320cb32030f728dcbf438" id="r_adc7b8b6e12e320cb32030f728dcbf438"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#adc7b8b6e12e320cb32030f728dcbf438">metal::precise::asin</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:adc7b8b6e12e320cb32030f728dcbf438"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaad1cdde6687c8011fbc5fda1bb13424" id="r_aaad1cdde6687c8011fbc5fda1bb13424"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#aaad1cdde6687c8011fbc5fda1bb13424">metal::precise::asinh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:aaad1cdde6687c8011fbc5fda1bb13424"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaaf4b5f4786a912089bbf0ae7619a6be" id="r_aaaf4b5f4786a912089bbf0ae7619a6be"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#aaaf4b5f4786a912089bbf0ae7619a6be">metal::precise::atan</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y_over_x)</td></tr>
<tr class="separator:aaaf4b5f4786a912089bbf0ae7619a6be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f161b049cc6884f87b09b33c2d1cd7f" id="r_a6f161b049cc6884f87b09b33c2d1cd7f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a6f161b049cc6884f87b09b33c2d1cd7f">metal::precise::atan2</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a6f161b049cc6884f87b09b33c2d1cd7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a902994837653b90c47f4285673e712c4" id="r_a902994837653b90c47f4285673e712c4"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a902994837653b90c47f4285673e712c4">metal::precise::atanh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a902994837653b90c47f4285673e712c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8577549a1afeea206dd9a2004af2868d" id="r_a8577549a1afeea206dd9a2004af2868d"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a8577549a1afeea206dd9a2004af2868d">metal::precise::ceil</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a8577549a1afeea206dd9a2004af2868d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4941f62e7d8ab9d7cabbd967aa9f220" id="r_ac4941f62e7d8ab9d7cabbd967aa9f220"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#ac4941f62e7d8ab9d7cabbd967aa9f220">metal::precise::cos</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ac4941f62e7d8ab9d7cabbd967aa9f220"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a72d86d508300a9b58f4ccbbe70da4fbc" id="r_a72d86d508300a9b58f4ccbbe70da4fbc"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a72d86d508300a9b58f4ccbbe70da4fbc">metal::precise::cosh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a72d86d508300a9b58f4ccbbe70da4fbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2392b78bd196efdbbac65901c4ab20e7" id="r_a2392b78bd196efdbbac65901c4ab20e7"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a2392b78bd196efdbbac65901c4ab20e7">metal::precise::cospi</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a2392b78bd196efdbbac65901c4ab20e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec0982cdb96a08b61f51129150d82e9d" id="r_aec0982cdb96a08b61f51129150d82e9d"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#aec0982cdb96a08b61f51129150d82e9d">metal::precise::divide</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:aec0982cdb96a08b61f51129150d82e9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d8d2d5700ce432b33cf47cf22528e8f" id="r_a8d8d2d5700ce432b33cf47cf22528e8f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a8d8d2d5700ce432b33cf47cf22528e8f">metal::precise::exp</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a8d8d2d5700ce432b33cf47cf22528e8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9addb343c967da3a83e9e123a8521fd" id="r_af9addb343c967da3a83e9e123a8521fd"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#af9addb343c967da3a83e9e123a8521fd">metal::precise::exp10</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:af9addb343c967da3a83e9e123a8521fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92a880bd2197efc0da0f8f0f7ec1e4c9" id="r_a92a880bd2197efc0da0f8f0f7ec1e4c9"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a92a880bd2197efc0da0f8f0f7ec1e4c9">metal::precise::exp2</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a92a880bd2197efc0da0f8f0f7ec1e4c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4c71d8bc8ef291036a7aaa05f8be3d1" id="r_ae4c71d8bc8ef291036a7aaa05f8be3d1"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#ae4c71d8bc8ef291036a7aaa05f8be3d1">metal::precise::fabs</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ae4c71d8bc8ef291036a7aaa05f8be3d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af693e7c93de446e80dd1377f5e9e7260" id="r_af693e7c93de446e80dd1377f5e9e7260"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#af693e7c93de446e80dd1377f5e9e7260">metal::precise::fdim</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:af693e7c93de446e80dd1377f5e9e7260"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66e02b028e3cecfe7c80773460dc7925" id="r_a66e02b028e3cecfe7c80773460dc7925"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a66e02b028e3cecfe7c80773460dc7925">metal::precise::floor</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a66e02b028e3cecfe7c80773460dc7925"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49391a64d6b66fe3a212516b316a2144" id="r_a49391a64d6b66fe3a212516b316a2144"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a49391a64d6b66fe3a212516b316a2144">metal::precise::fma</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a49391a64d6b66fe3a212516b316a2144"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7d49f921c2883caf9eec66efc4de1cd" id="r_ac7d49f921c2883caf9eec66efc4de1cd"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#ac7d49f921c2883caf9eec66efc4de1cd">metal::precise::fmax</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:ac7d49f921c2883caf9eec66efc4de1cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf750e51bd83d569994d0967029e3bdc" id="r_adf750e51bd83d569994d0967029e3bdc"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#adf750e51bd83d569994d0967029e3bdc">metal::precise::fmax3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:adf750e51bd83d569994d0967029e3bdc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48d1d0be889de4043b775bb6b030a989" id="r_a48d1d0be889de4043b775bb6b030a989"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a48d1d0be889de4043b775bb6b030a989">metal::precise::fmedian3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a48d1d0be889de4043b775bb6b030a989"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a18df8eb481dfa56c92ad31b5bab8e069" id="r_a18df8eb481dfa56c92ad31b5bab8e069"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a18df8eb481dfa56c92ad31b5bab8e069">metal::precise::fmin</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a18df8eb481dfa56c92ad31b5bab8e069"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bb710e6742996d32225a8f54a0f116c" id="r_a5bb710e6742996d32225a8f54a0f116c"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a5bb710e6742996d32225a8f54a0f116c">metal::precise::fmin3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a5bb710e6742996d32225a8f54a0f116c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa99937178a1fc8158054e328eeeae648" id="r_aa99937178a1fc8158054e328eeeae648"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#aa99937178a1fc8158054e328eeeae648">metal::precise::fmod</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:aa99937178a1fc8158054e328eeeae648"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f21c19332a90df1a8ff507a813b5757" id="r_a0f21c19332a90df1a8ff507a813b5757"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a0f21c19332a90df1a8ff507a813b5757">metal::precise::fract</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a0f21c19332a90df1a8ff507a813b5757"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0fbb1624c308b97380f894f92fd858b4" id="r_a0fbb1624c308b97380f894f92fd858b4"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a0fbb1624c308b97380f894f92fd858b4">metal::precise::frexp</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, thread int &amp;<a class="el" href="namespacemetal_1_1precise.html#a8d8d2d5700ce432b33cf47cf22528e8f">exp</a>)</td></tr>
<tr class="separator:a0fbb1624c308b97380f894f92fd858b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0462827a08a9f475fdaeb104c98b6ab" id="r_aa0462827a08a9f475fdaeb104c98b6ab"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#aa0462827a08a9f475fdaeb104c98b6ab">metal::precise::ldexp</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, int k)</td></tr>
<tr class="separator:aa0462827a08a9f475fdaeb104c98b6ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a341c2b8c27d1bed860f85f8b355023d4" id="r_a341c2b8c27d1bed860f85f8b355023d4"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a341c2b8c27d1bed860f85f8b355023d4">metal::precise::log</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a341c2b8c27d1bed860f85f8b355023d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44239067e8e9248b1574353f98e94d72" id="r_a44239067e8e9248b1574353f98e94d72"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a44239067e8e9248b1574353f98e94d72">metal::precise::log10</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a44239067e8e9248b1574353f98e94d72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a632dbbdcc1a465cf4739a14306147573" id="r_a632dbbdcc1a465cf4739a14306147573"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a632dbbdcc1a465cf4739a14306147573">metal::precise::log2</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a632dbbdcc1a465cf4739a14306147573"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6a954a4e4e3753303d1dc734855a185f" id="r_a6a954a4e4e3753303d1dc734855a185f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a6a954a4e4e3753303d1dc734855a185f">metal::precise::max</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a6a954a4e4e3753303d1dc734855a185f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac490e8614ebd2c9343af1ae6c0d4e82c" id="r_ac490e8614ebd2c9343af1ae6c0d4e82c"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#ac490e8614ebd2c9343af1ae6c0d4e82c">metal::precise::max3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:ac490e8614ebd2c9343af1ae6c0d4e82c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14555ff99c4388493fec48e070144ae2" id="r_a14555ff99c4388493fec48e070144ae2"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a14555ff99c4388493fec48e070144ae2">metal::precise::median3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a14555ff99c4388493fec48e070144ae2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afed0da2f7df3505b5dffa2389c3cb36e" id="r_afed0da2f7df3505b5dffa2389c3cb36e"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#afed0da2f7df3505b5dffa2389c3cb36e">metal::precise::min</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:afed0da2f7df3505b5dffa2389c3cb36e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d37ce31c3549ca4772a4ee29798e231" id="r_a4d37ce31c3549ca4772a4ee29798e231"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a4d37ce31c3549ca4772a4ee29798e231">metal::precise::min3</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> z)</td></tr>
<tr class="separator:a4d37ce31c3549ca4772a4ee29798e231"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad012ceeb55b77f1533749b351331e026" id="r_ad012ceeb55b77f1533749b351331e026"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#ad012ceeb55b77f1533749b351331e026">metal::precise::nextafter</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:ad012ceeb55b77f1533749b351331e026"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4cce64f1f20c1c6dfd29115bdb7c8d42" id="r_a4cce64f1f20c1c6dfd29115bdb7c8d42"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a4cce64f1f20c1c6dfd29115bdb7c8d42">metal::precise::pow</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:a4cce64f1f20c1c6dfd29115bdb7c8d42"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9dbab0bd99b2b94e364aba5353bdcd7" id="r_ac9dbab0bd99b2b94e364aba5353bdcd7"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#ac9dbab0bd99b2b94e364aba5353bdcd7">metal::precise::powr</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> y)</td></tr>
<tr class="separator:ac9dbab0bd99b2b94e364aba5353bdcd7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab17bd408098270ad92f37bcd1039c254" id="r_ab17bd408098270ad92f37bcd1039c254"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#ab17bd408098270ad92f37bcd1039c254">metal::precise::rint</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:ab17bd408098270ad92f37bcd1039c254"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5295ab08055d12534cc3775da855ac12" id="r_a5295ab08055d12534cc3775da855ac12"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a5295ab08055d12534cc3775da855ac12">metal::precise::round</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a5295ab08055d12534cc3775da855ac12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb397b477745f12a44423934fa2b05ac" id="r_afb397b477745f12a44423934fa2b05ac"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#afb397b477745f12a44423934fa2b05ac">metal::precise::rsqrt</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:afb397b477745f12a44423934fa2b05ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71acf77ffd29c56f56afae0195c98a1c" id="r_a71acf77ffd29c56f56afae0195c98a1c"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a71acf77ffd29c56f56afae0195c98a1c">metal::precise::sin</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a71acf77ffd29c56f56afae0195c98a1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abc8f4f59dd6e7204ab5d84f0af96331c" id="r_abc8f4f59dd6e7204ab5d84f0af96331c"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#abc8f4f59dd6e7204ab5d84f0af96331c">metal::precise::sinh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:abc8f4f59dd6e7204ab5d84f0af96331c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78b17dab93519d9c82c2575dafec49c9" id="r_a78b17dab93519d9c82c2575dafec49c9"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a78b17dab93519d9c82c2575dafec49c9">metal::precise::sinpi</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a78b17dab93519d9c82c2575dafec49c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb213467361cd2cab93a8d5ea1aa5bfd" id="r_acb213467361cd2cab93a8d5ea1aa5bfd"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#acb213467361cd2cab93a8d5ea1aa5bfd">metal::precise::sqrt</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:acb213467361cd2cab93a8d5ea1aa5bfd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8261ed22f03122ef15b89512358acb1f" id="r_a8261ed22f03122ef15b89512358acb1f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a8261ed22f03122ef15b89512358acb1f">metal::precise::tan</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a8261ed22f03122ef15b89512358acb1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a741c27a10cc968dd1e63473d9fcd8f99" id="r_a741c27a10cc968dd1e63473d9fcd8f99"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a741c27a10cc968dd1e63473d9fcd8f99">metal::precise::tanh</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a741c27a10cc968dd1e63473d9fcd8f99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8fae8c20deff43a8e855bba6f3ba20a5" id="r_a8fae8c20deff43a8e855bba6f3ba20a5"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a8fae8c20deff43a8e855bba6f3ba20a5">metal::precise::tanpi</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a8fae8c20deff43a8e855bba6f3ba20a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a334183e7a2dd49b983d072d1e8ee2b27" id="r_a334183e7a2dd49b983d072d1e8ee2b27"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal_1_1precise.html#a334183e7a2dd49b983d072d1e8ee2b27">metal::precise::trunc</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> x)</td></tr>
<tr class="separator:a334183e7a2dd49b983d072d1e8ee2b27"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a498f1e85107eb5f01ba4435977f8efe0" id="r_a498f1e85107eb5f01ba4435977f8efe0"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a498f1e85107eb5f01ba4435977f8efe0">metal::simd_broadcast</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data, ushort broadcast_lane_id)</td></tr>
<tr class="separator:a498f1e85107eb5f01ba4435977f8efe0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a259ed115bc3c58f88eb35830916b26d4" id="r_a259ed115bc3c58f88eb35830916b26d4"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a259ed115bc3c58f88eb35830916b26d4">metal::simd_shuffle</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data, ushort simd_lane_id)</td></tr>
<tr class="separator:a259ed115bc3c58f88eb35830916b26d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae29a06f0eac636ad7af21dea5b04938b" id="r_ae29a06f0eac636ad7af21dea5b04938b"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ae29a06f0eac636ad7af21dea5b04938b">metal::simd_shuffle_and_fill_down</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> filling_data, ushort delta, ushort modulo)</td></tr>
<tr class="separator:ae29a06f0eac636ad7af21dea5b04938b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ee6239fa29a5f9ee0201e0dc5ddc8e0" id="r_a0ee6239fa29a5f9ee0201e0dc5ddc8e0"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a0ee6239fa29a5f9ee0201e0dc5ddc8e0">metal::simd_shuffle_and_fill_down</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> filling_data, ushort delta)</td></tr>
<tr class="separator:a0ee6239fa29a5f9ee0201e0dc5ddc8e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ca14116bf50639b214d8414b5bbaaa6" id="r_a1ca14116bf50639b214d8414b5bbaaa6"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a1ca14116bf50639b214d8414b5bbaaa6">metal::simd_shuffle_and_fill_up</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> filling_data, ushort delta, ushort modulo)</td></tr>
<tr class="separator:a1ca14116bf50639b214d8414b5bbaaa6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5138d5cdc18139e135707916a243cd8e" id="r_a5138d5cdc18139e135707916a243cd8e"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a5138d5cdc18139e135707916a243cd8e">metal::simd_shuffle_and_fill_up</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data, <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> filling_data, ushort delta)</td></tr>
<tr class="separator:a5138d5cdc18139e135707916a243cd8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af6e2dd7ae087aba6abac4f0350b7611c" id="r_af6e2dd7ae087aba6abac4f0350b7611c"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#af6e2dd7ae087aba6abac4f0350b7611c">metal::simd_shuffle_down</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data, ushort delta)</td></tr>
<tr class="separator:af6e2dd7ae087aba6abac4f0350b7611c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4bb203647a421032db47e73cd649841b" id="r_a4bb203647a421032db47e73cd649841b"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a4bb203647a421032db47e73cd649841b">metal::simd_shuffle_rotate_down</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data, ushort delta)</td></tr>
<tr class="separator:a4bb203647a421032db47e73cd649841b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a729b22077d6c944491a6027c18ea80c9" id="r_a729b22077d6c944491a6027c18ea80c9"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a729b22077d6c944491a6027c18ea80c9">metal::simd_shuffle_rotate_up</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data, ushort delta)</td></tr>
<tr class="separator:a729b22077d6c944491a6027c18ea80c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe81c5fbde3f4890458b081909242c55" id="r_afe81c5fbde3f4890458b081909242c55"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#afe81c5fbde3f4890458b081909242c55">metal::simd_shuffle_up</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data, ushort delta)</td></tr>
<tr class="separator:afe81c5fbde3f4890458b081909242c55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5017efc9605e069cfb507137cd1a1852" id="r_a5017efc9605e069cfb507137cd1a1852"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a5017efc9605e069cfb507137cd1a1852">metal::simd_shuffle_xor</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data, ushort mask)</td></tr>
<tr class="separator:a5017efc9605e069cfb507137cd1a1852"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a048cad0aca52cb737ebf103e76bd1c49" id="r_a048cad0aca52cb737ebf103e76bd1c49"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a048cad0aca52cb737ebf103e76bd1c49">metal::simd_max</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data)</td></tr>
<tr class="separator:a048cad0aca52cb737ebf103e76bd1c49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae9e2a23e00724ba2d7868bc4112b386b" id="r_ae9e2a23e00724ba2d7868bc4112b386b"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ae9e2a23e00724ba2d7868bc4112b386b">metal::simd_min</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data)</td></tr>
<tr class="separator:ae9e2a23e00724ba2d7868bc4112b386b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5ca40242390b632f737e29636829b2e4" id="r_a5ca40242390b632f737e29636829b2e4"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a5ca40242390b632f737e29636829b2e4">metal::simd_prefix_exclusive_product</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data)</td></tr>
<tr class="separator:a5ca40242390b632f737e29636829b2e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abfbb70c7471f28bf7ff36a612ad014b2" id="r_abfbb70c7471f28bf7ff36a612ad014b2"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#abfbb70c7471f28bf7ff36a612ad014b2">metal::simd_prefix_exclusive_sum</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data)</td></tr>
<tr class="separator:abfbb70c7471f28bf7ff36a612ad014b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ca6a7e1996228fa536e969e9e45c446" id="r_a6ca6a7e1996228fa536e969e9e45c446"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a6ca6a7e1996228fa536e969e9e45c446">metal::simd_prefix_inclusive_product</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data)</td></tr>
<tr class="separator:a6ca6a7e1996228fa536e969e9e45c446"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a567acb18199ac0107712eb8cb8aeb8e9" id="r_a567acb18199ac0107712eb8cb8aeb8e9"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a567acb18199ac0107712eb8cb8aeb8e9">metal::simd_prefix_inclusive_sum</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data)</td></tr>
<tr class="separator:a567acb18199ac0107712eb8cb8aeb8e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac6e883a04e2265a9790d7db76059e1b4" id="r_ac6e883a04e2265a9790d7db76059e1b4"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#ac6e883a04e2265a9790d7db76059e1b4">metal::simd_product</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data)</td></tr>
<tr class="separator:ac6e883a04e2265a9790d7db76059e1b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85181e37a00cb4a4217f1bb25389bce5" id="r_a85181e37a00cb4a4217f1bb25389bce5"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a85181e37a00cb4a4217f1bb25389bce5">metal::simd_sum</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data)</td></tr>
<tr class="separator:a85181e37a00cb4a4217f1bb25389bce5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1308decbf2d5c33d34d6be523ea1c30f" id="r_a1308decbf2d5c33d34d6be523ea1c30f"><td class="memItemLeft" align="right" valign="top">METAL_FUNC <a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemetal.html#a1308decbf2d5c33d34d6be523ea1c30f">metal::simd_xor</a> (<a class="el" href="backend_2metal_2kernels_2bf16_8h.html#a7782de82393104dd4ad754ce3b316e82">bfloat16_t</a> data)</td></tr>
<tr class="separator:a1308decbf2d5c33d34d6be523ea1c30f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a51cfdd4502e755310f6f3456f039bea7" name="a51cfdd4502e755310f6f3456f039bea7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51cfdd4502e755310f6f3456f039bea7">&#9670;&#160;</a></span>bfloat16_to_uint16</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define bfloat16_to_uint16</td>
<td>(</td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">x</span></td><td>)</td>
<td>&#160;&#160;&#160;x.bits_</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a9e9f0fdd6e304522bc88acd22c576842" name="a9e9f0fdd6e304522bc88acd22c576842"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e9f0fdd6e304522bc88acd22c576842">&#9670;&#160;</a></span>instantiate_metal_math_funcs</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define instantiate_metal_math_funcs</td>
<td>(</td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">itype, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">otype, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">ctype, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">mfast</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aecc11cb898846d01bfc9faa109fcf791" name="aecc11cb898846d01bfc9faa109fcf791"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aecc11cb898846d01bfc9faa109fcf791">&#9670;&#160;</a></span>instantiate_metal_simd_comm_funcs</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define instantiate_metal_simd_comm_funcs</td>
<td>(</td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">itype, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">otype, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">ctype, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">itype_to_ctype, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">ctype_to_otype</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a51688bc24fc9292aaec5f54a58eaa2d0" name="a51688bc24fc9292aaec5f54a58eaa2d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51688bc24fc9292aaec5f54a58eaa2d0">&#9670;&#160;</a></span>instantiate_metal_simd_reduction_funcs</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define instantiate_metal_simd_reduction_funcs</td>
<td>(</td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">itype, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">otype, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">ctype</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a030d871474c0e7d907fccffcc8c047e0" name="a030d871474c0e7d907fccffcc8c047e0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a030d871474c0e7d907fccffcc8c047e0">&#9670;&#160;</a></span>uint16_to_bfloat16</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define uint16_to_bfloat16</td>
<td>(</td>
<td class="paramtype"></td> <td class="paramname"><span class="paramname">x</span></td><td>)</td>
<td>&#160;&#160;&#160;<a class="el" href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a>(x, <a class="el" href="struct___m_l_x___b_float16.html#a91ccb774773b65f8d4c1aea3f1c6e1ca">_MLX_BFloat16::bits_to_bfloat</a>())</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,498 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/bf16_math.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">bf16_math.h</div></div>
</div><!--header-->
<div class="contents">
<a href="bf16__math_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &quot;<a class="code" href="backend_2metal_2kernels_2bf16_8h.html">mlx/backend/metal/kernels/bf16.h</a>&quot;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// Metal math for bfloat16</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">/*</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment"></span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment">Following the Metal Shading Language Specification (Metal 3.1)</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment"></span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">&quot;bfloat is an extended itypeing point type that only allows implicit conversion</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment"> to a type of greater itypeing point rank. While bfloat can be implicitly</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment"> converted to itype, it cannot be implicitly converted to half, and neither</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment"> itype nor half can be implicitly converted to bfloat.&quot;</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment"></span> </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">Further, as far as I can tell, the stdlib math/simd functions are not defined</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment">for bfloat and calling with an argument of type bfloat will result in that</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">argument getting implicitly converted to itype which then returns an output</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">that is (likely) a itype which cannot be implicitly converted into a bfloat</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment"></span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">This leads to situations where</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">bfloat a = 5.0bf;</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">bfloat b = metal::abs(a); // this will throw an error since abs return itype</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment">bfloat c = static_cast&lt;bfloat&gt;(metal::abs(a)); // this is fine</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment"></span> </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="comment">For the moment, I will be adding overloaded instantiations of the math</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="comment">functions to accordingly automatically handle the casting</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="comment"></span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="comment">*/</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="foldopen" id="foldopen00035" data-start="" data-end="">
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="bf16__math_8h.html#a9e9f0fdd6e304522bc88acd22c576842"> 35</a></span><span class="preprocessor">#define instantiate_metal_math_funcs(itype, otype, ctype, mfast) \</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="preprocessor"> METAL_FUNC otype abs(itype x) { \</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_fabs(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="preprocessor"> METAL_FUNC otype acos(itype x) { \</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_acos(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="preprocessor"> METAL_FUNC otype acosh(itype x) { \</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_acosh(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="preprocessor"> METAL_FUNC otype asin(itype x) { \</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_asin(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="preprocessor"> METAL_FUNC otype asinh(itype x) { \</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_asinh(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="preprocessor"> METAL_FUNC otype atan(itype y_over_x) { \</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="preprocessor"> __metal_atan(static_cast&lt;ctype&gt;(y_over_x), mfast)); \</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="preprocessor"> METAL_FUNC otype atan2(itype y, itype x) { \</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="preprocessor"> __metal_atan2(static_cast&lt;ctype&gt;(y), static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="preprocessor"> METAL_FUNC otype atanh(itype x) { \</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_atanh(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="preprocessor"> METAL_FUNC otype ceil(itype x) { \</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_ceil(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="preprocessor"> METAL_FUNC otype cos(itype x) { \</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_cos(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="preprocessor"> METAL_FUNC otype cosh(itype x) { \</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_cosh(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="preprocessor"> METAL_FUNC otype cospi(itype x) { \</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_cospi(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span><span class="preprocessor"> METAL_FUNC otype divide(itype x, itype y) { \</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="preprocessor"> __metal_divide(static_cast&lt;ctype&gt;(x), static_cast&lt;ctype&gt;(y), mfast)); \</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span><span class="preprocessor"> METAL_FUNC otype exp(itype x) { \</span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_exp(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span><span class="preprocessor"> METAL_FUNC otype exp10(itype x) { \</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_exp10(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="preprocessor"> METAL_FUNC otype exp2(itype x) { \</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_exp2(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="preprocessor"> METAL_FUNC otype fabs(itype x) { \</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_fabs(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><span class="preprocessor"> METAL_FUNC otype fdim(itype x, itype y) { \</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="preprocessor"> ctype t = static_cast&lt;ctype&gt;(x - y); \</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span><span class="preprocessor"> return static_cast&lt;otype&gt;(select(t, ctype(0), t &lt; ctype(0) || x == y)); \</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span><span class="preprocessor"> METAL_FUNC otype floor(itype x) { \</span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_floor(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="preprocessor"> METAL_FUNC otype fma(itype x, itype y, itype z) { \</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_fma( \</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="preprocessor"> static_cast&lt;ctype&gt;(x), static_cast&lt;ctype&gt;(y), static_cast&lt;ctype&gt;(z))); \</span></div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="preprocessor"> METAL_FUNC otype fmax(itype x, itype y) { \</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="preprocessor"> __metal_fmax(static_cast&lt;ctype&gt;(x), static_cast&lt;ctype&gt;(y), mfast)); \</span></div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span><span class="preprocessor"> METAL_FUNC otype fmax3(itype x, itype y, itype z) { \</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_fmax3( \</span></div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span><span class="preprocessor"> static_cast&lt;ctype&gt;(x), \</span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span><span class="preprocessor"> static_cast&lt;ctype&gt;(y), \</span></div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span><span class="preprocessor"> static_cast&lt;ctype&gt;(z), \</span></div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span><span class="preprocessor"> mfast)); \</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span><span class="preprocessor"> METAL_FUNC otype fmedian3(itype x, itype y, itype z) { \</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_fmedian3( \</span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span><span class="preprocessor"> static_cast&lt;ctype&gt;(x), \</span></div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span><span class="preprocessor"> static_cast&lt;ctype&gt;(y), \</span></div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span><span class="preprocessor"> static_cast&lt;ctype&gt;(z), \</span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span><span class="preprocessor"> mfast)); \</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"> METAL_FUNC otype fmin(itype x, itype y) { \</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span><span class="preprocessor"> __metal_fmin(static_cast&lt;ctype&gt;(x), static_cast&lt;ctype&gt;(y), mfast)); \</span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span><span class="preprocessor"> METAL_FUNC otype fmin3(itype x, itype y, itype z) { \</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_fmin3( \</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span><span class="preprocessor"> static_cast&lt;ctype&gt;(x), \</span></div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span><span class="preprocessor"> static_cast&lt;ctype&gt;(y), \</span></div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span><span class="preprocessor"> static_cast&lt;ctype&gt;(z), \</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span><span class="preprocessor"> mfast)); \</span></div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span><span class="preprocessor"> METAL_FUNC otype fmod(itype x, itype y) { \</span></div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span><span class="preprocessor"> __metal_fmod(static_cast&lt;ctype&gt;(x), static_cast&lt;ctype&gt;(y), mfast)); \</span></div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span><span class="preprocessor"> METAL_FUNC otype fract(itype x) { \</span></div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_fract(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span><span class="preprocessor"> METAL_FUNC otype frexp(itype x, thread int&amp; exp) { \</span></div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_frexp(static_cast&lt;ctype&gt;(x), &amp;exp)); \</span></div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span><span class="preprocessor"> METAL_FUNC otype ldexp(itype x, int k) { \</span></div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_ldexp(static_cast&lt;ctype&gt;(x), k, mfast)); \</span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span><span class="preprocessor"> METAL_FUNC otype log(itype x) { \</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_log(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span><span class="preprocessor"> METAL_FUNC otype log10(itype x) { \</span></div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_log10(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span><span class="preprocessor"> METAL_FUNC otype log2(itype x) { \</span></div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_log2(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span><span class="preprocessor"> METAL_FUNC otype max(itype x, itype y) { \</span></div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span><span class="preprocessor"> __metal_fmax(static_cast&lt;ctype&gt;(x), static_cast&lt;ctype&gt;(y), mfast)); \</span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span><span class="preprocessor"> METAL_FUNC otype max3(itype x, itype y, itype z) { \</span></div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_fmax3( \</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span><span class="preprocessor"> static_cast&lt;ctype&gt;(x), \</span></div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span><span class="preprocessor"> static_cast&lt;ctype&gt;(y), \</span></div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span><span class="preprocessor"> static_cast&lt;ctype&gt;(z), \</span></div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span><span class="preprocessor"> mfast)); \</span></div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span><span class="preprocessor"> METAL_FUNC otype median3(itype x, itype y, itype z) { \</span></div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_fmedian3( \</span></div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span><span class="preprocessor"> static_cast&lt;ctype&gt;(x), \</span></div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span><span class="preprocessor"> static_cast&lt;ctype&gt;(y), \</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span><span class="preprocessor"> static_cast&lt;ctype&gt;(z), \</span></div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span><span class="preprocessor"> mfast)); \</span></div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span><span class="preprocessor"> METAL_FUNC otype min(itype x, itype y) { \</span></div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span><span class="preprocessor"> __metal_fmin(static_cast&lt;ctype&gt;(x), static_cast&lt;ctype&gt;(y), mfast)); \</span></div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span><span class="preprocessor"> METAL_FUNC otype min3(itype x, itype y, itype z) { \</span></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_fmin3( \</span></div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span><span class="preprocessor"> static_cast&lt;ctype&gt;(x), \</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span><span class="preprocessor"> static_cast&lt;ctype&gt;(y), \</span></div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span><span class="preprocessor"> static_cast&lt;ctype&gt;(z), \</span></div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span><span class="preprocessor"> mfast)); \</span></div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span><span class="preprocessor"> METAL_FUNC otype nextafter(itype x, itype y) { \</span></div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span><span class="preprocessor"> __metal_nextafter(static_cast&lt;ctype&gt;(x), static_cast&lt;ctype&gt;(y))); \</span></div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span><span class="preprocessor"> METAL_FUNC otype pow(itype x, itype y) { \</span></div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span><span class="preprocessor"> __metal_pow(static_cast&lt;ctype&gt;(x), static_cast&lt;ctype&gt;(y), mfast)); \</span></div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span><span class="preprocessor"> METAL_FUNC otype powr(itype x, itype y) { \</span></div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span><span class="preprocessor"> __metal_powr(static_cast&lt;ctype&gt;(x), static_cast&lt;ctype&gt;(y), mfast)); \</span></div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span><span class="preprocessor"> METAL_FUNC otype rint(itype x) { \</span></div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_rint(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span><span class="preprocessor"> METAL_FUNC otype round(itype x) { \</span></div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_round(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span><span class="preprocessor"> METAL_FUNC otype rsqrt(itype x) { \</span></div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_rsqrt(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span><span class="preprocessor"> METAL_FUNC otype sin(itype x) { \</span></div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_sin(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span><span class="preprocessor"> METAL_FUNC otype sinh(itype x) { \</span></div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_sinh(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span><span class="preprocessor"> METAL_FUNC otype sinpi(itype x) { \</span></div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_sinpi(static_cast&lt;ctype&gt;(x), mfast)); \</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"> METAL_FUNC otype sqrt(itype x) { \</span></div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_sqrt(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span><span class="preprocessor"> METAL_FUNC otype tan(itype x) { \</span></div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_tan(static_cast&lt;ctype&gt;(x), mfast)); \</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"> METAL_FUNC otype tanh(itype x) { \</span></div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_tanh(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span><span class="preprocessor"> METAL_FUNC otype tanpi(itype x) { \</span></div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_tanpi(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span><span class="preprocessor"> METAL_FUNC otype trunc(itype x) { \</span></div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_trunc(static_cast&lt;ctype&gt;(x), mfast)); \</span></div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span><span class="preprocessor"> }</span></div>
</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> </div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemetal.html">metal</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><a class="code hl_define" href="bf16__math_8h.html#a9e9f0fdd6e304522bc88acd22c576842">instantiate_metal_math_funcs</a>(</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>,</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>,</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> <span class="keywordtype">float</span>,</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"><a class="line" href="namespacemetal.html#a87c5122c60f9a12afceb9925a5b78ffb"> 234</a></span> __METAL_MAYBE_FAST_MATH__);</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> </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="namespacemetal_1_1fast.html"> 236</a></span><span class="keyword">namespace </span>fast {</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> </div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span><a class="code hl_define" href="bf16__math_8h.html#a9e9f0fdd6e304522bc88acd22c576842">instantiate_metal_math_funcs</a>(</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>,</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>,</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> <span class="keywordtype">float</span>,</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"><a class="line" href="namespacemetal_1_1fast.html#a90d2973f71f83180e7f02e38d11c7a8f"> 242</a></span> __METAL_FAST_MATH__);</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> </div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span>} <span class="comment">// namespace fast</span></div>
</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</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="namespacemetal_1_1precise.html"> 246</a></span><span class="keyword">namespace </span>precise {</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> </div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span><a class="code hl_define" href="bf16__math_8h.html#a9e9f0fdd6e304522bc88acd22c576842">instantiate_metal_math_funcs</a>(</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>,</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>,</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> <span class="keywordtype">float</span>,</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"><a class="line" href="namespacemetal_1_1precise.html#a99f2b2746e813b9ca7b4249afbaf2a14"> 252</a></span> __METAL_PRECISE_MATH__);</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> </div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span>} <span class="comment">// namespace precise</span></div>
</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> </div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span>} <span class="comment">// namespace metal</span></div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> </div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span><span class="comment">// Metal simd for bfloat16</span></div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> </div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"><a class="line" href="bf16__math_8h.html#aecc11cb898846d01bfc9faa109fcf791"> 262</a></span><span class="preprocessor">#define instantiate_metal_simd_comm_funcs( \</span></div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span><span class="preprocessor"> itype, otype, ctype, itype_to_ctype, ctype_to_otype) \</span></div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span><span class="preprocessor"> METAL_FUNC otype simd_broadcast(itype data, ushort broadcast_lane_id) { \</span></div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span><span class="preprocessor"> return ctype_to_otype( \</span></div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span><span class="preprocessor"> __metal_simd_broadcast(itype_to_ctype(data), broadcast_lane_id)); \</span></div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span><span class="preprocessor"> METAL_FUNC otype simd_shuffle(itype data, ushort simd_lane_id) { \</span></div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span><span class="preprocessor"> return ctype_to_otype( \</span></div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span><span class="preprocessor"> __metal_simd_shuffle(itype_to_ctype(data), simd_lane_id)); \</span></div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span><span class="preprocessor"> METAL_FUNC otype simd_shuffle_and_fill_down( \</span></div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span><span class="preprocessor"> itype data, itype filling_data, ushort delta, ushort modulo) { \</span></div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span><span class="preprocessor"> return ctype_to_otype(__metal_simd_shuffle_and_fill_down( \</span></div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span><span class="preprocessor"> itype_to_ctype(data), itype_to_ctype(filling_data), delta, modulo)); \</span></div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span><span class="preprocessor"> METAL_FUNC otype simd_shuffle_and_fill_down( \</span></div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span><span class="preprocessor"> itype data, itype filling_data, ushort delta) { \</span></div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span><span class="preprocessor"> return ctype_to_otype(__metal_simd_shuffle_and_fill_down( \</span></div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span><span class="preprocessor"> itype_to_ctype(data), \</span></div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span><span class="preprocessor"> itype_to_ctype(filling_data), \</span></div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span><span class="preprocessor"> delta, \</span></div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span><span class="preprocessor"> __metal_get_simdgroup_size(ushort()))); \</span></div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span><span class="preprocessor"> METAL_FUNC otype simd_shuffle_and_fill_up( \</span></div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span><span class="preprocessor"> itype data, itype filling_data, ushort delta, ushort modulo) { \</span></div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span><span class="preprocessor"> return ctype_to_otype(__metal_simd_shuffle_and_fill_up( \</span></div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span><span class="preprocessor"> itype_to_ctype(data), itype_to_ctype(filling_data), delta, modulo)); \</span></div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span><span class="preprocessor"> METAL_FUNC otype simd_shuffle_and_fill_up( \</span></div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span><span class="preprocessor"> itype data, itype filling_data, ushort delta) { \</span></div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span><span class="preprocessor"> return ctype_to_otype(__metal_simd_shuffle_and_fill_up( \</span></div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span><span class="preprocessor"> itype_to_ctype(data), \</span></div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span><span class="preprocessor"> itype_to_ctype(filling_data), \</span></div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span><span class="preprocessor"> delta, \</span></div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span><span class="preprocessor"> __metal_get_simdgroup_size(ushort()))); \</span></div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span><span class="preprocessor"> METAL_FUNC otype simd_shuffle_down(itype data, ushort delta) { \</span></div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span><span class="preprocessor"> return ctype_to_otype( \</span></div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span><span class="preprocessor"> __metal_simd_shuffle_down(itype_to_ctype(data), delta)); \</span></div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span><span class="preprocessor"> METAL_FUNC otype simd_shuffle_rotate_down(itype data, ushort delta) { \</span></div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span><span class="preprocessor"> return ctype_to_otype( \</span></div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span><span class="preprocessor"> __metal_simd_shuffle_rotate_down(itype_to_ctype(data), delta)); \</span></div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span><span class="preprocessor"> METAL_FUNC otype simd_shuffle_rotate_up(itype data, ushort delta) { \</span></div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span><span class="preprocessor"> return ctype_to_otype( \</span></div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span><span class="preprocessor"> __metal_simd_shuffle_rotate_up(itype_to_ctype(data), delta)); \</span></div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span><span class="preprocessor"> METAL_FUNC otype simd_shuffle_up(itype data, ushort delta) { \</span></div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span><span class="preprocessor"> return ctype_to_otype( \</span></div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span><span class="preprocessor"> __metal_simd_shuffle_up(itype_to_ctype(data), delta)); \</span></div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span><span class="preprocessor"> METAL_FUNC otype simd_shuffle_xor(itype data, ushort mask) { \</span></div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span><span class="preprocessor"> return ctype_to_otype( \</span></div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span><span class="preprocessor"> __metal_simd_shuffle_xor(itype_to_ctype(data), mask)); \</span></div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span><span class="preprocessor"> }</span></div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> </div>
<div class="foldopen" id="foldopen00330" data-start="" data-end="">
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"><a class="line" href="bf16__math_8h.html#a51688bc24fc9292aaec5f54a58eaa2d0"> 330</a></span><span class="preprocessor">#define instantiate_metal_simd_reduction_funcs(itype, otype, ctype) \</span></div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno"> 332</span><span class="preprocessor"> METAL_FUNC otype simd_max(itype data) { \</span></div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"> 333</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_simd_max(static_cast&lt;ctype&gt;(data))); \</span></div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span><span class="preprocessor"> METAL_FUNC otype simd_min(itype data) { \</span></div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_simd_min(static_cast&lt;ctype&gt;(data))); \</span></div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span><span class="preprocessor"> METAL_FUNC otype simd_prefix_exclusive_product(itype data) { \</span></div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span><span class="preprocessor"> __metal_simd_prefix_exclusive_product(static_cast&lt;ctype&gt;(data))); \</span></div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span><span class="preprocessor"> METAL_FUNC otype simd_prefix_exclusive_sum(itype data) { \</span></div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno"> 347</span><span class="preprocessor"> __metal_simd_prefix_exclusive_sum(static_cast&lt;ctype&gt;(data))); \</span></div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno"> 348</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno"> 349</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno"> 350</span><span class="preprocessor"> METAL_FUNC otype simd_prefix_inclusive_product(itype data) { \</span></div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"> 351</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"> 352</span><span class="preprocessor"> __metal_simd_prefix_inclusive_product(static_cast&lt;ctype&gt;(data))); \</span></div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"> 354</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span><span class="preprocessor"> METAL_FUNC otype simd_prefix_inclusive_sum(itype data) { \</span></div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"> 356</span><span class="preprocessor"> return static_cast&lt;otype&gt;( \</span></div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span><span class="preprocessor"> __metal_simd_prefix_inclusive_sum(static_cast&lt;ctype&gt;(data))); \</span></div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"> 359</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"> 360</span><span class="preprocessor"> METAL_FUNC otype simd_product(itype data) { \</span></div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno"> 361</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_simd_product(static_cast&lt;ctype&gt;(data))); \</span></div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"> 362</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno"> 363</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno"> 364</span><span class="preprocessor"> METAL_FUNC otype simd_sum(itype data) { \</span></div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno"> 365</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_simd_sum(static_cast&lt;ctype&gt;(data))); \</span></div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno"> 366</span><span class="preprocessor"> } \</span></div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno"> 367</span><span class="preprocessor"> \</span></div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno"> 368</span><span class="preprocessor"> METAL_FUNC otype simd_xor(itype data) { \</span></div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno"> 369</span><span class="preprocessor"> return static_cast&lt;otype&gt;(__metal_simd_xor(static_cast&lt;ctype&gt;(data))); \</span></div>
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno"> 370</span><span class="preprocessor"> }</span></div>
</div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno"> 371</span> </div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno"> 372</span><span class="preprocessor">#if defined METAL_3_1 || (__METAL_VERSION__ &gt;= 310)</span></div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno"> 373</span> </div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno"> 374</span><span class="preprocessor">#define bfloat16_to_uint16(x) as_type&lt;uint16_t&gt;(x)</span></div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno"> 375</span><span class="preprocessor">#define uint16_to_bfloat16(x) as_type&lt;bfloat16_t&gt;(x)</span></div>
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno"> 376</span> </div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"> 377</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span> </div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno"><a class="line" href="bf16__math_8h.html#a51cfdd4502e755310f6f3456f039bea7"> 379</a></span><span class="preprocessor">#define bfloat16_to_uint16(x) x.bits_</span></div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno"><a class="line" href="bf16__math_8h.html#a030d871474c0e7d907fccffcc8c047e0"> 380</a></span><span class="preprocessor">#define uint16_to_bfloat16(x) _MLX_BFloat16(x, _MLX_BFloat16::bits_to_bfloat())</span></div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"> 381</span> </div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno"> 382</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno"> 383</span> </div>
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno"> 384</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemetal.html">metal</a> {</div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno"> 385</span> </div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno"> 386</span><a class="code hl_define" href="bf16__math_8h.html#aecc11cb898846d01bfc9faa109fcf791">instantiate_metal_simd_comm_funcs</a>(</div>
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno"> 387</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>,</div>
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno"> 388</span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>,</div>
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno"> 389</span> uint16_t,</div>
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno"> 390</span> <a class="code hl_define" href="bf16__math_8h.html#a51cfdd4502e755310f6f3456f039bea7">bfloat16_to_uint16</a>,</div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"><a class="line" href="namespacemetal.html#a498f1e85107eb5f01ba4435977f8efe0"> 391</a></span> <a class="code hl_define" href="bf16__math_8h.html#a030d871474c0e7d907fccffcc8c047e0">uint16_to_bfloat16</a>);</div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno"><a class="line" href="namespacemetal.html#a048cad0aca52cb737ebf103e76bd1c49"> 392</a></span><a class="code hl_define" href="bf16__math_8h.html#a51688bc24fc9292aaec5f54a58eaa2d0">instantiate_metal_simd_reduction_funcs</a>(<a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>, <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a>, <span class="keywordtype">float</span>);</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> </div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</span>} <span class="comment">// namespace metal</span></div>
<div class="ttc" id="abackend_2metal_2kernels_2bf16_8h_html"><div class="ttname"><a href="backend_2metal_2kernels_2bf16_8h.html">bf16.h</a></div></div>
<div class="ttc" id="abf16__math_8h_html_a030d871474c0e7d907fccffcc8c047e0"><div class="ttname"><a href="bf16__math_8h.html#a030d871474c0e7d907fccffcc8c047e0">uint16_to_bfloat16</a></div><div class="ttdeci">#define uint16_to_bfloat16(x)</div><div class="ttdef"><b>Definition</b> bf16_math.h:380</div></div>
<div class="ttc" id="abf16__math_8h_html_a51688bc24fc9292aaec5f54a58eaa2d0"><div class="ttname"><a href="bf16__math_8h.html#a51688bc24fc9292aaec5f54a58eaa2d0">instantiate_metal_simd_reduction_funcs</a></div><div class="ttdeci">#define instantiate_metal_simd_reduction_funcs(itype, otype, ctype)</div><div class="ttdef"><b>Definition</b> bf16_math.h:330</div></div>
<div class="ttc" id="abf16__math_8h_html_a51cfdd4502e755310f6f3456f039bea7"><div class="ttname"><a href="bf16__math_8h.html#a51cfdd4502e755310f6f3456f039bea7">bfloat16_to_uint16</a></div><div class="ttdeci">#define bfloat16_to_uint16(x)</div><div class="ttdef"><b>Definition</b> bf16_math.h:379</div></div>
<div class="ttc" id="abf16__math_8h_html_a9e9f0fdd6e304522bc88acd22c576842"><div class="ttname"><a href="bf16__math_8h.html#a9e9f0fdd6e304522bc88acd22c576842">instantiate_metal_math_funcs</a></div><div class="ttdeci">#define instantiate_metal_math_funcs(itype, otype, ctype, mfast)</div><div class="ttdef"><b>Definition</b> bf16_math.h:35</div></div>
<div class="ttc" id="abf16__math_8h_html_aecc11cb898846d01bfc9faa109fcf791"><div class="ttname"><a href="bf16__math_8h.html#aecc11cb898846d01bfc9faa109fcf791">instantiate_metal_simd_comm_funcs</a></div><div class="ttdeci">#define instantiate_metal_simd_comm_funcs( itype, otype, ctype, itype_to_ctype, ctype_to_otype)</div><div class="ttdef"><b>Definition</b> bf16_math.h:262</div></div>
<div class="ttc" id="anamespacemetal_html"><div class="ttname"><a href="namespacemetal.html">metal</a></div><div class="ttdef"><b>Definition</b> bf16.h:265</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_html"><div class="ttname"><a href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a></div><div class="ttdef"><b>Definition</b> bf16.h:54</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

149
docs/build/html/binary__ops_8h.html vendored Normal file
View File

@@ -0,0 +1,149 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/binary_ops.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle"><div class="title">binary_ops.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;metal_integer&gt;</code><br />
<code>#include &lt;metal_math&gt;</code><br />
</div>
<p><a href="binary__ops_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_add.html">Add</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_floor_divide.html">FloorDivide</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_divide.html">Divide</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_remainder.html">Remainder</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_equal.html">Equal</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_na_n_equal.html">NaNEqual</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_greater.html">Greater</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_greater_equal.html">GreaterEqual</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_less.html">Less</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_less_equal.html">LessEqual</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_log_add_exp.html">LogAddExp</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_maximum.html">Maximum</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_minimum.html">Minimum</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_multiply.html">Multiply</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_not_equal.html">NotEqual</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_power.html">Power</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_subtract.html">Subtract</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_logical_and.html">LogicalAnd</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_logical_or.html">LogicalOr</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_bitwise_and.html">BitwiseAnd</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_bitwise_or.html">BitwiseOr</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_bitwise_xor.html">BitwiseXor</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_left_shift.html">LeftShift</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_right_shift.html">RightShift</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_arc_tan2.html">ArcTan2</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_div_mod.html">DivMod</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,601 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx/backend/metal/kernels/binary_ops.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_938ab0ecf10b8b860ff766c820f665fd.html">mlx</a></li><li class="navelem"><a class="el" href="dir_1d446c9bd3c99228254c9484e0bc5c06.html">backend</a></li><li class="navelem"><a class="el" href="dir_d0c977ea65824390717cdb7efc36c157.html">metal</a></li><li class="navelem"><a class="el" href="dir_70a37effa88bcbd6b791977fa1e64356.html">kernels</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">binary_ops.h</div></div>
</div><!--header-->
<div class="contents">
<a href="binary__ops_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright © 2023-2024 Apple Inc.</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &lt;metal_integer&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &lt;metal_math&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
<div class="foldopen" id="foldopen00008" data-start="{" data-end="};">
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"><a class="line" href="struct_add.html"> 8</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_add.html">Add</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&gt;</div>
<div class="foldopen" id="foldopen00010" data-start="{" data-end="}">
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"><a class="line" href="struct_add.html#ac5c66b63d63a222d3ae0ab8cc7c90eb5"> 10</a></span> T <a class="code hl_function" href="struct_add.html#ac5c66b63d63a222d3ae0ab8cc7c90eb5">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> <span class="keywordflow">return</span> x + y;</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> }</div>
</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span>};</div>
</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="foldopen" id="foldopen00015" data-start="{" data-end="};">
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="struct_floor_divide.html"> 15</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_floor_divide.html">FloorDivide</a> {</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</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="struct_floor_divide.html#a2b328e4d768e718fa439f955c524666a"> 17</a></span> T <a class="code hl_function" href="struct_floor_divide.html#a2b328e4d768e718fa439f955c524666a">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordflow">return</span> x / y;</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> }</div>
</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00021" data-start="{" data-end="}">
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="struct_floor_divide.html#afc16a2b2a745225e0bc95640f3fc0219"> 21</a></span> <span class="keywordtype">float</span> <a class="code hl_function" href="struct_floor_divide.html#afc16a2b2a745225e0bc95640f3fc0219">operator()</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y) {</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keywordflow">return</span> trunc(x / y);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> }</div>
</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00025" data-start="{" data-end="}">
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="struct_floor_divide.html#ae91719a15f7e643d552129f476089c6a"> 25</a></span> half <a class="code hl_function" href="struct_floor_divide.html#ae91719a15f7e643d552129f476089c6a">operator()</a>(half x, half y) {</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordflow">return</span> trunc(x / y);</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> }</div>
</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00029" data-start="{" data-end="}">
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="struct_floor_divide.html#a4aa9f858626583e02bd79f747229bbca"> 29</a></span> <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> <a class="code hl_function" href="struct_floor_divide.html#a4aa9f858626583e02bd79f747229bbca">operator()</a>(<a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> x, <a class="code hl_struct" href="struct___m_l_x___b_float16.html">bfloat16_t</a> y) {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keywordflow">return</span> trunc(x / y);</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> }</div>
</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span>};</div>
</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
<div class="foldopen" id="foldopen00034" data-start="{" data-end="};">
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="struct_divide.html"> 34</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_divide.html">Divide</a> {</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00036" data-start="{" data-end="}">
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="struct_divide.html#a0a16b9194abc2ab7c61129f81a9bbb3d"> 36</a></span> T <a class="code hl_function" href="struct_divide.html#a0a16b9194abc2ab7c61129f81a9bbb3d">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordflow">return</span> x / y;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> }</div>
</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="foldopen" id="foldopen00041" data-start="{" data-end="};">
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="struct_remainder.html"> 41</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_remainder.html">Remainder</a> {</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> metal::enable_if_t&lt;metal::is_integral_v&lt;T&gt; &amp; !metal::is_signed_v&lt;T&gt;, T&gt;</div>
<div class="foldopen" id="foldopen00044" data-start="{" data-end="}">
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="struct_remainder.html#ab7875512ff4341c580c6dc372e64fc58"> 44</a></span> <a class="code hl_function" href="struct_remainder.html#ab7875512ff4341c580c6dc372e64fc58">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">return</span> x % y;</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> }</div>
</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> metal::enable_if_t&lt;metal::is_integral_v&lt;T&gt; &amp; metal::is_signed_v&lt;T&gt;, 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="struct_remainder.html#a18150b5f4425e30b95ffabc6bb25cede"> 49</a></span> <a class="code hl_function" href="struct_remainder.html#a18150b5f4425e30b95ffabc6bb25cede">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keyword">auto</span> r = x % y;</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">if</span> (r != 0 &amp;&amp; (r &lt; 0 != y &lt; 0)) {</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> r += y;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> }</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">return</span> r;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> }</div>
</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00057" data-start="{" data-end="}">
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="struct_remainder.html#ab3b75f54b56fd357c9755daadb2cafc2"> 57</a></span> metal::enable_if_t&lt;!metal::is_integral_v&lt;T&gt;, T&gt; <a class="code hl_function" href="struct_remainder.html#ab3b75f54b56fd357c9755daadb2cafc2">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> T r = fmod(x, y);</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">if</span> (r != 0 &amp;&amp; (r &lt; 0 != y &lt; 0)) {</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> r += y;</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> }</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordflow">return</span> r;</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> }</div>
</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keyword">template</span> &lt;&gt;</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="struct_remainder.html#ae918ce0e246937d4fe04e2ea36e4b2c1"> 65</a></span> <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> <a class="code hl_function" href="struct_remainder.html#ae918ce0e246937d4fe04e2ea36e4b2c1">operator()</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> x, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> y) {</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">return</span> x % y;</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>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
<div class="foldopen" id="foldopen00070" data-start="{" data-end="};">
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="struct_equal.html"> 70</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_equal.html">Equal</a> {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00072" data-start="{" data-end="}">
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="struct_equal.html#aa498087080900d4428ba428a6496a769"> 72</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_equal.html#aa498087080900d4428ba428a6496a769">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordflow">return</span> x == y;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> }</div>
</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span>};</div>
</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
<div class="foldopen" id="foldopen00077" data-start="{" data-end="};">
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="struct_na_n_equal.html"> 77</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_na_n_equal.html">NaNEqual</a> {</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00079" data-start="{" data-end="}">
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="struct_na_n_equal.html#a00220898e02db656d21dde9e9354a8dc"> 79</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_na_n_equal.html#a00220898e02db656d21dde9e9354a8dc">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">return</span> x == y || (<a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(x) &amp;&amp; <a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(y));</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> }</div>
</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00083" data-start="{" data-end="}">
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="struct_na_n_equal.html#a6185e4554dce5b4659d21673c576be51"> 83</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_na_n_equal.html#a6185e4554dce5b4659d21673c576be51">operator()</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> x, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> y) {</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordflow">return</span> x == y ||</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> (<a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(x.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>) &amp;&amp; <a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(y.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>) &amp;&amp; <a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(x.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>) &amp;&amp;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(y.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>)) ||</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> (x.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> == y.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> &amp;&amp; <a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(x.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>) &amp;&amp; <a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(y.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>)) ||</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> (<a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(x.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>) &amp;&amp; <a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(y.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>) &amp;&amp; x.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> == y.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>);</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> }</div>
</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span>};</div>
</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> </div>
<div class="foldopen" id="foldopen00092" data-start="{" data-end="};">
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"><a class="line" href="struct_greater.html"> 92</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_greater.html">Greater</a> {</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00094" data-start="{" data-end="}">
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="struct_greater.html#a98d7d8ee360cd0f469c6eb9a017560f5"> 94</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_greater.html#a98d7d8ee360cd0f469c6eb9a017560f5">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordflow">return</span> x &gt; y;</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> }</div>
</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span>};</div>
</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </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="struct_greater_equal.html"> 99</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_greater_equal.html">GreaterEqual</a> {</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00101" data-start="{" data-end="}">
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="struct_greater_equal.html#ae69a3bccc567a46506cf0d296294ce80"> 101</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_greater_equal.html#ae69a3bccc567a46506cf0d296294ce80">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">return</span> x &gt;= y;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> }</div>
</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> </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="struct_less.html"> 106</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_less.html">Less</a> {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</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="struct_less.html#a5ee0b31b2d9123dc4504f2979a5854d3"> 108</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_less.html#a5ee0b31b2d9123dc4504f2979a5854d3">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordflow">return</span> x &lt; y;</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>};</div>
</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> </div>
<div class="foldopen" id="foldopen00113" data-start="{" data-end="};">
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"><a class="line" href="struct_less_equal.html"> 113</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_less_equal.html">LessEqual</a> {</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00115" data-start="{" data-end="}">
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="struct_less_equal.html#ae9f9a1b2eae548977139704f0044acfe"> 115</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_less_equal.html#ae9f9a1b2eae548977139704f0044acfe">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">return</span> x &lt;= y;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> }</div>
</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span>};</div>
</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
<div class="foldopen" id="foldopen00120" data-start="{" data-end="};">
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="struct_log_add_exp.html"> 120</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_log_add_exp.html">LogAddExp</a> {</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00122" data-start="{" data-end="}">
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="struct_log_add_exp.html#ab32417f18e8ff68c15f78aceeb624edf"> 122</a></span> T <a class="code hl_function" href="struct_log_add_exp.html#ab32417f18e8ff68c15f78aceeb624edf">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(x) || <a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(y)) {</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keywordflow">return</span> metal::numeric_limits&lt;T&gt;::quiet_NaN();</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> }</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keyword">constexpr</span> T inf = metal::numeric_limits&lt;T&gt;::infinity();</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> T maxval = <a class="code hl_function" href="namespacemetal.html#a853c80479ab2264d9c4587c7bcac767b">metal::max</a>(x, y);</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> T minval = <a class="code hl_function" href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a>(x, y);</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <span class="keywordflow">return</span> (minval == -inf || maxval == inf)</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> ? maxval</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> : (maxval + <a class="code hl_function" href="backend_2metal_2kernels_2utils_8h.html#a27c03f2f90ab56db2e4d59559a3d2e9a">log1p</a>(<a class="code hl_function" href="namespacemetal.html#ac2a0b3618d922ac014baac8189d44650">metal::exp</a>(minval - maxval)));</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> };</div>
</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span>};</div>
</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> </div>
<div class="foldopen" id="foldopen00135" data-start="{" data-end="};">
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="struct_maximum.html"> 135</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_maximum.html">Maximum</a> {</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00137" data-start="{" data-end="}">
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"><a class="line" href="struct_maximum.html#a3ea0f42bc4cd80b68a98f189f9fa859c"> 137</a></span> metal::enable_if_t&lt;metal::is_integral_v&lt;T&gt;, T&gt; <a class="code hl_function" href="struct_maximum.html#a3ea0f42bc4cd80b68a98f189f9fa859c">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemetal.html#a853c80479ab2264d9c4587c7bcac767b">metal::max</a>(x, y);</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> }</div>
</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00142" data-start="{" data-end="}">
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"><a class="line" href="struct_maximum.html#a0bc8fadc87f2c49fc440d625bfc97ca6"> 142</a></span> metal::enable_if_t&lt;!metal::is_integral_v&lt;T&gt;, T&gt; <a class="code hl_function" href="struct_maximum.html#a0bc8fadc87f2c49fc440d625bfc97ca6">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(x)) {</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">return</span> x;</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> }</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">return</span> x &gt; y ? x : y;</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> }</div>
</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00150" data-start="{" data-end="}">
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"><a class="line" href="struct_maximum.html#a907e8793900be5927625377dab199644"> 150</a></span> <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> <a class="code hl_function" href="struct_maximum.html#a907e8793900be5927625377dab199644">operator()</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> x, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> y) {</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(x.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>) || <a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(x.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>)) {</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keywordflow">return</span> x;</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> }</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordflow">return</span> x &gt; y ? x : y;</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> }</div>
</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span>};</div>
</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> </div>
<div class="foldopen" id="foldopen00158" data-start="{" data-end="};">
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"><a class="line" href="struct_minimum.html"> 158</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_minimum.html">Minimum</a> {</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00160" data-start="{" data-end="}">
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"><a class="line" href="struct_minimum.html#aa6113dfac3986c0f571fa53f65c5330e"> 160</a></span> metal::enable_if_t&lt;metal::is_integral_v&lt;T&gt;, T&gt; <a class="code hl_function" href="struct_minimum.html#aa6113dfac3986c0f571fa53f65c5330e">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a>(x, y);</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> }</div>
</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="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00165" data-start="{" data-end="}">
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"><a class="line" href="struct_minimum.html#a0c939921de87ab9c6959238aac81a059"> 165</a></span> metal::enable_if_t&lt;!metal::is_integral_v&lt;T&gt;, T&gt; <a class="code hl_function" href="struct_minimum.html#a0c939921de87ab9c6959238aac81a059">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(x)) {</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="keywordflow">return</span> x;</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> <span class="keywordflow">return</span> x &lt; y ? x : y;</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> }</div>
</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> </div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00173" data-start="{" data-end="}">
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"><a class="line" href="struct_minimum.html#a800fba087280f79c2f7e9aff75bed093"> 173</a></span> <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> <a class="code hl_function" href="struct_minimum.html#a800fba087280f79c2f7e9aff75bed093">operator()</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> x, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> y) {</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(x.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>) || <a class="code hl_function" href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a>(x.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>)) {</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="keywordflow">return</span> x;</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> }</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="keywordflow">return</span> x &lt; y ? x : y;</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> }</div>
</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span>};</div>
</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> </div>
<div class="foldopen" id="foldopen00181" data-start="{" data-end="};">
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"><a class="line" href="struct_multiply.html"> 181</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_multiply.html">Multiply</a> {</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00183" data-start="{" data-end="}">
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"><a class="line" href="struct_multiply.html#a1327fc5a0713931afe997b0d4d2988e0"> 183</a></span> T <a class="code hl_function" href="struct_multiply.html#a1327fc5a0713931afe997b0d4d2988e0">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keywordflow">return</span> x * y;</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> }</div>
</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span>};</div>
</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> </div>
<div class="foldopen" id="foldopen00188" data-start="{" data-end="};">
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"><a class="line" href="struct_not_equal.html"> 188</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_not_equal.html">NotEqual</a> {</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00190" data-start="{" data-end="}">
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"><a class="line" href="struct_not_equal.html#af008d73a5d9cde0b8309b7e8ee7438b2"> 190</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_not_equal.html#af008d73a5d9cde0b8309b7e8ee7438b2">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> <span class="keywordflow">return</span> x != y;</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> }</div>
</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <span class="keyword">template</span> &lt;&gt;</div>
<div class="foldopen" id="foldopen00194" data-start="{" data-end="}">
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"><a class="line" href="struct_not_equal.html#a14de494cea4e4869351202cad1149f17"> 194</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="struct_not_equal.html#a14de494cea4e4869351202cad1149f17">operator()</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> x, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> y) {</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <span class="keywordflow">return</span> x.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> != y.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> || x.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> != y.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>;</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>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> </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="struct_power.html"> 199</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_power.html">Power</a> {</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00201" data-start="{" data-end="}">
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"><a class="line" href="struct_power.html#a2b6df2a9e48155ff9734caca8504a79f"> 201</a></span> metal::enable_if_t&lt;!metal::is_integral_v&lt;T&gt;, T&gt; <a class="code hl_function" href="struct_power.html#a2b6df2a9e48155ff9734caca8504a79f">operator()</a>(T base, T exp) {</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemetal.html#acd288d4552215bd10455584a214c57b8">metal::pow</a>(base, exp);</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> }</div>
</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> </div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00206" data-start="{" data-end="}">
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"><a class="line" href="struct_power.html#a36829163d42973034a1f8a7ecc57a1de"> 206</a></span> metal::enable_if_t&lt;metal::is_integral_v&lt;T&gt;, T&gt; <a class="code hl_function" href="struct_power.html#a36829163d42973034a1f8a7ecc57a1de">operator()</a>(T base, T exp) {</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> T res = 1;</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <span class="keywordflow">while</span> (exp) {</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <span class="keywordflow">if</span> (exp &amp; 1) {</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> res *= base;</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> }</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> exp &gt;&gt;= 1;</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> base *= base;</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> }</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> <span class="keywordflow">return</span> res;</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> }</div>
</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> </div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> <span class="keyword">template</span> &lt;&gt;</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="struct_power.html#a27cdfb313c4e82b63bdcdaee923cbbef"> 219</a></span> <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> <a class="code hl_function" href="struct_power.html#a27cdfb313c4e82b63bdcdaee923cbbef">operator()</a>(<a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> x, <a class="code hl_struct" href="structcomplex64__t.html">complex64_t</a> y) {</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="keyword">auto</span> x_theta = <a class="code hl_function" href="namespacemetal.html#a80a771553d9a0012b93620d19c48b00f">metal::atan</a>(x.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> / x.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a>);</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> <span class="keyword">auto</span> x_ln_r = 0.5 * <a class="code hl_function" href="namespacemetal.html#a423a9f4f2fc7ef5ec7eda061277b51b6">metal::log</a>(x.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> * x.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> + x.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> * x.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a>);</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <span class="keyword">auto</span> mag = <a class="code hl_function" href="namespacemetal.html#ac2a0b3618d922ac014baac8189d44650">metal::exp</a>(y.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> * x_ln_r - y.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> * x_theta);</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> <span class="keyword">auto</span> phase = y.<a class="code hl_variable" href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">imag</a> * x_ln_r + y.<a class="code hl_variable" href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">real</a> * x_theta;</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <span class="keywordflow">return</span> {mag * <a class="code hl_function" href="namespacemetal.html#a2fa4778a6fe2fa43253ea724e5a608a3">metal::cos</a>(phase), mag * <a class="code hl_function" href="namespacemetal.html#a619a159ca5f2ddfe3647d3a6bb6e804c">metal::sin</a>(phase)};</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> }</div>
</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span>};</div>
</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> </div>
<div class="foldopen" id="foldopen00228" data-start="{" data-end="};">
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"><a class="line" href="struct_subtract.html"> 228</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_subtract.html">Subtract</a> {</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="struct_subtract.html#ae0856cd8d449074ca287baa7e460f68a"> 230</a></span> T <a class="code hl_function" href="struct_subtract.html#ae0856cd8d449074ca287baa7e460f68a">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="keywordflow">return</span> x - y;</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>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> </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="struct_logical_and.html"> 235</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_logical_and.html">LogicalAnd</a> {</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00237" data-start="{" data-end="}">
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"><a class="line" href="struct_logical_and.html#a8bc6bdabc0ea0678a46e2cf6217cb3a6"> 237</a></span> T <a class="code hl_function" href="struct_logical_and.html#a8bc6bdabc0ea0678a46e2cf6217cb3a6">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> <span class="keywordflow">return</span> x &amp;&amp; y;</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> };</div>
</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span>};</div>
</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> </div>
<div class="foldopen" id="foldopen00242" data-start="{" data-end="};">
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"><a class="line" href="struct_logical_or.html"> 242</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_logical_or.html">LogicalOr</a> {</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00244" data-start="{" data-end="}">
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"><a class="line" href="struct_logical_or.html#ade6a931324a604a3119d2220d6f5460d"> 244</a></span> T <a class="code hl_function" href="struct_logical_or.html#ade6a931324a604a3119d2220d6f5460d">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> <span class="keywordflow">return</span> x || y;</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> };</div>
</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span>};</div>
</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> </div>
<div class="foldopen" id="foldopen00249" data-start="{" data-end="};">
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"><a class="line" href="struct_bitwise_and.html"> 249</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_bitwise_and.html">BitwiseAnd</a> {</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00251" data-start="{" data-end="}">
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"><a class="line" href="struct_bitwise_and.html#afb48af090b01dd0200963bc12d842e36"> 251</a></span> T <a class="code hl_function" href="struct_bitwise_and.html#afb48af090b01dd0200963bc12d842e36">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> <span class="keywordflow">return</span> x &amp; y;</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> };</div>
</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span>};</div>
</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> </div>
<div class="foldopen" id="foldopen00256" data-start="{" data-end="};">
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"><a class="line" href="struct_bitwise_or.html"> 256</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_bitwise_or.html">BitwiseOr</a> {</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00258" data-start="{" data-end="}">
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"><a class="line" href="struct_bitwise_or.html#a41f847463daafa99ee56f4035578390f"> 258</a></span> T <a class="code hl_function" href="struct_bitwise_or.html#a41f847463daafa99ee56f4035578390f">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> <span class="keywordflow">return</span> x | y;</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> };</div>
</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span>};</div>
</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> </div>
<div class="foldopen" id="foldopen00263" data-start="{" data-end="};">
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"><a class="line" href="struct_bitwise_xor.html"> 263</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_bitwise_xor.html">BitwiseXor</a> {</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00265" data-start="{" data-end="}">
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"><a class="line" href="struct_bitwise_xor.html#a3a3e8a56caab739d40262d9349c9c485"> 265</a></span> T <a class="code hl_function" href="struct_bitwise_xor.html#a3a3e8a56caab739d40262d9349c9c485">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> <span class="keywordflow">return</span> x ^ y;</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> };</div>
</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span>};</div>
</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> </div>
<div class="foldopen" id="foldopen00270" data-start="{" data-end="};">
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"><a class="line" href="struct_left_shift.html"> 270</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_left_shift.html">LeftShift</a> {</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00272" data-start="{" data-end="}">
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"><a class="line" href="struct_left_shift.html#aa729747784c38bfdbba34794fcf5175b"> 272</a></span> T <a class="code hl_function" href="struct_left_shift.html#aa729747784c38bfdbba34794fcf5175b">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> <span class="keywordflow">return</span> x &lt;&lt; y;</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> };</div>
</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span>};</div>
</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> </div>
<div class="foldopen" id="foldopen00277" data-start="{" data-end="};">
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"><a class="line" href="struct_right_shift.html"> 277</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_right_shift.html">RightShift</a> {</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00279" data-start="{" data-end="}">
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"><a class="line" href="struct_right_shift.html#a2cc59b400c68342b0e43050431323c17"> 279</a></span> T <a class="code hl_function" href="struct_right_shift.html#a2cc59b400c68342b0e43050431323c17">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> <span class="keywordflow">return</span> x &gt;&gt; y;</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> };</div>
</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span>};</div>
</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> </div>
<div class="foldopen" id="foldopen00284" data-start="{" data-end="};">
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"><a class="line" href="struct_arc_tan2.html"> 284</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_arc_tan2.html">ArcTan2</a> {</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00286" data-start="{" data-end="}">
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"><a class="line" href="struct_arc_tan2.html#ac9b7729753e13be293ab700231d061ac"> 286</a></span> T <a class="code hl_function" href="struct_arc_tan2.html#ac9b7729753e13be293ab700231d061ac">operator()</a>(T y, T x) {</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span> <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemetal_1_1precise.html#a6f161b049cc6884f87b09b33c2d1cd7f">metal::precise::atan2</a>(y, x);</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span> }</div>
</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span>};</div>
</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> </div>
<div class="foldopen" id="foldopen00291" data-start="{" data-end="};">
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"><a class="line" href="struct_div_mod.html"> 291</a></span><span class="keyword">struct </span><a class="code hl_struct" href="struct_div_mod.html">DivMod</a> {</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00293" data-start="{" data-end="}">
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"><a class="line" href="struct_div_mod.html#a8b5758f2ea18d4c903b462331b25abfe"> 293</a></span> metal::array&lt;T, 2&gt; <a class="code hl_function" href="struct_div_mod.html#a8b5758f2ea18d4c903b462331b25abfe">operator()</a>(T x, T y) {</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> <span class="keywordflow">return</span> {<a class="code hl_struct" href="struct_floor_divide.html">FloorDivide</a>{}(x, y), <a class="code hl_struct" href="struct_remainder.html">Remainder</a>{}(x, y)};</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> };</div>
</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span>};</div>
</div>
<div class="ttc" id="abackend_2metal_2kernels_2utils_8h_html_a27c03f2f90ab56db2e4d59559a3d2e9a"><div class="ttname"><a href="backend_2metal_2kernels_2utils_8h.html#a27c03f2f90ab56db2e4d59559a3d2e9a">log1p</a></div><div class="ttdeci">float log1p(float x)</div><div class="ttdef"><b>Definition</b> utils.h:301</div></div>
<div class="ttc" id="anamespacemetal_1_1precise_html_a6f161b049cc6884f87b09b33c2d1cd7f"><div class="ttname"><a href="namespacemetal_1_1precise.html#a6f161b049cc6884f87b09b33c2d1cd7f">metal::precise::atan2</a></div><div class="ttdeci">METAL_FUNC bfloat16_t atan2(bfloat16_t y, bfloat16_t x)</div><div class="ttdef"><b>Definition</b> bf16_math.h:252</div></div>
<div class="ttc" id="anamespacemetal_html_a2fa4778a6fe2fa43253ea724e5a608a3"><div class="ttname"><a href="namespacemetal.html#a2fa4778a6fe2fa43253ea724e5a608a3">metal::cos</a></div><div class="ttdeci">METAL_FUNC bfloat16_t cos(bfloat16_t x)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="anamespacemetal_html_a423a9f4f2fc7ef5ec7eda061277b51b6"><div class="ttname"><a href="namespacemetal.html#a423a9f4f2fc7ef5ec7eda061277b51b6">metal::log</a></div><div class="ttdeci">METAL_FUNC bfloat16_t log(bfloat16_t x)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="anamespacemetal_html_a619a159ca5f2ddfe3647d3a6bb6e804c"><div class="ttname"><a href="namespacemetal.html#a619a159ca5f2ddfe3647d3a6bb6e804c">metal::sin</a></div><div class="ttdeci">METAL_FUNC bfloat16_t sin(bfloat16_t x)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="anamespacemetal_html_a6653b28c9473087141eddce39878d4d3"><div class="ttname"><a href="namespacemetal.html#a6653b28c9473087141eddce39878d4d3">metal::min</a></div><div class="ttdeci">METAL_FUNC bfloat16_t min(bfloat16_t x, bfloat16_t y)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="anamespacemetal_html_a80a771553d9a0012b93620d19c48b00f"><div class="ttname"><a href="namespacemetal.html#a80a771553d9a0012b93620d19c48b00f">metal::atan</a></div><div class="ttdeci">METAL_FUNC bfloat16_t atan(bfloat16_t y_over_x)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="anamespacemetal_html_a83320ba983d90dd1fa5847b6940dc0bb"><div class="ttname"><a href="namespacemetal.html#a83320ba983d90dd1fa5847b6940dc0bb">metal::isnan</a></div><div class="ttdeci">METAL_FUNC bool isnan(_MLX_BFloat16 x)</div><div class="ttdef"><b>Definition</b> bf16.h:307</div></div>
<div class="ttc" id="anamespacemetal_html_a853c80479ab2264d9c4587c7bcac767b"><div class="ttname"><a href="namespacemetal.html#a853c80479ab2264d9c4587c7bcac767b">metal::max</a></div><div class="ttdeci">METAL_FUNC bfloat16_t max(bfloat16_t x, bfloat16_t y)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="anamespacemetal_html_ac2a0b3618d922ac014baac8189d44650"><div class="ttname"><a href="namespacemetal.html#ac2a0b3618d922ac014baac8189d44650">metal::exp</a></div><div class="ttdeci">METAL_FUNC bfloat16_t exp(bfloat16_t x)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="anamespacemetal_html_acd288d4552215bd10455584a214c57b8"><div class="ttname"><a href="namespacemetal.html#acd288d4552215bd10455584a214c57b8">metal::pow</a></div><div class="ttdeci">METAL_FUNC bfloat16_t pow(bfloat16_t x, bfloat16_t y)</div><div class="ttdef"><b>Definition</b> bf16_math.h:234</div></div>
<div class="ttc" id="astruct___m_l_x___b_float16_html"><div class="ttname"><a href="struct___m_l_x___b_float16.html">_MLX_BFloat16</a></div><div class="ttdef"><b>Definition</b> bf16.h:54</div></div>
<div class="ttc" id="astruct_add_html"><div class="ttname"><a href="struct_add.html">Add</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:8</div></div>
<div class="ttc" id="astruct_add_html_ac5c66b63d63a222d3ae0ab8cc7c90eb5"><div class="ttname"><a href="struct_add.html#ac5c66b63d63a222d3ae0ab8cc7c90eb5">Add::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:10</div></div>
<div class="ttc" id="astruct_arc_tan2_html"><div class="ttname"><a href="struct_arc_tan2.html">ArcTan2</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:284</div></div>
<div class="ttc" id="astruct_arc_tan2_html_ac9b7729753e13be293ab700231d061ac"><div class="ttname"><a href="struct_arc_tan2.html#ac9b7729753e13be293ab700231d061ac">ArcTan2::operator()</a></div><div class="ttdeci">T operator()(T y, T x)</div><div class="ttdef"><b>Definition</b> binary_ops.h:286</div></div>
<div class="ttc" id="astruct_bitwise_and_html"><div class="ttname"><a href="struct_bitwise_and.html">BitwiseAnd</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:249</div></div>
<div class="ttc" id="astruct_bitwise_and_html_afb48af090b01dd0200963bc12d842e36"><div class="ttname"><a href="struct_bitwise_and.html#afb48af090b01dd0200963bc12d842e36">BitwiseAnd::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:251</div></div>
<div class="ttc" id="astruct_bitwise_or_html"><div class="ttname"><a href="struct_bitwise_or.html">BitwiseOr</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:256</div></div>
<div class="ttc" id="astruct_bitwise_or_html_a41f847463daafa99ee56f4035578390f"><div class="ttname"><a href="struct_bitwise_or.html#a41f847463daafa99ee56f4035578390f">BitwiseOr::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:258</div></div>
<div class="ttc" id="astruct_bitwise_xor_html"><div class="ttname"><a href="struct_bitwise_xor.html">BitwiseXor</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:263</div></div>
<div class="ttc" id="astruct_bitwise_xor_html_a3a3e8a56caab739d40262d9349c9c485"><div class="ttname"><a href="struct_bitwise_xor.html#a3a3e8a56caab739d40262d9349c9c485">BitwiseXor::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:265</div></div>
<div class="ttc" id="astruct_div_mod_html"><div class="ttname"><a href="struct_div_mod.html">DivMod</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:291</div></div>
<div class="ttc" id="astruct_div_mod_html_a8b5758f2ea18d4c903b462331b25abfe"><div class="ttname"><a href="struct_div_mod.html#a8b5758f2ea18d4c903b462331b25abfe">DivMod::operator()</a></div><div class="ttdeci">metal::array&lt; T, 2 &gt; operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:293</div></div>
<div class="ttc" id="astruct_divide_html"><div class="ttname"><a href="struct_divide.html">Divide</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:34</div></div>
<div class="ttc" id="astruct_divide_html_a0a16b9194abc2ab7c61129f81a9bbb3d"><div class="ttname"><a href="struct_divide.html#a0a16b9194abc2ab7c61129f81a9bbb3d">Divide::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:36</div></div>
<div class="ttc" id="astruct_equal_html"><div class="ttname"><a href="struct_equal.html">Equal</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:70</div></div>
<div class="ttc" id="astruct_equal_html_aa498087080900d4428ba428a6496a769"><div class="ttname"><a href="struct_equal.html#aa498087080900d4428ba428a6496a769">Equal::operator()</a></div><div class="ttdeci">bool operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:72</div></div>
<div class="ttc" id="astruct_floor_divide_html"><div class="ttname"><a href="struct_floor_divide.html">FloorDivide</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:15</div></div>
<div class="ttc" id="astruct_floor_divide_html_a2b328e4d768e718fa439f955c524666a"><div class="ttname"><a href="struct_floor_divide.html#a2b328e4d768e718fa439f955c524666a">FloorDivide::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:17</div></div>
<div class="ttc" id="astruct_floor_divide_html_a4aa9f858626583e02bd79f747229bbca"><div class="ttname"><a href="struct_floor_divide.html#a4aa9f858626583e02bd79f747229bbca">FloorDivide::operator()</a></div><div class="ttdeci">bfloat16_t operator()(bfloat16_t x, bfloat16_t y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:29</div></div>
<div class="ttc" id="astruct_floor_divide_html_ae91719a15f7e643d552129f476089c6a"><div class="ttname"><a href="struct_floor_divide.html#ae91719a15f7e643d552129f476089c6a">FloorDivide::operator()</a></div><div class="ttdeci">half operator()(half x, half y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:25</div></div>
<div class="ttc" id="astruct_floor_divide_html_afc16a2b2a745225e0bc95640f3fc0219"><div class="ttname"><a href="struct_floor_divide.html#afc16a2b2a745225e0bc95640f3fc0219">FloorDivide::operator()</a></div><div class="ttdeci">float operator()(float x, float y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:21</div></div>
<div class="ttc" id="astruct_greater_equal_html"><div class="ttname"><a href="struct_greater_equal.html">GreaterEqual</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:99</div></div>
<div class="ttc" id="astruct_greater_equal_html_ae69a3bccc567a46506cf0d296294ce80"><div class="ttname"><a href="struct_greater_equal.html#ae69a3bccc567a46506cf0d296294ce80">GreaterEqual::operator()</a></div><div class="ttdeci">bool operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:101</div></div>
<div class="ttc" id="astruct_greater_html"><div class="ttname"><a href="struct_greater.html">Greater</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:92</div></div>
<div class="ttc" id="astruct_greater_html_a98d7d8ee360cd0f469c6eb9a017560f5"><div class="ttname"><a href="struct_greater.html#a98d7d8ee360cd0f469c6eb9a017560f5">Greater::operator()</a></div><div class="ttdeci">bool operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:94</div></div>
<div class="ttc" id="astruct_left_shift_html"><div class="ttname"><a href="struct_left_shift.html">LeftShift</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:270</div></div>
<div class="ttc" id="astruct_left_shift_html_aa729747784c38bfdbba34794fcf5175b"><div class="ttname"><a href="struct_left_shift.html#aa729747784c38bfdbba34794fcf5175b">LeftShift::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:272</div></div>
<div class="ttc" id="astruct_less_equal_html"><div class="ttname"><a href="struct_less_equal.html">LessEqual</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:113</div></div>
<div class="ttc" id="astruct_less_equal_html_ae9f9a1b2eae548977139704f0044acfe"><div class="ttname"><a href="struct_less_equal.html#ae9f9a1b2eae548977139704f0044acfe">LessEqual::operator()</a></div><div class="ttdeci">bool operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:115</div></div>
<div class="ttc" id="astruct_less_html"><div class="ttname"><a href="struct_less.html">Less</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:106</div></div>
<div class="ttc" id="astruct_less_html_a5ee0b31b2d9123dc4504f2979a5854d3"><div class="ttname"><a href="struct_less.html#a5ee0b31b2d9123dc4504f2979a5854d3">Less::operator()</a></div><div class="ttdeci">bool operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:108</div></div>
<div class="ttc" id="astruct_log_add_exp_html"><div class="ttname"><a href="struct_log_add_exp.html">LogAddExp</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:120</div></div>
<div class="ttc" id="astruct_log_add_exp_html_ab32417f18e8ff68c15f78aceeb624edf"><div class="ttname"><a href="struct_log_add_exp.html#ab32417f18e8ff68c15f78aceeb624edf">LogAddExp::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:122</div></div>
<div class="ttc" id="astruct_logical_and_html"><div class="ttname"><a href="struct_logical_and.html">LogicalAnd</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:235</div></div>
<div class="ttc" id="astruct_logical_and_html_a8bc6bdabc0ea0678a46e2cf6217cb3a6"><div class="ttname"><a href="struct_logical_and.html#a8bc6bdabc0ea0678a46e2cf6217cb3a6">LogicalAnd::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:237</div></div>
<div class="ttc" id="astruct_logical_or_html"><div class="ttname"><a href="struct_logical_or.html">LogicalOr</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:242</div></div>
<div class="ttc" id="astruct_logical_or_html_ade6a931324a604a3119d2220d6f5460d"><div class="ttname"><a href="struct_logical_or.html#ade6a931324a604a3119d2220d6f5460d">LogicalOr::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:244</div></div>
<div class="ttc" id="astruct_maximum_html"><div class="ttname"><a href="struct_maximum.html">Maximum</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:135</div></div>
<div class="ttc" id="astruct_maximum_html_a0bc8fadc87f2c49fc440d625bfc97ca6"><div class="ttname"><a href="struct_maximum.html#a0bc8fadc87f2c49fc440d625bfc97ca6">Maximum::operator()</a></div><div class="ttdeci">metal::enable_if_t&lt;!metal::is_integral_v&lt; T &gt;, T &gt; operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:142</div></div>
<div class="ttc" id="astruct_maximum_html_a3ea0f42bc4cd80b68a98f189f9fa859c"><div class="ttname"><a href="struct_maximum.html#a3ea0f42bc4cd80b68a98f189f9fa859c">Maximum::operator()</a></div><div class="ttdeci">metal::enable_if_t&lt; metal::is_integral_v&lt; T &gt;, T &gt; operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:137</div></div>
<div class="ttc" id="astruct_maximum_html_a907e8793900be5927625377dab199644"><div class="ttname"><a href="struct_maximum.html#a907e8793900be5927625377dab199644">Maximum::operator()</a></div><div class="ttdeci">complex64_t operator()(complex64_t x, complex64_t y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:150</div></div>
<div class="ttc" id="astruct_minimum_html"><div class="ttname"><a href="struct_minimum.html">Minimum</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:158</div></div>
<div class="ttc" id="astruct_minimum_html_a0c939921de87ab9c6959238aac81a059"><div class="ttname"><a href="struct_minimum.html#a0c939921de87ab9c6959238aac81a059">Minimum::operator()</a></div><div class="ttdeci">metal::enable_if_t&lt;!metal::is_integral_v&lt; T &gt;, T &gt; operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:165</div></div>
<div class="ttc" id="astruct_minimum_html_a800fba087280f79c2f7e9aff75bed093"><div class="ttname"><a href="struct_minimum.html#a800fba087280f79c2f7e9aff75bed093">Minimum::operator()</a></div><div class="ttdeci">complex64_t operator()(complex64_t x, complex64_t y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:173</div></div>
<div class="ttc" id="astruct_minimum_html_aa6113dfac3986c0f571fa53f65c5330e"><div class="ttname"><a href="struct_minimum.html#aa6113dfac3986c0f571fa53f65c5330e">Minimum::operator()</a></div><div class="ttdeci">metal::enable_if_t&lt; metal::is_integral_v&lt; T &gt;, T &gt; operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:160</div></div>
<div class="ttc" id="astruct_multiply_html"><div class="ttname"><a href="struct_multiply.html">Multiply</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:181</div></div>
<div class="ttc" id="astruct_multiply_html_a1327fc5a0713931afe997b0d4d2988e0"><div class="ttname"><a href="struct_multiply.html#a1327fc5a0713931afe997b0d4d2988e0">Multiply::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:183</div></div>
<div class="ttc" id="astruct_na_n_equal_html"><div class="ttname"><a href="struct_na_n_equal.html">NaNEqual</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:77</div></div>
<div class="ttc" id="astruct_na_n_equal_html_a00220898e02db656d21dde9e9354a8dc"><div class="ttname"><a href="struct_na_n_equal.html#a00220898e02db656d21dde9e9354a8dc">NaNEqual::operator()</a></div><div class="ttdeci">bool operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:79</div></div>
<div class="ttc" id="astruct_na_n_equal_html_a6185e4554dce5b4659d21673c576be51"><div class="ttname"><a href="struct_na_n_equal.html#a6185e4554dce5b4659d21673c576be51">NaNEqual::operator()</a></div><div class="ttdeci">bool operator()(complex64_t x, complex64_t y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:83</div></div>
<div class="ttc" id="astruct_not_equal_html"><div class="ttname"><a href="struct_not_equal.html">NotEqual</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:188</div></div>
<div class="ttc" id="astruct_not_equal_html_a14de494cea4e4869351202cad1149f17"><div class="ttname"><a href="struct_not_equal.html#a14de494cea4e4869351202cad1149f17">NotEqual::operator()</a></div><div class="ttdeci">bool operator()(complex64_t x, complex64_t y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:194</div></div>
<div class="ttc" id="astruct_not_equal_html_af008d73a5d9cde0b8309b7e8ee7438b2"><div class="ttname"><a href="struct_not_equal.html#af008d73a5d9cde0b8309b7e8ee7438b2">NotEqual::operator()</a></div><div class="ttdeci">bool operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:190</div></div>
<div class="ttc" id="astruct_power_html"><div class="ttname"><a href="struct_power.html">Power</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:199</div></div>
<div class="ttc" id="astruct_power_html_a27cdfb313c4e82b63bdcdaee923cbbef"><div class="ttname"><a href="struct_power.html#a27cdfb313c4e82b63bdcdaee923cbbef">Power::operator()</a></div><div class="ttdeci">complex64_t operator()(complex64_t x, complex64_t y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:219</div></div>
<div class="ttc" id="astruct_power_html_a2b6df2a9e48155ff9734caca8504a79f"><div class="ttname"><a href="struct_power.html#a2b6df2a9e48155ff9734caca8504a79f">Power::operator()</a></div><div class="ttdeci">metal::enable_if_t&lt;!metal::is_integral_v&lt; T &gt;, T &gt; operator()(T base, T exp)</div><div class="ttdef"><b>Definition</b> binary_ops.h:201</div></div>
<div class="ttc" id="astruct_power_html_a36829163d42973034a1f8a7ecc57a1de"><div class="ttname"><a href="struct_power.html#a36829163d42973034a1f8a7ecc57a1de">Power::operator()</a></div><div class="ttdeci">metal::enable_if_t&lt; metal::is_integral_v&lt; T &gt;, T &gt; operator()(T base, T exp)</div><div class="ttdef"><b>Definition</b> binary_ops.h:206</div></div>
<div class="ttc" id="astruct_remainder_html"><div class="ttname"><a href="struct_remainder.html">Remainder</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:41</div></div>
<div class="ttc" id="astruct_remainder_html_a18150b5f4425e30b95ffabc6bb25cede"><div class="ttname"><a href="struct_remainder.html#a18150b5f4425e30b95ffabc6bb25cede">Remainder::operator()</a></div><div class="ttdeci">metal::enable_if_t&lt; metal::is_integral_v&lt; T &gt; &amp;metal::is_signed_v&lt; T &gt;, T &gt; operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:49</div></div>
<div class="ttc" id="astruct_remainder_html_ab3b75f54b56fd357c9755daadb2cafc2"><div class="ttname"><a href="struct_remainder.html#ab3b75f54b56fd357c9755daadb2cafc2">Remainder::operator()</a></div><div class="ttdeci">metal::enable_if_t&lt;!metal::is_integral_v&lt; T &gt;, T &gt; operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:57</div></div>
<div class="ttc" id="astruct_remainder_html_ab7875512ff4341c580c6dc372e64fc58"><div class="ttname"><a href="struct_remainder.html#ab7875512ff4341c580c6dc372e64fc58">Remainder::operator()</a></div><div class="ttdeci">metal::enable_if_t&lt; metal::is_integral_v&lt; T &gt; &amp;!metal::is_signed_v&lt; T &gt;, T &gt; operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:44</div></div>
<div class="ttc" id="astruct_remainder_html_ae918ce0e246937d4fe04e2ea36e4b2c1"><div class="ttname"><a href="struct_remainder.html#ae918ce0e246937d4fe04e2ea36e4b2c1">Remainder::operator()</a></div><div class="ttdeci">complex64_t operator()(complex64_t x, complex64_t y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:65</div></div>
<div class="ttc" id="astruct_right_shift_html"><div class="ttname"><a href="struct_right_shift.html">RightShift</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:277</div></div>
<div class="ttc" id="astruct_right_shift_html_a2cc59b400c68342b0e43050431323c17"><div class="ttname"><a href="struct_right_shift.html#a2cc59b400c68342b0e43050431323c17">RightShift::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:279</div></div>
<div class="ttc" id="astruct_subtract_html"><div class="ttname"><a href="struct_subtract.html">Subtract</a></div><div class="ttdef"><b>Definition</b> binary_ops.h:228</div></div>
<div class="ttc" id="astruct_subtract_html_ae0856cd8d449074ca287baa7e460f68a"><div class="ttname"><a href="struct_subtract.html#ae0856cd8d449074ca287baa7e460f68a">Subtract::operator()</a></div><div class="ttdeci">T operator()(T x, T y)</div><div class="ttdef"><b>Definition</b> binary_ops.h:230</div></div>
<div class="ttc" id="astructcomplex64__t_html"><div class="ttname"><a href="structcomplex64__t.html">complex64_t</a></div><div class="ttdef"><b>Definition</b> complex.h:20</div></div>
<div class="ttc" id="astructcomplex64__t_html_a94037c0cf8451aaff7cb4d154a8426de"><div class="ttname"><a href="structcomplex64__t.html#a94037c0cf8451aaff7cb4d154a8426de">complex64_t::imag</a></div><div class="ttdeci">float imag</div><div class="ttdef"><b>Definition</b> complex.h:22</div></div>
<div class="ttc" id="astructcomplex64__t_html_abbd4a0092eca9f112c1c5ae1a133a27e"><div class="ttname"><a href="structcomplex64__t.html#abbd4a0092eca9f112c1c5ae1a133a27e">complex64_t::real</a></div><div class="ttdeci">float real</div><div class="ttdef"><b>Definition</b> complex.h:21</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,92 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_kernel.html">Kernel</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">MPS::Kernel Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="class_m_p_s_1_1_kernel.html">MPS::Kernel</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_kernel.html#a46793d1c80a4df313c067103fcae6024">device</a>() const</td><td class="entry"><a class="el" href="class_m_p_s_1_1_kernel.html">MPS::Kernel</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_m_p_s_1_1_kernel.html#aaf646bce46266bc11c419464ec72cdfe">label</a>() const</td><td class="entry"><a class="el" href="class_m_p_s_1_1_kernel.html">MPS::Kernel</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,144 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: MPS::Kernel Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_kernel.html">Kernel</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_m_p_s_1_1_kernel-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">MPS::Kernel Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for MPS::Kernel:</div>
<div class="dyncontent">
<div class="center">
<img src="class_m_p_s_1_1_kernel.png" alt=""/>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aaf646bce46266bc11c419464ec72cdfe" id="r_aaf646bce46266bc11c419464ec72cdfe"><td class="memItemLeft" align="right" valign="top">NS::String *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aaf646bce46266bc11c419464ec72cdfe">label</a> () const</td></tr>
<tr class="separator:aaf646bce46266bc11c419464ec72cdfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46793d1c80a4df313c067103fcae6024" id="r_a46793d1c80a4df313c067103fcae6024"><td class="memItemLeft" align="right" valign="top">MTL::Device *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a46793d1c80a4df313c067103fcae6024">device</a> () const</td></tr>
<tr class="separator:a46793d1c80a4df313c067103fcae6024"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a46793d1c80a4df313c067103fcae6024" name="a46793d1c80a4df313c067103fcae6024"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a46793d1c80a4df313c067103fcae6024">&#9670;&#160;</a></span>device()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE MTL::Device * MPS::Kernel::device </td>
<td>(</td>
<td class="paramname"><span class="paramname"></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aaf646bce46266bc11c419464ec72cdfe" name="aaf646bce46266bc11c419464ec72cdfe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf646bce46266bc11c419464ec72cdfe">&#9670;&#160;</a></span>label()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE NS::String * MPS::Kernel::label </td>
<td>(</td>
<td class="paramname"><span class="paramname"></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>mlx/backend/metal/mps/<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

View File

@@ -0,0 +1,93 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">MPS::Matrix Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="class_m_p_s_1_1_matrix.html">MPS::Matrix</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix.html#a906d97b4b2365bec4acf278ef22205b4">alloc</a>()</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix.html">MPS::Matrix</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix.html#a2398221610a7c610c85cf7fb3f18281b">init</a>(MTL::Buffer *buffer, MatrixDescriptor *descriptor)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix.html">MPS::Matrix</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix.html#a40771ae44d119abd56bd32b7cc38feda">init</a>(const MTL::Buffer *buffer, MatrixDescriptor *descriptor)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix.html">MPS::Matrix</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,183 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: MPS::Matrix Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_m_p_s_1_1_matrix-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">MPS::Matrix Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for MPS::Matrix:</div>
<div class="dyncontent">
<div class="center">
<img src="class_m_p_s_1_1_matrix.png" alt=""/>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2398221610a7c610c85cf7fb3f18281b" id="r_a2398221610a7c610c85cf7fb3f18281b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2398221610a7c610c85cf7fb3f18281b">init</a> (MTL::Buffer *buffer, <a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MatrixDescriptor</a> *descriptor)</td></tr>
<tr class="separator:a2398221610a7c610c85cf7fb3f18281b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40771ae44d119abd56bd32b7cc38feda" id="r_a40771ae44d119abd56bd32b7cc38feda"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a40771ae44d119abd56bd32b7cc38feda">init</a> (const MTL::Buffer *buffer, <a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MatrixDescriptor</a> *descriptor)</td></tr>
<tr class="separator:a40771ae44d119abd56bd32b7cc38feda"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a906d97b4b2365bec4acf278ef22205b4" id="r_a906d97b4b2365bec4acf278ef22205b4"><td class="memItemLeft" align="right" valign="top">static class <a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a906d97b4b2365bec4acf278ef22205b4">alloc</a> ()</td></tr>
<tr class="separator:a906d97b4b2365bec4acf278ef22205b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a906d97b4b2365bec4acf278ef22205b4" name="a906d97b4b2365bec4acf278ef22205b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a906d97b4b2365bec4acf278ef22205b4">&#9670;&#160;</a></span>alloc()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> * MPS::Matrix::alloc </td>
<td>(</td>
<td class="paramname"><span class="paramname"></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a40771ae44d119abd56bd32b7cc38feda" name="a40771ae44d119abd56bd32b7cc38feda"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40771ae44d119abd56bd32b7cc38feda">&#9670;&#160;</a></span>init() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> * MPS::Matrix::init </td>
<td>(</td>
<td class="paramtype">const MTL::Buffer *</td> <td class="paramname"><span class="paramname"><em>buffer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MatrixDescriptor</a> *</td> <td class="paramname"><span class="paramname"><em>descriptor</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a2398221610a7c610c85cf7fb3f18281b" name="a2398221610a7c610c85cf7fb3f18281b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2398221610a7c610c85cf7fb3f18281b">&#9670;&#160;</a></span>init() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> * MPS::Matrix::init </td>
<td>(</td>
<td class="paramtype">MTL::Buffer *</td> <td class="paramname"><span class="paramname"><em>buffer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MatrixDescriptor</a> *</td> <td class="paramname"><span class="paramname"><em>descriptor</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>mlx/backend/metal/mps/<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

View File

@@ -0,0 +1,93 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MatrixDescriptor</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">MPS::MatrixDescriptor Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MPS::MatrixDescriptor</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_descriptor.html#a7a99042b3c8afa037719ca316500a37b">matrixDescriptor</a>(NS::UInteger rows, NS::UInteger columns, NS::UInteger rowBytes, NS::UInteger dataType)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MPS::MatrixDescriptor</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_descriptor.html#a67e5df7d48fc175efd5124b3b43b6366">matrixDescriptor</a>(NS::UInteger rows, NS::UInteger columns, NS::UInteger matrices, NS::UInteger rowBytes, NS::UInteger matrixBytes, NS::UInteger dataType)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MPS::MatrixDescriptor</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_descriptor.html#a04ce0dd1d4632ff8c4328e4b62d71fc0">rows</a>() const</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MPS::MatrixDescriptor</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,221 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: MPS::MatrixDescriptor Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MatrixDescriptor</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_m_p_s_1_1_matrix_descriptor-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">MPS::MatrixDescriptor Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for MPS::MatrixDescriptor:</div>
<div class="dyncontent">
<div class="center">
<img src="class_m_p_s_1_1_matrix_descriptor.png" alt=""/>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a04ce0dd1d4632ff8c4328e4b62d71fc0" id="r_a04ce0dd1d4632ff8c4328e4b62d71fc0"><td class="memItemLeft" align="right" valign="top">NS::UInteger&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a04ce0dd1d4632ff8c4328e4b62d71fc0">rows</a> () const</td></tr>
<tr class="separator:a04ce0dd1d4632ff8c4328e4b62d71fc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a7a99042b3c8afa037719ca316500a37b" id="r_a7a99042b3c8afa037719ca316500a37b"><td class="memItemLeft" align="right" valign="top">static class <a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MatrixDescriptor</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a7a99042b3c8afa037719ca316500a37b">matrixDescriptor</a> (NS::UInteger <a class="el" href="#a04ce0dd1d4632ff8c4328e4b62d71fc0">rows</a>, NS::UInteger columns, NS::UInteger rowBytes, NS::UInteger dataType)</td></tr>
<tr class="separator:a7a99042b3c8afa037719ca316500a37b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67e5df7d48fc175efd5124b3b43b6366" id="r_a67e5df7d48fc175efd5124b3b43b6366"><td class="memItemLeft" align="right" valign="top">static class <a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MatrixDescriptor</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a67e5df7d48fc175efd5124b3b43b6366">matrixDescriptor</a> (NS::UInteger <a class="el" href="#a04ce0dd1d4632ff8c4328e4b62d71fc0">rows</a>, NS::UInteger columns, NS::UInteger matrices, NS::UInteger rowBytes, NS::UInteger matrixBytes, NS::UInteger dataType)</td></tr>
<tr class="separator:a67e5df7d48fc175efd5124b3b43b6366"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a67e5df7d48fc175efd5124b3b43b6366" name="a67e5df7d48fc175efd5124b3b43b6366"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a67e5df7d48fc175efd5124b3b43b6366">&#9670;&#160;</a></span>matrixDescriptor() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MatrixDescriptor</a> * MPS::MatrixDescriptor::matrixDescriptor </td>
<td>(</td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>rows</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>columns</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>matrices</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>rowBytes</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>matrixBytes</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>dataType</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a7a99042b3c8afa037719ca316500a37b" name="a7a99042b3c8afa037719ca316500a37b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7a99042b3c8afa037719ca316500a37b">&#9670;&#160;</a></span>matrixDescriptor() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_matrix_descriptor.html">MatrixDescriptor</a> * MPS::MatrixDescriptor::matrixDescriptor </td>
<td>(</td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>rows</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>columns</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>rowBytes</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>dataType</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a04ce0dd1d4632ff8c4328e4b62d71fc0" name="a04ce0dd1d4632ff8c4328e4b62d71fc0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04ce0dd1d4632ff8c4328e4b62d71fc0">&#9670;&#160;</a></span>rows()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE NS::UInteger MPS::MatrixDescriptor::rows </td>
<td>(</td>
<td class="paramname"><span class="paramname"></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>mlx/backend/metal/mps/<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

View File

@@ -0,0 +1,98 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MatrixMultiplication</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">MPS::MatrixMultiplication Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MPS::MatrixMultiplication</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html#a9f1400b36672bd6f228a80982e5b2717">alloc</a>()</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MPS::MatrixMultiplication</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html#ad30480456e66b79fa47086a3411c4921">encodeToCommandBuffer</a>(MTL::CommandBuffer *commandBuffer, Matrix *leftMatrix, Matrix *rightMatrix, Matrix *resultMatrix)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MPS::MatrixMultiplication</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html#a35b1a908807eb8ececd0241531dea823">init</a>(MTL::Device *device, bool transposeLeft, bool transposeRight, NS::UInteger resultRows, NS::UInteger resultColumns, NS::UInteger interiorColumns, double alpha, double beta)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MPS::MatrixMultiplication</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html#ac24cc7d71cdf3fd5bc4291ba2bfcd9e7">setBatchSize</a>(NS::UInteger batchSize)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MPS::MatrixMultiplication</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html#a82008429b4f14b5eba13142886b76cde">setBatchStart</a>(NS::UInteger batchStart)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MPS::MatrixMultiplication</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html#a8b905b75090af80d97cf09b05cdad528">setLeftMatrixOrigin</a>(MTL::Origin origin)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MPS::MatrixMultiplication</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html#a86647678c55adffc51114d036445ba10">setResultMatrixOrigin</a>(MTL::Origin origin)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MPS::MatrixMultiplication</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html#afaa45acd37397737ef4d94e8803be7e2">setRightMatrixOrigin</a>(MTL::Origin origin)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MPS::MatrixMultiplication</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,318 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: MPS::MatrixMultiplication Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MatrixMultiplication</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_m_p_s_1_1_matrix_multiplication-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">MPS::MatrixMultiplication Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for MPS::MatrixMultiplication:</div>
<div class="dyncontent">
<div class="center">
<img src="class_m_p_s_1_1_matrix_multiplication.png" alt=""/>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a35b1a908807eb8ececd0241531dea823" id="r_a35b1a908807eb8ececd0241531dea823"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MatrixMultiplication</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a35b1a908807eb8ececd0241531dea823">init</a> (MTL::Device *device, bool transposeLeft, bool transposeRight, NS::UInteger resultRows, NS::UInteger resultColumns, NS::UInteger interiorColumns, double alpha, double beta)</td></tr>
<tr class="separator:a35b1a908807eb8ececd0241531dea823"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad30480456e66b79fa47086a3411c4921" id="r_ad30480456e66b79fa47086a3411c4921"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad30480456e66b79fa47086a3411c4921">encodeToCommandBuffer</a> (MTL::CommandBuffer *commandBuffer, <a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> *leftMatrix, <a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> *rightMatrix, <a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> *resultMatrix)</td></tr>
<tr class="separator:ad30480456e66b79fa47086a3411c4921"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b905b75090af80d97cf09b05cdad528" id="r_a8b905b75090af80d97cf09b05cdad528"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8b905b75090af80d97cf09b05cdad528">setLeftMatrixOrigin</a> (MTL::Origin origin)</td></tr>
<tr class="separator:a8b905b75090af80d97cf09b05cdad528"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afaa45acd37397737ef4d94e8803be7e2" id="r_afaa45acd37397737ef4d94e8803be7e2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#afaa45acd37397737ef4d94e8803be7e2">setRightMatrixOrigin</a> (MTL::Origin origin)</td></tr>
<tr class="separator:afaa45acd37397737ef4d94e8803be7e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86647678c55adffc51114d036445ba10" id="r_a86647678c55adffc51114d036445ba10"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a86647678c55adffc51114d036445ba10">setResultMatrixOrigin</a> (MTL::Origin origin)</td></tr>
<tr class="separator:a86647678c55adffc51114d036445ba10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a82008429b4f14b5eba13142886b76cde" id="r_a82008429b4f14b5eba13142886b76cde"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a82008429b4f14b5eba13142886b76cde">setBatchStart</a> (NS::UInteger batchStart)</td></tr>
<tr class="separator:a82008429b4f14b5eba13142886b76cde"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac24cc7d71cdf3fd5bc4291ba2bfcd9e7" id="r_ac24cc7d71cdf3fd5bc4291ba2bfcd9e7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac24cc7d71cdf3fd5bc4291ba2bfcd9e7">setBatchSize</a> (NS::UInteger batchSize)</td></tr>
<tr class="separator:ac24cc7d71cdf3fd5bc4291ba2bfcd9e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a9f1400b36672bd6f228a80982e5b2717" id="r_a9f1400b36672bd6f228a80982e5b2717"><td class="memItemLeft" align="right" valign="top">static class <a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MatrixMultiplication</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9f1400b36672bd6f228a80982e5b2717">alloc</a> ()</td></tr>
<tr class="separator:a9f1400b36672bd6f228a80982e5b2717"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a9f1400b36672bd6f228a80982e5b2717" name="a9f1400b36672bd6f228a80982e5b2717"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f1400b36672bd6f228a80982e5b2717">&#9670;&#160;</a></span>alloc()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MatrixMultiplication</a> * MPS::MatrixMultiplication::alloc </td>
<td>(</td>
<td class="paramname"><span class="paramname"></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ad30480456e66b79fa47086a3411c4921" name="ad30480456e66b79fa47086a3411c4921"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad30480456e66b79fa47086a3411c4921">&#9670;&#160;</a></span>encodeToCommandBuffer()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE void MPS::MatrixMultiplication::encodeToCommandBuffer </td>
<td>(</td>
<td class="paramtype">MTL::CommandBuffer *</td> <td class="paramname"><span class="paramname"><em>commandBuffer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> *</td> <td class="paramname"><span class="paramname"><em>leftMatrix</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> *</td> <td class="paramname"><span class="paramname"><em>rightMatrix</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> *</td> <td class="paramname"><span class="paramname"><em>resultMatrix</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a35b1a908807eb8ececd0241531dea823" name="a35b1a908807eb8ececd0241531dea823"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35b1a908807eb8ececd0241531dea823">&#9670;&#160;</a></span>init()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_matrix_multiplication.html">MatrixMultiplication</a> * MPS::MatrixMultiplication::init </td>
<td>(</td>
<td class="paramtype">MTL::Device *</td> <td class="paramname"><span class="paramname"><em>device</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>transposeLeft</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>transposeRight</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>resultRows</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>resultColumns</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>interiorColumns</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>alpha</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>beta</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ac24cc7d71cdf3fd5bc4291ba2bfcd9e7" name="ac24cc7d71cdf3fd5bc4291ba2bfcd9e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac24cc7d71cdf3fd5bc4291ba2bfcd9e7">&#9670;&#160;</a></span>setBatchSize()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE void MPS::MatrixMultiplication::setBatchSize </td>
<td>(</td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>batchSize</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a82008429b4f14b5eba13142886b76cde" name="a82008429b4f14b5eba13142886b76cde"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a82008429b4f14b5eba13142886b76cde">&#9670;&#160;</a></span>setBatchStart()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE void MPS::MatrixMultiplication::setBatchStart </td>
<td>(</td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>batchStart</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a8b905b75090af80d97cf09b05cdad528" name="a8b905b75090af80d97cf09b05cdad528"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8b905b75090af80d97cf09b05cdad528">&#9670;&#160;</a></span>setLeftMatrixOrigin()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE void MPS::MatrixMultiplication::setLeftMatrixOrigin </td>
<td>(</td>
<td class="paramtype">MTL::Origin</td> <td class="paramname"><span class="paramname"><em>origin</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a86647678c55adffc51114d036445ba10" name="a86647678c55adffc51114d036445ba10"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a86647678c55adffc51114d036445ba10">&#9670;&#160;</a></span>setResultMatrixOrigin()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE void MPS::MatrixMultiplication::setResultMatrixOrigin </td>
<td>(</td>
<td class="paramtype">MTL::Origin</td> <td class="paramname"><span class="paramname"><em>origin</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="afaa45acd37397737ef4d94e8803be7e2" name="afaa45acd37397737ef4d94e8803be7e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afaa45acd37397737ef4d94e8803be7e2">&#9670;&#160;</a></span>setRightMatrixOrigin()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE void MPS::MatrixMultiplication::setRightMatrixOrigin </td>
<td>(</td>
<td class="paramtype">MTL::Origin</td> <td class="paramname"><span class="paramname"><em>origin</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>mlx/backend/metal/mps/<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,93 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html">MatrixVectorMultiplication</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">MPS::MatrixVectorMultiplication Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html">MPS::MatrixVectorMultiplication</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html#aeca798759333aae7fdd594835e93d16a">alloc</a>()</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html">MPS::MatrixVectorMultiplication</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html#adefd2759c843035c73da2d9aad8ffb8a">encodeToCommandBuffer</a>(MTL::CommandBuffer *commandBuffer, Matrix *inputMatrix, Vector *inputVector, Vector *resultVector)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html">MPS::MatrixVectorMultiplication</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html#a62c065490befe32c6a59b888b1347c80">init</a>(MTL::Device *device, bool transpose, NS::UInteger rows, NS::UInteger columns, double alpha, double beta)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html">MPS::MatrixVectorMultiplication</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,213 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: MPS::MatrixVectorMultiplication Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html">MatrixVectorMultiplication</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_m_p_s_1_1_matrix_vector_multiplication-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">MPS::MatrixVectorMultiplication Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for MPS::MatrixVectorMultiplication:</div>
<div class="dyncontent">
<div class="center">
<img src="class_m_p_s_1_1_matrix_vector_multiplication.png" alt=""/>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a62c065490befe32c6a59b888b1347c80" id="r_a62c065490befe32c6a59b888b1347c80"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html">MatrixVectorMultiplication</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a62c065490befe32c6a59b888b1347c80">init</a> (MTL::Device *device, bool transpose, NS::UInteger rows, NS::UInteger columns, double alpha, double beta)</td></tr>
<tr class="separator:a62c065490befe32c6a59b888b1347c80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adefd2759c843035c73da2d9aad8ffb8a" id="r_adefd2759c843035c73da2d9aad8ffb8a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#adefd2759c843035c73da2d9aad8ffb8a">encodeToCommandBuffer</a> (MTL::CommandBuffer *commandBuffer, <a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> *inputMatrix, <a class="el" href="class_m_p_s_1_1_vector.html">Vector</a> *inputVector, <a class="el" href="class_m_p_s_1_1_vector.html">Vector</a> *resultVector)</td></tr>
<tr class="separator:adefd2759c843035c73da2d9aad8ffb8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:aeca798759333aae7fdd594835e93d16a" id="r_aeca798759333aae7fdd594835e93d16a"><td class="memItemLeft" align="right" valign="top">static class <a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html">MatrixVectorMultiplication</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aeca798759333aae7fdd594835e93d16a">alloc</a> ()</td></tr>
<tr class="separator:aeca798759333aae7fdd594835e93d16a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aeca798759333aae7fdd594835e93d16a" name="aeca798759333aae7fdd594835e93d16a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeca798759333aae7fdd594835e93d16a">&#9670;&#160;</a></span>alloc()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html">MatrixVectorMultiplication</a> * MPS::MatrixVectorMultiplication::alloc </td>
<td>(</td>
<td class="paramname"><span class="paramname"></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="adefd2759c843035c73da2d9aad8ffb8a" name="adefd2759c843035c73da2d9aad8ffb8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adefd2759c843035c73da2d9aad8ffb8a">&#9670;&#160;</a></span>encodeToCommandBuffer()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE void MPS::MatrixVectorMultiplication::encodeToCommandBuffer </td>
<td>(</td>
<td class="paramtype">MTL::CommandBuffer *</td> <td class="paramname"><span class="paramname"><em>commandBuffer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_m_p_s_1_1_matrix.html">Matrix</a> *</td> <td class="paramname"><span class="paramname"><em>inputMatrix</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_m_p_s_1_1_vector.html">Vector</a> *</td> <td class="paramname"><span class="paramname"><em>inputVector</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_m_p_s_1_1_vector.html">Vector</a> *</td> <td class="paramname"><span class="paramname"><em>resultVector</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a62c065490befe32c6a59b888b1347c80" name="a62c065490befe32c6a59b888b1347c80"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a62c065490befe32c6a59b888b1347c80">&#9670;&#160;</a></span>init()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_matrix_vector_multiplication.html">MatrixVectorMultiplication</a> * MPS::MatrixVectorMultiplication::init </td>
<td>(</td>
<td class="paramtype">MTL::Device *</td> <td class="paramname"><span class="paramname"><em>device</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>transpose</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>rows</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>columns</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>alpha</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>beta</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>mlx/backend/metal/mps/<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,93 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_vector.html">Vector</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">MPS::Vector Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="class_m_p_s_1_1_vector.html">MPS::Vector</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_vector.html#ac08919c16342247963b14766e65332a3">alloc</a>()</td><td class="entry"><a class="el" href="class_m_p_s_1_1_vector.html">MPS::Vector</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_m_p_s_1_1_vector.html#a2ea0c0575489e4689d19640d1da1b179">init</a>(MTL::Buffer *buffer, VectorDescriptor *descriptor)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_vector.html">MPS::Vector</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_vector.html#aa95af1607e9978c2757f8a5503a95244">init</a>(const MTL::Buffer *buffer, VectorDescriptor *descriptor)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_vector.html">MPS::Vector</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,183 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: MPS::Vector Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_vector.html">Vector</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_m_p_s_1_1_vector-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">MPS::Vector Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for MPS::Vector:</div>
<div class="dyncontent">
<div class="center">
<img src="class_m_p_s_1_1_vector.png" alt=""/>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2ea0c0575489e4689d19640d1da1b179" id="r_a2ea0c0575489e4689d19640d1da1b179"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_m_p_s_1_1_vector.html">Vector</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2ea0c0575489e4689d19640d1da1b179">init</a> (MTL::Buffer *buffer, <a class="el" href="class_m_p_s_1_1_vector_descriptor.html">VectorDescriptor</a> *descriptor)</td></tr>
<tr class="separator:a2ea0c0575489e4689d19640d1da1b179"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa95af1607e9978c2757f8a5503a95244" id="r_aa95af1607e9978c2757f8a5503a95244"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_m_p_s_1_1_vector.html">Vector</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa95af1607e9978c2757f8a5503a95244">init</a> (const MTL::Buffer *buffer, <a class="el" href="class_m_p_s_1_1_vector_descriptor.html">VectorDescriptor</a> *descriptor)</td></tr>
<tr class="separator:aa95af1607e9978c2757f8a5503a95244"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ac08919c16342247963b14766e65332a3" id="r_ac08919c16342247963b14766e65332a3"><td class="memItemLeft" align="right" valign="top">static class <a class="el" href="class_m_p_s_1_1_vector.html">Vector</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac08919c16342247963b14766e65332a3">alloc</a> ()</td></tr>
<tr class="separator:ac08919c16342247963b14766e65332a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ac08919c16342247963b14766e65332a3" name="ac08919c16342247963b14766e65332a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac08919c16342247963b14766e65332a3">&#9670;&#160;</a></span>alloc()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_vector.html">Vector</a> * MPS::Vector::alloc </td>
<td>(</td>
<td class="paramname"><span class="paramname"></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aa95af1607e9978c2757f8a5503a95244" name="aa95af1607e9978c2757f8a5503a95244"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa95af1607e9978c2757f8a5503a95244">&#9670;&#160;</a></span>init() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_vector.html">Vector</a> * MPS::Vector::init </td>
<td>(</td>
<td class="paramtype">const MTL::Buffer *</td> <td class="paramname"><span class="paramname"><em>buffer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_m_p_s_1_1_vector_descriptor.html">VectorDescriptor</a> *</td> <td class="paramname"><span class="paramname"><em>descriptor</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a2ea0c0575489e4689d19640d1da1b179" name="a2ea0c0575489e4689d19640d1da1b179"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ea0c0575489e4689d19640d1da1b179">&#9670;&#160;</a></span>init() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_vector.html">Vector</a> * MPS::Vector::init </td>
<td>(</td>
<td class="paramtype">MTL::Buffer *</td> <td class="paramname"><span class="paramname"><em>buffer</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_m_p_s_1_1_vector_descriptor.html">VectorDescriptor</a> *</td> <td class="paramname"><span class="paramname"><em>descriptor</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>mlx/backend/metal/mps/<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

View File

@@ -0,0 +1,92 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_vector_descriptor.html">VectorDescriptor</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">MPS::VectorDescriptor Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="class_m_p_s_1_1_vector_descriptor.html">MPS::VectorDescriptor</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="class_m_p_s_1_1_vector_descriptor.html#a2bac55ff9bffcebba0755abcca09ec15">vectorDescriptor</a>(NS::UInteger length, NS::UInteger dataType)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_vector_descriptor.html">MPS::VectorDescriptor</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="class_m_p_s_1_1_vector_descriptor.html#ab6534f1c9536613d8e78ed72fe12b275">vectorDescriptor</a>(NS::UInteger length, NS::UInteger vectors, NS::UInteger vectorBytes, NS::UInteger dataType)</td><td class="entry"><a class="el" href="class_m_p_s_1_1_vector_descriptor.html">MPS::VectorDescriptor</a></td><td class="entry"><span class="mlabel">static</span></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,178 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: MPS::VectorDescriptor Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_m_p_s.html">MPS</a></li><li class="navelem"><a class="el" href="class_m_p_s_1_1_vector_descriptor.html">VectorDescriptor</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_m_p_s_1_1_vector_descriptor-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">MPS::VectorDescriptor Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for MPS::VectorDescriptor:</div>
<div class="dyncontent">
<div class="center">
<img src="class_m_p_s_1_1_vector_descriptor.png" alt=""/>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a2bac55ff9bffcebba0755abcca09ec15" id="r_a2bac55ff9bffcebba0755abcca09ec15"><td class="memItemLeft" align="right" valign="top">static class <a class="el" href="class_m_p_s_1_1_vector_descriptor.html">VectorDescriptor</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2bac55ff9bffcebba0755abcca09ec15">vectorDescriptor</a> (NS::UInteger length, NS::UInteger dataType)</td></tr>
<tr class="separator:a2bac55ff9bffcebba0755abcca09ec15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6534f1c9536613d8e78ed72fe12b275" id="r_ab6534f1c9536613d8e78ed72fe12b275"><td class="memItemLeft" align="right" valign="top">static class <a class="el" href="class_m_p_s_1_1_vector_descriptor.html">VectorDescriptor</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab6534f1c9536613d8e78ed72fe12b275">vectorDescriptor</a> (NS::UInteger length, NS::UInteger vectors, NS::UInteger vectorBytes, NS::UInteger dataType)</td></tr>
<tr class="separator:ab6534f1c9536613d8e78ed72fe12b275"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a2bac55ff9bffcebba0755abcca09ec15" name="a2bac55ff9bffcebba0755abcca09ec15"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2bac55ff9bffcebba0755abcca09ec15">&#9670;&#160;</a></span>vectorDescriptor() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_vector_descriptor.html">VectorDescriptor</a> * MPS::VectorDescriptor::vectorDescriptor </td>
<td>(</td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>length</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>dataType</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ab6534f1c9536613d8e78ed72fe12b275" name="ab6534f1c9536613d8e78ed72fe12b275"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab6534f1c9536613d8e78ed72fe12b275">&#9670;&#160;</a></span>vectorDescriptor() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">_MTL_INLINE <a class="el" href="class_m_p_s_1_1_vector_descriptor.html">VectorDescriptor</a> * MPS::VectorDescriptor::vectorDescriptor </td>
<td>(</td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>length</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>vectors</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>vectorBytes</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">NS::UInteger</td> <td class="paramname"><span class="paramname"><em>dataType</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>mlx/backend/metal/mps/<a class="el" href="mps_2gemm_8h_source.html">gemm.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

152
docs/build/html/classes.html vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,115 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacemlx.html">mlx</a></li><li class="navelem"><a class="el" href="namespacemlx_1_1core.html">core</a></li><li class="navelem"><a class="el" href="classmlx_1_1core_1_1_abs.html">Abs</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">mlx::core::Abs Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classmlx_1_1core_1_1_abs.html">mlx::core::Abs</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html#a1247e72feb640fb562d036b2dd1ae4ad">Abs</a>(Stream stream)</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html">mlx::core::Abs</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">explicit</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a8ae61e3289c4134232a69295268f8261">device</a>()</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html#a0d3e697496ef8e842d21195cb3c14e60">eval_cpu</a>(const std::vector&lt; array &gt; &amp;inputs, array &amp;out) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html">mlx::core::Abs</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#aa0ed6e32c36200a3ff9bc592c9b300db">mlx::core::UnaryPrimitive::eval_cpu</a>(const std::vector&lt; array &gt; &amp;inputs, std::vector&lt; array &gt; &amp;outputs) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html#a0a976e636dd8505b473fbdddf949f514">eval_gpu</a>(const std::vector&lt; array &gt; &amp;inputs, array &amp;out) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html">mlx::core::Abs</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a971fe9ad47f6569118879ce1d0f41447">mlx::core::UnaryPrimitive::eval_gpu</a>(const std::vector&lt; array &gt; &amp;inputs, std::vector&lt; array &gt; &amp;outputs) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html#ab6f0ec56bc7c048382297e12dabadc67">is_equivalent</a>(const Primitive &amp;other) const override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html">mlx::core::Abs</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html#a6c1e6eeaf4f5e63898c3487106e88e11">jvp</a>(const std::vector&lt; array &gt; &amp;primals, const std::vector&lt; array &gt; &amp;tangents, const std::vector&lt; int &gt; &amp;argnums) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html">mlx::core::Abs</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a0a859309a4f192f2679e07f2e4ff4d22">operator=</a>(const UnaryPrimitive &amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#ab90b2ea80f1d914be03cf44def5db5a5">operator=</a>(UnaryPrimitive &amp;&amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a6b1be7ea92f3a7bb19875c70259dad6b">mlx::core::Primitive::operator=</a>(const Primitive &amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a50bbddd43e1ba0cf5f127cd7aa756a9e">mlx::core::Primitive::operator=</a>(Primitive &amp;&amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html#ab6a2b147f58c83439ecefb9189c2da32">output_shapes</a>(const std::vector&lt; array &gt; &amp;inputs) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html">mlx::core::Abs</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#afc69f22ee1f6e8a9ecc2c3a8f43b8fdb">Primitive</a>(Stream stream)</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">explicit</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a3349f745fae50ca7627f79a731a19e32">Primitive</a>(const Primitive &amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a342da891b9882bdee9a0e0c1ac826eda">Primitive</a>(Primitive &amp;&amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html#a643d6db5116eed978e3208804a992107">print</a>(std::ostream &amp;os) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html">mlx::core::Abs</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a46e6257397a662528f9f831842ac456a">stream</a>()</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a189f6d4ed369f82a4b724a29eb056d4e">UnaryPrimitive</a>(Stream stream)</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">explicit</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a9935cffc4f246d3d883bc3d26c5163f2">UnaryPrimitive</a>(const UnaryPrimitive &amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a780281fb04e2daf1be630c124bd605e3">UnaryPrimitive</a>(UnaryPrimitive &amp;&amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html#aa2dd8ec0989e716b77394ac349b34592">vjp</a>(const std::vector&lt; array &gt; &amp;primals, const std::vector&lt; array &gt; &amp;cotangents, const std::vector&lt; int &gt; &amp;argnums, const std::vector&lt; array &gt; &amp;outputs) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html">mlx::core::Abs</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html#a4c9c98f1d71432fd3752ad9a6a8e7f2f">vmap</a>(const std::vector&lt; array &gt; &amp;inputs, const std::vector&lt; int &gt; &amp;axes) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_abs.html">mlx::core::Abs</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a29f70eb2d3b7e6c5fe52779c03f03777">~Primitive</a>()=default</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#ac0677ab99a5ca660ed6ab7902ea364de">~UnaryPrimitive</a>()=default</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,463 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx::core::Abs Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacemlx.html">mlx</a></li><li class="navelem"><a class="el" href="namespacemlx_1_1core.html">core</a></li><li class="navelem"><a class="el" href="classmlx_1_1core_1_1_abs.html">Abs</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classmlx_1_1core_1_1_abs-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">mlx::core::Abs Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="primitives_8h_source.html">primitives.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for mlx::core::Abs:</div>
<div class="dyncontent">
<div class="center">
<img src="classmlx_1_1core_1_1_abs.png" usemap="#mlx::core::Abs_map" alt=""/>
<map id="mlx::core::Abs_map" name="mlx::core::Abs_map">
<area href="classmlx_1_1core_1_1_unary_primitive.html" alt="mlx::core::UnaryPrimitive" shape="rect" coords="0,56,150,80"/>
<area href="classmlx_1_1core_1_1_primitive.html" alt="mlx::core::Primitive" shape="rect" coords="0,0,150,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a1247e72feb640fb562d036b2dd1ae4ad" id="r_a1247e72feb640fb562d036b2dd1ae4ad"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1247e72feb640fb562d036b2dd1ae4ad">Abs</a> (<a class="el" href="structmlx_1_1core_1_1_stream.html">Stream</a> <a class="el" href="classmlx_1_1core_1_1_primitive.html#a46e6257397a662528f9f831842ac456a">stream</a>)</td></tr>
<tr class="separator:a1247e72feb640fb562d036b2dd1ae4ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d3e697496ef8e842d21195cb3c14e60" id="r_a0d3e697496ef8e842d21195cb3c14e60"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0d3e697496ef8e842d21195cb3c14e60">eval_cpu</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;inputs, <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &amp;out) override</td></tr>
<tr class="separator:a0d3e697496ef8e842d21195cb3c14e60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a976e636dd8505b473fbdddf949f514" id="r_a0a976e636dd8505b473fbdddf949f514"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0a976e636dd8505b473fbdddf949f514">eval_gpu</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;inputs, <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &amp;out) override</td></tr>
<tr class="separator:a0a976e636dd8505b473fbdddf949f514"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4c9c98f1d71432fd3752ad9a6a8e7f2f" id="r_a4c9c98f1d71432fd3752ad9a6a8e7f2f"><td class="memItemLeft" align="right" valign="top">virtual std::pair&lt; std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt;, std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4c9c98f1d71432fd3752ad9a6a8e7f2f">vmap</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;inputs, const std::vector&lt; int &gt; &amp;axes) override</td></tr>
<tr class="memdesc:a4c9c98f1d71432fd3752ad9a6a8e7f2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">The primitive must know how to vectorize itself across the given axes. <br /></td></tr>
<tr class="separator:a4c9c98f1d71432fd3752ad9a6a8e7f2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c1e6eeaf4f5e63898c3487106e88e11" id="r_a6c1e6eeaf4f5e63898c3487106e88e11"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6c1e6eeaf4f5e63898c3487106e88e11">jvp</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;primals, const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;tangents, const std::vector&lt; int &gt; &amp;argnums) override</td></tr>
<tr class="memdesc:a6c1e6eeaf4f5e63898c3487106e88e11"><td class="mdescLeft">&#160;</td><td class="mdescRight">The Jacobian-vector product. <br /></td></tr>
<tr class="separator:a6c1e6eeaf4f5e63898c3487106e88e11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2dd8ec0989e716b77394ac349b34592" id="r_aa2dd8ec0989e716b77394ac349b34592"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa2dd8ec0989e716b77394ac349b34592">vjp</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;primals, const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;cotangents, const std::vector&lt; int &gt; &amp;argnums, const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;outputs) override</td></tr>
<tr class="memdesc:aa2dd8ec0989e716b77394ac349b34592"><td class="mdescLeft">&#160;</td><td class="mdescRight">The vector-Jacobian product. <br /></td></tr>
<tr class="separator:aa2dd8ec0989e716b77394ac349b34592"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a643d6db5116eed978e3208804a992107" id="r_a643d6db5116eed978e3208804a992107"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a643d6db5116eed978e3208804a992107">print</a> (std::ostream &amp;os) override</td></tr>
<tr class="memdesc:a643d6db5116eed978e3208804a992107"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print the primitive. <br /></td></tr>
<tr class="separator:a643d6db5116eed978e3208804a992107"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6f0ec56bc7c048382297e12dabadc67" id="r_ab6f0ec56bc7c048382297e12dabadc67"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab6f0ec56bc7c048382297e12dabadc67">is_equivalent</a> (const <a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;other) const override</td></tr>
<tr class="memdesc:ab6f0ec56bc7c048382297e12dabadc67"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalence check defaults to false unless overridden by the primitive. <br /></td></tr>
<tr class="separator:ab6f0ec56bc7c048382297e12dabadc67"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6a2b147f58c83439ecefb9189c2da32" id="r_ab6a2b147f58c83439ecefb9189c2da32"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab6a2b147f58c83439ecefb9189c2da32">output_shapes</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;inputs) override</td></tr>
<tr class="memdesc:ab6a2b147f58c83439ecefb9189c2da32"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the output shapes of the primitive. <br /></td></tr>
<tr class="separator:ab6a2b147f58c83439ecefb9189c2da32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classmlx_1_1core_1_1_unary_primitive"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classmlx_1_1core_1_1_unary_primitive')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td></tr>
<tr class="memitem:a189f6d4ed369f82a4b724a29eb056d4e inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_a189f6d4ed369f82a4b724a29eb056d4e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a189f6d4ed369f82a4b724a29eb056d4e">UnaryPrimitive</a> (<a class="el" href="structmlx_1_1core_1_1_stream.html">Stream</a> <a class="el" href="classmlx_1_1core_1_1_primitive.html#a46e6257397a662528f9f831842ac456a">stream</a>)</td></tr>
<tr class="memdesc:a189f6d4ed369f82a4b724a29eb056d4e inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="mdescLeft">&#160;</td><td class="mdescRight">An abstract base class for a primitive with a single output. <br /></td></tr>
<tr class="separator:a189f6d4ed369f82a4b724a29eb056d4e inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0ed6e32c36200a3ff9bc592c9b300db inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_aa0ed6e32c36200a3ff9bc592c9b300db"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#aa0ed6e32c36200a3ff9bc592c9b300db">eval_cpu</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;inputs, std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;outputs) override</td></tr>
<tr class="memdesc:aa0ed6e32c36200a3ff9bc592c9b300db inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="mdescLeft">&#160;</td><td class="mdescRight">A primitive must know how to evaluate itself on the CPU/GPU for the given inputs and populate the output arrays. <br /></td></tr>
<tr class="separator:aa0ed6e32c36200a3ff9bc592c9b300db inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a971fe9ad47f6569118879ce1d0f41447 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_a971fe9ad47f6569118879ce1d0f41447"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a971fe9ad47f6569118879ce1d0f41447">eval_gpu</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;inputs, std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;outputs) override</td></tr>
<tr class="separator:a971fe9ad47f6569118879ce1d0f41447 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0677ab99a5ca660ed6ab7902ea364de inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_ac0677ab99a5ca660ed6ab7902ea364de"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#ac0677ab99a5ca660ed6ab7902ea364de">~UnaryPrimitive</a> ()=default</td></tr>
<tr class="separator:ac0677ab99a5ca660ed6ab7902ea364de inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9935cffc4f246d3d883bc3d26c5163f2 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_a9935cffc4f246d3d883bc3d26c5163f2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a9935cffc4f246d3d883bc3d26c5163f2">UnaryPrimitive</a> (const <a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">UnaryPrimitive</a> &amp;other)=delete</td></tr>
<tr class="separator:a9935cffc4f246d3d883bc3d26c5163f2 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a780281fb04e2daf1be630c124bd605e3 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_a780281fb04e2daf1be630c124bd605e3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a780281fb04e2daf1be630c124bd605e3">UnaryPrimitive</a> (<a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">UnaryPrimitive</a> &amp;&amp;other)=delete</td></tr>
<tr class="separator:a780281fb04e2daf1be630c124bd605e3 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a859309a4f192f2679e07f2e4ff4d22 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_a0a859309a4f192f2679e07f2e4ff4d22"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">UnaryPrimitive</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a0a859309a4f192f2679e07f2e4ff4d22">operator=</a> (const <a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">UnaryPrimitive</a> &amp;other)=delete</td></tr>
<tr class="separator:a0a859309a4f192f2679e07f2e4ff4d22 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab90b2ea80f1d914be03cf44def5db5a5 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_ab90b2ea80f1d914be03cf44def5db5a5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">UnaryPrimitive</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#ab90b2ea80f1d914be03cf44def5db5a5">operator=</a> (<a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">UnaryPrimitive</a> &amp;&amp;other)=delete</td></tr>
<tr class="separator:ab90b2ea80f1d914be03cf44def5db5a5 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classmlx_1_1core_1_1_primitive"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classmlx_1_1core_1_1_primitive')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td></tr>
<tr class="memitem:afc69f22ee1f6e8a9ecc2c3a8f43b8fdb inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_afc69f22ee1f6e8a9ecc2c3a8f43b8fdb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#afc69f22ee1f6e8a9ecc2c3a8f43b8fdb">Primitive</a> (<a class="el" href="structmlx_1_1core_1_1_stream.html">Stream</a> <a class="el" href="classmlx_1_1core_1_1_primitive.html#a46e6257397a662528f9f831842ac456a">stream</a>)</td></tr>
<tr class="separator:afc69f22ee1f6e8a9ecc2c3a8f43b8fdb inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ae61e3289c4134232a69295268f8261 inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a8ae61e3289c4134232a69295268f8261"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structmlx_1_1core_1_1_device.html">Device</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a8ae61e3289c4134232a69295268f8261">device</a> ()</td></tr>
<tr class="memdesc:a8ae61e3289c4134232a69295268f8261 inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="mdescLeft">&#160;</td><td class="mdescRight">The device the primitive will run on. <br /></td></tr>
<tr class="separator:a8ae61e3289c4134232a69295268f8261 inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46e6257397a662528f9f831842ac456a inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a46e6257397a662528f9f831842ac456a"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structmlx_1_1core_1_1_stream.html">Stream</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a46e6257397a662528f9f831842ac456a">stream</a> ()</td></tr>
<tr class="memdesc:a46e6257397a662528f9f831842ac456a inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="mdescLeft">&#160;</td><td class="mdescRight">The stream the primitive will run on. <br /></td></tr>
<tr class="separator:a46e6257397a662528f9f831842ac456a inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a29f70eb2d3b7e6c5fe52779c03f03777 inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a29f70eb2d3b7e6c5fe52779c03f03777"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a29f70eb2d3b7e6c5fe52779c03f03777">~Primitive</a> ()=default</td></tr>
<tr class="separator:a29f70eb2d3b7e6c5fe52779c03f03777 inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3349f745fae50ca7627f79a731a19e32 inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a3349f745fae50ca7627f79a731a19e32"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a3349f745fae50ca7627f79a731a19e32">Primitive</a> (const <a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;other)=delete</td></tr>
<tr class="separator:a3349f745fae50ca7627f79a731a19e32 inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a342da891b9882bdee9a0e0c1ac826eda inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a342da891b9882bdee9a0e0c1ac826eda"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a342da891b9882bdee9a0e0c1ac826eda">Primitive</a> (<a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;&amp;other)=delete</td></tr>
<tr class="separator:a342da891b9882bdee9a0e0c1ac826eda inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b1be7ea92f3a7bb19875c70259dad6b inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a6b1be7ea92f3a7bb19875c70259dad6b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a6b1be7ea92f3a7bb19875c70259dad6b">operator=</a> (const <a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;other)=delete</td></tr>
<tr class="separator:a6b1be7ea92f3a7bb19875c70259dad6b inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a50bbddd43e1ba0cf5f127cd7aa756a9e inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a50bbddd43e1ba0cf5f127cd7aa756a9e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a50bbddd43e1ba0cf5f127cd7aa756a9e">operator=</a> (<a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;&amp;other)=delete</td></tr>
<tr class="separator:a50bbddd43e1ba0cf5f127cd7aa756a9e inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a1247e72feb640fb562d036b2dd1ae4ad" name="a1247e72feb640fb562d036b2dd1ae4ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1247e72feb640fb562d036b2dd1ae4ad">&#9670;&#160;</a></span>Abs()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">mlx::core::Abs::Abs </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structmlx_1_1core_1_1_stream.html">Stream</a></td> <td class="paramname"><span class="paramname"><em>stream</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a0d3e697496ef8e842d21195cb3c14e60" name="a0d3e697496ef8e842d21195cb3c14e60"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0d3e697496ef8e842d21195cb3c14e60">&#9670;&#160;</a></span>eval_cpu()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void mlx::core::Abs::eval_cpu </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>inputs</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classmlx_1_1core_1_1array.html">array</a> &amp;</td> <td class="paramname"><span class="paramname"><em>out</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a7e8f6f5d6ae0a33f6abc0f5a46e0b132">mlx::core::UnaryPrimitive</a>.</p>
</div>
</div>
<a id="a0a976e636dd8505b473fbdddf949f514" name="a0a976e636dd8505b473fbdddf949f514"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a976e636dd8505b473fbdddf949f514">&#9670;&#160;</a></span>eval_gpu()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void mlx::core::Abs::eval_gpu </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>inputs</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classmlx_1_1core_1_1array.html">array</a> &amp;</td> <td class="paramname"><span class="paramname"><em>out</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a6b7f80abaf038d53ec6ffbb0dfac6adb">mlx::core::UnaryPrimitive</a>.</p>
</div>
</div>
<a id="ab6f0ec56bc7c048382297e12dabadc67" name="ab6f0ec56bc7c048382297e12dabadc67"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab6f0ec56bc7c048382297e12dabadc67">&#9670;&#160;</a></span>is_equivalent()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool mlx::core::Abs::is_equivalent </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;</td> <td class="paramname"><span class="paramname"><em>other</em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Equivalence check defaults to false unless overridden by the primitive. </p>
<p>Reimplemented from <a class="el" href="classmlx_1_1core_1_1_primitive.html#a6140a502af4c2bbbc776ab26e9afebcd">mlx::core::Primitive</a>.</p>
</div>
</div>
<a id="a6c1e6eeaf4f5e63898c3487106e88e11" name="a6c1e6eeaf4f5e63898c3487106e88e11"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6c1e6eeaf4f5e63898c3487106e88e11">&#9670;&#160;</a></span>jvp()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; mlx::core::Abs::jvp </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>primals</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>tangents</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; int &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>argnums</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The Jacobian-vector product. </p>
<p>Reimplemented from <a class="el" href="classmlx_1_1core_1_1_primitive.html#a9fecf38f53da08ba1947543c2b3158c2">mlx::core::Primitive</a>.</p>
</div>
</div>
<a id="ab6a2b147f58c83439ecefb9189c2da32" name="ab6a2b147f58c83439ecefb9189c2da32"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab6a2b147f58c83439ecefb9189c2da32">&#9670;&#160;</a></span>output_shapes()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; std::vector&lt; int &gt; &gt; mlx::core::Abs::output_shapes </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>inputs</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the output shapes of the primitive. </p>
<p>This is not required to be implemented by derived classes, in which case it will throw. </p>
<p>Reimplemented from <a class="el" href="classmlx_1_1core_1_1_primitive.html#a8849dc20991398f6f9a24d6785673853">mlx::core::Primitive</a>.</p>
</div>
</div>
<a id="a643d6db5116eed978e3208804a992107" name="a643d6db5116eed978e3208804a992107"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a643d6db5116eed978e3208804a992107">&#9670;&#160;</a></span>print()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void mlx::core::Abs::print </td>
<td>(</td>
<td class="paramtype">std::ostream &amp;</td> <td class="paramname"><span class="paramname"><em>os</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Print the primitive. </p>
<p>Implements <a class="el" href="classmlx_1_1core_1_1_primitive.html#ae1aff91354ce036596088a3e19474ecb">mlx::core::Primitive</a>.</p>
</div>
</div>
<a id="aa2dd8ec0989e716b77394ac349b34592" name="aa2dd8ec0989e716b77394ac349b34592"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa2dd8ec0989e716b77394ac349b34592">&#9670;&#160;</a></span>vjp()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; mlx::core::Abs::vjp </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>primals</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>cotangents</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; int &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>argnums</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>outputs</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The vector-Jacobian product. </p>
<p>Reimplemented from <a class="el" href="classmlx_1_1core_1_1_primitive.html#a1dcb6807326eeab62474c6a0e3836d42">mlx::core::Primitive</a>.</p>
</div>
</div>
<a id="a4c9c98f1d71432fd3752ad9a6a8e7f2f" name="a4c9c98f1d71432fd3752ad9a6a8e7f2f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c9c98f1d71432fd3752ad9a6a8e7f2f">&#9670;&#160;</a></span>vmap()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual std::pair&lt; std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt;, std::vector&lt; int &gt; &gt; mlx::core::Abs::vmap </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>inputs</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; int &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>axes</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The primitive must know how to vectorize itself across the given axes. </p>
<p>The output is a pair containing the output arrays representing the vectorized computation and the axes which corresponds to the vectorized dimensions of each output. </p>
<p>Reimplemented from <a class="el" href="classmlx_1_1core_1_1_primitive.html#ac632b9619dd7a6a0f177bd36202e8103">mlx::core::Primitive</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>mlx/<a class="el" href="primitives_8h_source.html">primitives.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 B

View File

@@ -0,0 +1,115 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacemlx.html">mlx</a></li><li class="navelem"><a class="el" href="namespacemlx_1_1core.html">core</a></li><li class="navelem"><a class="el" href="classmlx_1_1core_1_1_add.html">Add</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">mlx::core::Add Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classmlx_1_1core_1_1_add.html">mlx::core::Add</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html#ae3fd5483f3454eac3df256e3f5f3cdae">Add</a>(Stream stream)</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html">mlx::core::Add</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">explicit</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a8ae61e3289c4134232a69295268f8261">device</a>()</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html#a5bacfc51dfa2a5a931bad2dd7bdc7a5f">eval_cpu</a>(const std::vector&lt; array &gt; &amp;inputs, array &amp;out) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html">mlx::core::Add</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#aa0ed6e32c36200a3ff9bc592c9b300db">mlx::core::UnaryPrimitive::eval_cpu</a>(const std::vector&lt; array &gt; &amp;inputs, std::vector&lt; array &gt; &amp;outputs) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html#aa0aacbc1e26b95a2f040f62aa4f69c3d">eval_gpu</a>(const std::vector&lt; array &gt; &amp;inputs, array &amp;out) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html">mlx::core::Add</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a971fe9ad47f6569118879ce1d0f41447">mlx::core::UnaryPrimitive::eval_gpu</a>(const std::vector&lt; array &gt; &amp;inputs, std::vector&lt; array &gt; &amp;outputs) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html#aba0a35410c3aac53d0f7a0c283d9ee3f">is_equivalent</a>(const Primitive &amp;other) const override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html">mlx::core::Add</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html#a77230069f76fe60a2fe1007822a277b7">jvp</a>(const std::vector&lt; array &gt; &amp;primals, const std::vector&lt; array &gt; &amp;tangents, const std::vector&lt; int &gt; &amp;argnums) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html">mlx::core::Add</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a0a859309a4f192f2679e07f2e4ff4d22">operator=</a>(const UnaryPrimitive &amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#ab90b2ea80f1d914be03cf44def5db5a5">operator=</a>(UnaryPrimitive &amp;&amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a6b1be7ea92f3a7bb19875c70259dad6b">mlx::core::Primitive::operator=</a>(const Primitive &amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a50bbddd43e1ba0cf5f127cd7aa756a9e">mlx::core::Primitive::operator=</a>(Primitive &amp;&amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html#a9884fece6ca4061a65241c985fcf1594">output_shapes</a>(const std::vector&lt; array &gt; &amp;inputs) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html">mlx::core::Add</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#afc69f22ee1f6e8a9ecc2c3a8f43b8fdb">Primitive</a>(Stream stream)</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">explicit</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a3349f745fae50ca7627f79a731a19e32">Primitive</a>(const Primitive &amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a342da891b9882bdee9a0e0c1ac826eda">Primitive</a>(Primitive &amp;&amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html#a8a96345aa63724f22b68bca7b861211d">print</a>(std::ostream &amp;os) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html">mlx::core::Add</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a46e6257397a662528f9f831842ac456a">stream</a>()</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a189f6d4ed369f82a4b724a29eb056d4e">UnaryPrimitive</a>(Stream stream)</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">explicit</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a9935cffc4f246d3d883bc3d26c5163f2">UnaryPrimitive</a>(const UnaryPrimitive &amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a780281fb04e2daf1be630c124bd605e3">UnaryPrimitive</a>(UnaryPrimitive &amp;&amp;other)=delete</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html#ac28e581862880e24ed2b99bb6a916607">vjp</a>(const std::vector&lt; array &gt; &amp;primals, const std::vector&lt; array &gt; &amp;cotangents, const std::vector&lt; int &gt; &amp;argnums, const std::vector&lt; array &gt; &amp;outputs) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html">mlx::core::Add</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html#a0e557d4d896153f84a25532562e4c646">vmap</a>(const std::vector&lt; array &gt; &amp;inputs, const std::vector&lt; int &gt; &amp;axes) override</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_add.html">mlx::core::Add</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a29f70eb2d3b7e6c5fe52779c03f03777">~Primitive</a>()=default</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#ac0677ab99a5ca660ed6ab7902ea364de">~UnaryPrimitive</a>()=default</td><td class="entry"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

View File

@@ -0,0 +1,463 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MLX: mlx::core::Add Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MLX
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacemlx.html">mlx</a></li><li class="navelem"><a class="el" href="namespacemlx_1_1core.html">core</a></li><li class="navelem"><a class="el" href="classmlx_1_1core_1_1_add.html">Add</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classmlx_1_1core_1_1_add-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">mlx::core::Add Class Reference</div></div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="primitives_8h_source.html">primitives.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for mlx::core::Add:</div>
<div class="dyncontent">
<div class="center">
<img src="classmlx_1_1core_1_1_add.png" usemap="#mlx::core::Add_map" alt=""/>
<map id="mlx::core::Add_map" name="mlx::core::Add_map">
<area href="classmlx_1_1core_1_1_unary_primitive.html" alt="mlx::core::UnaryPrimitive" shape="rect" coords="0,56,150,80"/>
<area href="classmlx_1_1core_1_1_primitive.html" alt="mlx::core::Primitive" shape="rect" coords="0,0,150,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae3fd5483f3454eac3df256e3f5f3cdae" id="r_ae3fd5483f3454eac3df256e3f5f3cdae"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae3fd5483f3454eac3df256e3f5f3cdae">Add</a> (<a class="el" href="structmlx_1_1core_1_1_stream.html">Stream</a> <a class="el" href="classmlx_1_1core_1_1_primitive.html#a46e6257397a662528f9f831842ac456a">stream</a>)</td></tr>
<tr class="separator:ae3fd5483f3454eac3df256e3f5f3cdae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bacfc51dfa2a5a931bad2dd7bdc7a5f" id="r_a5bacfc51dfa2a5a931bad2dd7bdc7a5f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5bacfc51dfa2a5a931bad2dd7bdc7a5f">eval_cpu</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;inputs, <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &amp;out) override</td></tr>
<tr class="separator:a5bacfc51dfa2a5a931bad2dd7bdc7a5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0aacbc1e26b95a2f040f62aa4f69c3d" id="r_aa0aacbc1e26b95a2f040f62aa4f69c3d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa0aacbc1e26b95a2f040f62aa4f69c3d">eval_gpu</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;inputs, <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &amp;out) override</td></tr>
<tr class="separator:aa0aacbc1e26b95a2f040f62aa4f69c3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0e557d4d896153f84a25532562e4c646" id="r_a0e557d4d896153f84a25532562e4c646"><td class="memItemLeft" align="right" valign="top">virtual std::pair&lt; std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt;, std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0e557d4d896153f84a25532562e4c646">vmap</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;inputs, const std::vector&lt; int &gt; &amp;axes) override</td></tr>
<tr class="memdesc:a0e557d4d896153f84a25532562e4c646"><td class="mdescLeft">&#160;</td><td class="mdescRight">The primitive must know how to vectorize itself across the given axes. <br /></td></tr>
<tr class="separator:a0e557d4d896153f84a25532562e4c646"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77230069f76fe60a2fe1007822a277b7" id="r_a77230069f76fe60a2fe1007822a277b7"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a77230069f76fe60a2fe1007822a277b7">jvp</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;primals, const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;tangents, const std::vector&lt; int &gt; &amp;argnums) override</td></tr>
<tr class="memdesc:a77230069f76fe60a2fe1007822a277b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">The Jacobian-vector product. <br /></td></tr>
<tr class="separator:a77230069f76fe60a2fe1007822a277b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac28e581862880e24ed2b99bb6a916607" id="r_ac28e581862880e24ed2b99bb6a916607"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac28e581862880e24ed2b99bb6a916607">vjp</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;primals, const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;cotangents, const std::vector&lt; int &gt; &amp;argnums, const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;outputs) override</td></tr>
<tr class="memdesc:ac28e581862880e24ed2b99bb6a916607"><td class="mdescLeft">&#160;</td><td class="mdescRight">The vector-Jacobian product. <br /></td></tr>
<tr class="separator:ac28e581862880e24ed2b99bb6a916607"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a96345aa63724f22b68bca7b861211d" id="r_a8a96345aa63724f22b68bca7b861211d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8a96345aa63724f22b68bca7b861211d">print</a> (std::ostream &amp;os) override</td></tr>
<tr class="memdesc:a8a96345aa63724f22b68bca7b861211d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print the primitive. <br /></td></tr>
<tr class="separator:a8a96345aa63724f22b68bca7b861211d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba0a35410c3aac53d0f7a0c283d9ee3f" id="r_aba0a35410c3aac53d0f7a0c283d9ee3f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aba0a35410c3aac53d0f7a0c283d9ee3f">is_equivalent</a> (const <a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;other) const override</td></tr>
<tr class="memdesc:aba0a35410c3aac53d0f7a0c283d9ee3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalence check defaults to false unless overridden by the primitive. <br /></td></tr>
<tr class="separator:aba0a35410c3aac53d0f7a0c283d9ee3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9884fece6ca4061a65241c985fcf1594" id="r_a9884fece6ca4061a65241c985fcf1594"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9884fece6ca4061a65241c985fcf1594">output_shapes</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;inputs) override</td></tr>
<tr class="memdesc:a9884fece6ca4061a65241c985fcf1594"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the output shapes of the primitive. <br /></td></tr>
<tr class="separator:a9884fece6ca4061a65241c985fcf1594"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classmlx_1_1core_1_1_unary_primitive"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classmlx_1_1core_1_1_unary_primitive')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">mlx::core::UnaryPrimitive</a></td></tr>
<tr class="memitem:a189f6d4ed369f82a4b724a29eb056d4e inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_a189f6d4ed369f82a4b724a29eb056d4e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a189f6d4ed369f82a4b724a29eb056d4e">UnaryPrimitive</a> (<a class="el" href="structmlx_1_1core_1_1_stream.html">Stream</a> <a class="el" href="classmlx_1_1core_1_1_primitive.html#a46e6257397a662528f9f831842ac456a">stream</a>)</td></tr>
<tr class="memdesc:a189f6d4ed369f82a4b724a29eb056d4e inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="mdescLeft">&#160;</td><td class="mdescRight">An abstract base class for a primitive with a single output. <br /></td></tr>
<tr class="separator:a189f6d4ed369f82a4b724a29eb056d4e inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0ed6e32c36200a3ff9bc592c9b300db inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_aa0ed6e32c36200a3ff9bc592c9b300db"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#aa0ed6e32c36200a3ff9bc592c9b300db">eval_cpu</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;inputs, std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;outputs) override</td></tr>
<tr class="memdesc:aa0ed6e32c36200a3ff9bc592c9b300db inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="mdescLeft">&#160;</td><td class="mdescRight">A primitive must know how to evaluate itself on the CPU/GPU for the given inputs and populate the output arrays. <br /></td></tr>
<tr class="separator:aa0ed6e32c36200a3ff9bc592c9b300db inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a971fe9ad47f6569118879ce1d0f41447 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_a971fe9ad47f6569118879ce1d0f41447"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a971fe9ad47f6569118879ce1d0f41447">eval_gpu</a> (const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;inputs, std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;outputs) override</td></tr>
<tr class="separator:a971fe9ad47f6569118879ce1d0f41447 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac0677ab99a5ca660ed6ab7902ea364de inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_ac0677ab99a5ca660ed6ab7902ea364de"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#ac0677ab99a5ca660ed6ab7902ea364de">~UnaryPrimitive</a> ()=default</td></tr>
<tr class="separator:ac0677ab99a5ca660ed6ab7902ea364de inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9935cffc4f246d3d883bc3d26c5163f2 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_a9935cffc4f246d3d883bc3d26c5163f2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a9935cffc4f246d3d883bc3d26c5163f2">UnaryPrimitive</a> (const <a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">UnaryPrimitive</a> &amp;other)=delete</td></tr>
<tr class="separator:a9935cffc4f246d3d883bc3d26c5163f2 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a780281fb04e2daf1be630c124bd605e3 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_a780281fb04e2daf1be630c124bd605e3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a780281fb04e2daf1be630c124bd605e3">UnaryPrimitive</a> (<a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">UnaryPrimitive</a> &amp;&amp;other)=delete</td></tr>
<tr class="separator:a780281fb04e2daf1be630c124bd605e3 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a859309a4f192f2679e07f2e4ff4d22 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_a0a859309a4f192f2679e07f2e4ff4d22"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">UnaryPrimitive</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a0a859309a4f192f2679e07f2e4ff4d22">operator=</a> (const <a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">UnaryPrimitive</a> &amp;other)=delete</td></tr>
<tr class="separator:a0a859309a4f192f2679e07f2e4ff4d22 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab90b2ea80f1d914be03cf44def5db5a5 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive" id="r_ab90b2ea80f1d914be03cf44def5db5a5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">UnaryPrimitive</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#ab90b2ea80f1d914be03cf44def5db5a5">operator=</a> (<a class="el" href="classmlx_1_1core_1_1_unary_primitive.html">UnaryPrimitive</a> &amp;&amp;other)=delete</td></tr>
<tr class="separator:ab90b2ea80f1d914be03cf44def5db5a5 inherit pub_methods_classmlx_1_1core_1_1_unary_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classmlx_1_1core_1_1_primitive"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classmlx_1_1core_1_1_primitive')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classmlx_1_1core_1_1_primitive.html">mlx::core::Primitive</a></td></tr>
<tr class="memitem:afc69f22ee1f6e8a9ecc2c3a8f43b8fdb inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_afc69f22ee1f6e8a9ecc2c3a8f43b8fdb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#afc69f22ee1f6e8a9ecc2c3a8f43b8fdb">Primitive</a> (<a class="el" href="structmlx_1_1core_1_1_stream.html">Stream</a> <a class="el" href="classmlx_1_1core_1_1_primitive.html#a46e6257397a662528f9f831842ac456a">stream</a>)</td></tr>
<tr class="separator:afc69f22ee1f6e8a9ecc2c3a8f43b8fdb inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ae61e3289c4134232a69295268f8261 inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a8ae61e3289c4134232a69295268f8261"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structmlx_1_1core_1_1_device.html">Device</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a8ae61e3289c4134232a69295268f8261">device</a> ()</td></tr>
<tr class="memdesc:a8ae61e3289c4134232a69295268f8261 inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="mdescLeft">&#160;</td><td class="mdescRight">The device the primitive will run on. <br /></td></tr>
<tr class="separator:a8ae61e3289c4134232a69295268f8261 inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46e6257397a662528f9f831842ac456a inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a46e6257397a662528f9f831842ac456a"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structmlx_1_1core_1_1_stream.html">Stream</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a46e6257397a662528f9f831842ac456a">stream</a> ()</td></tr>
<tr class="memdesc:a46e6257397a662528f9f831842ac456a inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="mdescLeft">&#160;</td><td class="mdescRight">The stream the primitive will run on. <br /></td></tr>
<tr class="separator:a46e6257397a662528f9f831842ac456a inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a29f70eb2d3b7e6c5fe52779c03f03777 inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a29f70eb2d3b7e6c5fe52779c03f03777"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a29f70eb2d3b7e6c5fe52779c03f03777">~Primitive</a> ()=default</td></tr>
<tr class="separator:a29f70eb2d3b7e6c5fe52779c03f03777 inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3349f745fae50ca7627f79a731a19e32 inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a3349f745fae50ca7627f79a731a19e32"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a3349f745fae50ca7627f79a731a19e32">Primitive</a> (const <a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;other)=delete</td></tr>
<tr class="separator:a3349f745fae50ca7627f79a731a19e32 inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a342da891b9882bdee9a0e0c1ac826eda inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a342da891b9882bdee9a0e0c1ac826eda"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a342da891b9882bdee9a0e0c1ac826eda">Primitive</a> (<a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;&amp;other)=delete</td></tr>
<tr class="separator:a342da891b9882bdee9a0e0c1ac826eda inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b1be7ea92f3a7bb19875c70259dad6b inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a6b1be7ea92f3a7bb19875c70259dad6b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a6b1be7ea92f3a7bb19875c70259dad6b">operator=</a> (const <a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;other)=delete</td></tr>
<tr class="separator:a6b1be7ea92f3a7bb19875c70259dad6b inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a50bbddd43e1ba0cf5f127cd7aa756a9e inherit pub_methods_classmlx_1_1core_1_1_primitive" id="r_a50bbddd43e1ba0cf5f127cd7aa756a9e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmlx_1_1core_1_1_primitive.html#a50bbddd43e1ba0cf5f127cd7aa756a9e">operator=</a> (<a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;&amp;other)=delete</td></tr>
<tr class="separator:a50bbddd43e1ba0cf5f127cd7aa756a9e inherit pub_methods_classmlx_1_1core_1_1_primitive"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ae3fd5483f3454eac3df256e3f5f3cdae" name="ae3fd5483f3454eac3df256e3f5f3cdae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3fd5483f3454eac3df256e3f5f3cdae">&#9670;&#160;</a></span>Add()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">mlx::core::Add::Add </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structmlx_1_1core_1_1_stream.html">Stream</a></td> <td class="paramname"><span class="paramname"><em>stream</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a5bacfc51dfa2a5a931bad2dd7bdc7a5f" name="a5bacfc51dfa2a5a931bad2dd7bdc7a5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5bacfc51dfa2a5a931bad2dd7bdc7a5f">&#9670;&#160;</a></span>eval_cpu()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void mlx::core::Add::eval_cpu </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>inputs</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classmlx_1_1core_1_1array.html">array</a> &amp;</td> <td class="paramname"><span class="paramname"><em>out</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a7e8f6f5d6ae0a33f6abc0f5a46e0b132">mlx::core::UnaryPrimitive</a>.</p>
</div>
</div>
<a id="aa0aacbc1e26b95a2f040f62aa4f69c3d" name="aa0aacbc1e26b95a2f040f62aa4f69c3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0aacbc1e26b95a2f040f62aa4f69c3d">&#9670;&#160;</a></span>eval_gpu()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void mlx::core::Add::eval_gpu </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>inputs</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classmlx_1_1core_1_1array.html">array</a> &amp;</td> <td class="paramname"><span class="paramname"><em>out</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Implements <a class="el" href="classmlx_1_1core_1_1_unary_primitive.html#a6b7f80abaf038d53ec6ffbb0dfac6adb">mlx::core::UnaryPrimitive</a>.</p>
</div>
</div>
<a id="aba0a35410c3aac53d0f7a0c283d9ee3f" name="aba0a35410c3aac53d0f7a0c283d9ee3f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba0a35410c3aac53d0f7a0c283d9ee3f">&#9670;&#160;</a></span>is_equivalent()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool mlx::core::Add::is_equivalent </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classmlx_1_1core_1_1_primitive.html">Primitive</a> &amp;</td> <td class="paramname"><span class="paramname"><em>other</em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Equivalence check defaults to false unless overridden by the primitive. </p>
<p>Reimplemented from <a class="el" href="classmlx_1_1core_1_1_primitive.html#a6140a502af4c2bbbc776ab26e9afebcd">mlx::core::Primitive</a>.</p>
</div>
</div>
<a id="a77230069f76fe60a2fe1007822a277b7" name="a77230069f76fe60a2fe1007822a277b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a77230069f76fe60a2fe1007822a277b7">&#9670;&#160;</a></span>jvp()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; mlx::core::Add::jvp </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>primals</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>tangents</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; int &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>argnums</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The Jacobian-vector product. </p>
<p>Reimplemented from <a class="el" href="classmlx_1_1core_1_1_primitive.html#a9fecf38f53da08ba1947543c2b3158c2">mlx::core::Primitive</a>.</p>
</div>
</div>
<a id="a9884fece6ca4061a65241c985fcf1594" name="a9884fece6ca4061a65241c985fcf1594"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9884fece6ca4061a65241c985fcf1594">&#9670;&#160;</a></span>output_shapes()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; std::vector&lt; int &gt; &gt; mlx::core::Add::output_shapes </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>inputs</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the output shapes of the primitive. </p>
<p>This is not required to be implemented by derived classes, in which case it will throw. </p>
<p>Reimplemented from <a class="el" href="classmlx_1_1core_1_1_primitive.html#a8849dc20991398f6f9a24d6785673853">mlx::core::Primitive</a>.</p>
</div>
</div>
<a id="a8a96345aa63724f22b68bca7b861211d" name="a8a96345aa63724f22b68bca7b861211d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a96345aa63724f22b68bca7b861211d">&#9670;&#160;</a></span>print()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void mlx::core::Add::print </td>
<td>(</td>
<td class="paramtype">std::ostream &amp;</td> <td class="paramname"><span class="paramname"><em>os</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Print the primitive. </p>
<p>Implements <a class="el" href="classmlx_1_1core_1_1_primitive.html#ae1aff91354ce036596088a3e19474ecb">mlx::core::Primitive</a>.</p>
</div>
</div>
<a id="ac28e581862880e24ed2b99bb6a916607" name="ac28e581862880e24ed2b99bb6a916607"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac28e581862880e24ed2b99bb6a916607">&#9670;&#160;</a></span>vjp()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; mlx::core::Add::vjp </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>primals</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>cotangents</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; int &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>argnums</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>outputs</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The vector-Jacobian product. </p>
<p>Reimplemented from <a class="el" href="classmlx_1_1core_1_1_primitive.html#a1dcb6807326eeab62474c6a0e3836d42">mlx::core::Primitive</a>.</p>
</div>
</div>
<a id="a0e557d4d896153f84a25532562e4c646" name="a0e557d4d896153f84a25532562e4c646"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0e557d4d896153f84a25532562e4c646">&#9670;&#160;</a></span>vmap()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual std::pair&lt; std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt;, std::vector&lt; int &gt; &gt; mlx::core::Add::vmap </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; <a class="el" href="classmlx_1_1core_1_1array.html">array</a> &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>inputs</em>, </span></td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; int &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>axes</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The primitive must know how to vectorize itself across the given axes. </p>
<p>The output is a pair containing the output arrays representing the vectorized computation and the axes which corresponds to the vectorized dimensions of each output. </p>
<p>Reimplemented from <a class="el" href="classmlx_1_1core_1_1_primitive.html#ac632b9619dd7a6a0f177bd36202e8103">mlx::core::Primitive</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>mlx/<a class="el" href="primitives_8h_source.html">primitives.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More