MimIR
0.1
MimIR is my Intermediate Representation
Toggle main menu visibility
Main Page
Documentation
Mim Command-Line Reference
Mim Language Reference
Coding & Debugging
Developer Guide
Passes
Plugins
affine
autodiff
clos
compile
core
demo
direct
math
matrix
mem
opt
refly
regex
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
Variables
Typedefs
a
b
d
f
g
j
l
m
n
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
i
l
m
n
p
q
r
s
t
v
w
z
Enumerator
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
~
Variables
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
w
Typedefs
Enumerations
Enumerator
Related Symbols
a
b
c
d
f
i
l
n
o
p
s
w
Files
File List
File Members
All
a
c
d
e
g
h
i
m
r
v
w
Functions
Typedefs
Macros
a
c
d
e
g
h
i
m
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Concepts
Loading...
Searching...
No Matches
matrix.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
mim/world.h
>
4
5
#include <
mim/pass/pipelinebuilder.h
>
6
7
#include "
mim/plug/matrix/autogen.h
"
8
9
namespace
mim::plug::matrix
{
10
11
#define INTERNAL_PREFIX "internal_mapRed_"
12
13
/// %mat.zero: [n: Nat, S: «n; Nat», m: Nat] -> %mat.Mat (n,S,(Idx m));
14
inline
const
Def
*
zero_int
(
World
& w,
Ref
n,
Ref
S,
Ref
mem
,
nat_t
m) {
15
// TODO: use mim definition by name
16
return
w.app(w.annex<
matrix::constMat
>(), {n, S, w.type_idx(m), mem, w.lit_idx(m, 0)});
17
}
14
inline
const
Def
*
zero_int
(
World
& w,
Ref
n,
Ref
S,
Ref
mem
,
nat_t
m) {
…
}
18
19
inline
const
Def
*
op_read
(
Ref
mem
,
Ref
matrix,
Ref
idx) {
20
auto
& world = matrix->
world
();
21
auto
mat_ty =
match<Mat>
(matrix->
type
());
22
if
(!mat_ty)
return
matrix;
23
assert(mat_ty);
24
world.DLOG(
"matrix read: {}[{}]"
, matrix, idx);
25
world.DLOG(
" matrix type: {}"
, matrix->
type
());
26
auto
[n, S, T] = mat_ty->args<3>();
27
world.DLOG(
" (n,S,T): {}, {}, {}"
, n, S, T);
28
return
world.app(world.app(world.annex<
read
>(), {n, S, T}), {mem, matrix, idx});
29
}
19
inline
const
Def
*
op_read
(
Ref
mem
,
Ref
matrix,
Ref
idx) {
…
}
30
31
}
// namespace mim::plug::matrix
9
namespace
mim::plug::matrix
{
…
}
mim::Def
Base class for all Defs.
Definition
def.h:212
mim::Def::world
World & world() const noexcept
Definition
def.cpp:384
mim::Def::type
Ref type() const noexcept
Yields the raw type of this Def, i.e. maybe nullptr.
Definition
def.h:241
mim::Ref
Helper class to retrieve Infer::arg if present.
Definition
def.h:86
mim::World
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition
world.h:33
autogen.h
mim::plug::matrix
The matrix Plugin
Definition
matrix.h:9
mim::plug::matrix::constMat
constMat
Definition
autogen.h:29
mim::plug::matrix::op_read
const Def * op_read(Ref mem, Ref matrix, Ref idx)
Definition
matrix.h:19
mim::plug::matrix::zero_int
const Def * zero_int(World &w, Ref n, Ref S, Ref mem, nat_t m)
mat.zero: [n: Nat, S: «n; Nat», m: Nat] -> mat.Mat (n,S,(Idx m));
Definition
matrix.h:14
mim::plug::matrix::read
read
Definition
autogen.h:36
mim::plug::mem
The mem Plugin
Definition
mem.h:11
mim::nat_t
u64 nat_t
Definition
types.h:43
mim::match
auto match(Ref def)
Definition
axiom.h:112
pipelinebuilder.h
world.h
include
mim
plug
matrix
matrix.h
Generated by
1.12.0