MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
tensor.cpp
Go to the documentation of this file.
2
3#include <mim/plugin.h>
4
10
11using namespace mim;
12using namespace mim::plug;
13
14namespace mim::plug::tensor {
22} // namespace mim::plug::tensor
23
24// clang-format off
25static constexpr PluginArg known_args[] = {
26 {"reassoc-max=<n>", "Longest matrix chain whose `Catalan(n − 1)` bracketings `tensor.reassoc` enumerates and, failing one that provably wins for every extent, dispatches over at run time (default `4`; below `3` switches the dispatch off)."},
27 {"vec-width=<n>", "Vector lanes the target's registers hold (`1`, `4`, `8` or `16`, default `8`). It caps the block of independent accumulators a vectorized loop body jams into its registers, and `tensor.reassoc` charges each product's vector loop in units of it; `1` means no lane-sized blocking and plain multiplication counts. See `tensor.vec_width`."},
28};
29// clang-format on
30
32 plugin.register_normalizers = tensor::register_normalizers;
33 plugin.register_phases = tensor::reg_phases;
34 plugin.args = known_args;
35 plugin.num_args = std::size(known_args);
36}
static void hook(Flags2Phases &phases)
Definition phase.h:51
The tensor Plugin
Definition constraints.h:5
void register_normalizers(Normalizers &normalizers)
static void reg_phases(Flags2Phases &phases)
Definition tensor.cpp:15
Definition ast.h:16
ankerl::unordered_dense::map< flags_t, std::function< std::unique_ptr< Phase >(World &)> > Flags2Phases
Maps an axiom of a Phase to a function that creates one.
Definition plugin.h:30
One -X <plugin>:<arg> a Plugin understands; see Arguments.
Definition plugin.h:34
#define MIM_PLUGIN_ENTRY(p)
Defines a Plugin's entry point; the body fills in the plugin handed to it, as in MIM_PLUGIN_ENTRY(dem...
Definition plugin.h:196
static constexpr PluginArg known_args[]
Definition tensor.cpp:25