MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
tensor.h File Reference
#include <optional>
#include <fe/worklist.h>
#include <mim/lam.h>
#include <mim/tuple.h>
#include <mim/world.h>
#include "mim/plug/tensor/autogen.h"
Include dependency graph for tensor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mim::plug::tensor::PureRead
 A pure re-indexed read: the source tensor, the access map into it (over the read's output coordinates), and the source's element type/rank/shape. More...

Namespaces

namespace  mim
namespace  mim::plug
namespace  mim::plug::tensor
 The tensor Plugin

Functions

bool mim::plug::tensor::is_copy_comb (const Def *comb)
 Recognizes the (rebuilt) tensor_copy combiner (acc, ys) ↦ ys#0: the result is exactly the single input element, so a map_reduce built on it is a pure re-indexed read of that input.
bool mim::plug::tensor::is_identity_post (const Def *post)
 Is post the (rebuilt) CPS identity tensor.id, i.e.
std::optional< PureReadmim::plug::tensor::is_pure_read (const Def *value)
 If value is a pure re-indexed read — a copy-combiner map_reduce without reduction loops that writes its full loop domain through the identity output map (reshape/transpose/slice/flip/repeat lower to these) — returns its single access map and source.
const Defmim::plug::tensor::op_get (const Def *T, const Def *r, const Def *s, const Def *arr, const Def *index)
const Defmim::plug::tensor::op_set (const Def *T, const Def *r, const Def *s, const Def *arr, const Def *index, const Def *x)
template<class Pred>
DefMap< u64mim::plug::tensor::count_consumers (const World &world, Pred pred)
 Counts the consumers of every def of world matched by pred.

Class Documentation

◆ mim::plug::tensor::PureRead

struct mim::plug::tensor::PureRead

A pure re-indexed read: the source tensor, the access map into it (over the read's output coordinates), and the source's element type/rank/shape.

Definition at line 31 of file tensor.h.

Class Members
const Def * map = nullptr
const Def * R = nullptr
const Def * S = nullptr
const Def * src = nullptr
const Def * T = nullptr