MimIR
0.5-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
Loading...
Searching...
No Matches
autogen.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
mim/axm.h
>
4
#include <
mim/plugin.h
>
5
6
/// @namespace mim::plug::buffer @ref buffer
7
namespace
mim
{
8
namespace
plug::buffer
{
9
10
static
constexpr
plugin_t
Plugin_Id
= 0xd61c71930000000;
11
12
/// @name `buffer.Buf`
13
///@{
14
enum class
Buf
:
flags_t
{
15
};
16
17
const
Def
*
normalize_Buf
(
const
Def
*,
const
Def
*,
const
Def
*);
18
///@}
19
20
/// @name `buffer.alloc`
21
///@{
22
enum class
alloc
:
flags_t
{
23
};
24
25
///@}
26
27
/// @name `buffer.read`
28
///@{
29
enum class
read
:
flags_t
{
30
};
31
32
const
Def
*
normalize_read
(
const
Def
*,
const
Def
*,
const
Def
*);
33
///@}
34
35
/// @name `buffer.write`
36
///@{
37
enum class
write
:
flags_t
{
38
};
39
40
const
Def
*
normalize_write
(
const
Def
*,
const
Def
*,
const
Def
*);
41
///@}
42
43
/// @name `buffer.init`
44
///@{
45
enum class
init
:
flags_t
{
46
};
47
48
///@}
49
50
/// @name `buffer.lit`
51
///@{
52
enum class
lit
:
flags_t
{
53
};
54
55
///@}
56
57
/// @name `buffer.shape`
58
///@{
59
enum class
shape
:
flags_t
{
60
};
61
62
const
Def
*
normalize_shape
(
const
Def
*,
const
Def
*,
const
Def
*);
63
///@}
64
65
/// @name `buffer.copy`
66
///@{
67
enum class
copy
:
flags_t
{
68
};
69
70
///@}
71
72
/// @name `buffer.free`
73
///@{
74
enum class
free
:
flags_t
{
75
};
76
77
///@}
78
79
/// @name `buffer.lower_ptr`
80
///@{
81
enum class
lower_ptr
:
flags_t
{
82
};
83
84
///@}
85
86
void
register_normalizers
(
Normalizers
& normalizers);
87
88
#define MIM_buffer_NORMALIZER_IMPL \
89
void register_normalizers(Normalizers& normalizers) {\
90
normalizers[flags_t(Annex::Base<Buf>)] = &normalize_Buf; \
91
normalizers[flags_t(Annex::Base<read>)] = &normalize_read; \
92
normalizers[flags_t(Annex::Base<write>)] = &normalize_write; \
93
normalizers[flags_t(Annex::Base<shape>)] = &normalize_shape; \
94
}
95
}
// namespace plug::buffer
96
97
#ifndef DOXYGEN
// don't include in Doxygen documentation
98
99
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::Buf>
= 0xd61c71930000000;
100
template
<>
constexpr
size_t
Annex::Num<plug::buffer::Buf>
= 0;
101
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::alloc>
= 0xd61c71930000100;
102
template
<>
constexpr
size_t
Annex::Num<plug::buffer::alloc>
= 0;
103
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::read>
= 0xd61c71930000200;
104
template
<>
constexpr
size_t
Annex::Num<plug::buffer::read>
= 0;
105
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::write>
= 0xd61c71930000300;
106
template
<>
constexpr
size_t
Annex::Num<plug::buffer::write>
= 0;
107
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::init>
= 0xd61c71930000400;
108
template
<>
constexpr
size_t
Annex::Num<plug::buffer::init>
= 0;
109
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::lit>
= 0xd61c71930000500;
110
template
<>
constexpr
size_t
Annex::Num<plug::buffer::lit>
= 0;
111
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::shape>
= 0xd61c71930000600;
112
template
<>
constexpr
size_t
Annex::Num<plug::buffer::shape>
= 0;
113
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::copy>
= 0xd61c71930000700;
114
template
<>
constexpr
size_t
Annex::Num<plug::buffer::copy>
= 0;
115
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::free>
= 0xd61c71930000800;
116
template
<>
constexpr
size_t
Annex::Num<plug::buffer::free>
= 0;
117
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::lower_ptr>
= 0xd61c71930000900;
118
template
<>
constexpr
size_t
Annex::Num<plug::buffer::lower_ptr>
= 0;
119
120
template
<>
struct
Axm::IsANode
<
plug
::buffer::lower_ptr> {
using
type
=
Axm
; };
121
122
#endif
123
}
// namespace mim
124
125
#ifndef DOXYGEN
// don't include in Doxygen documentation
126
127
128
#endif
axm.h
mim::Axm::IsANode::type
App type
Definition
axm.h:70
mim::Axm::IsANode
Definition
axm.h:69
mim::Def
Base class for all Defs.
Definition
def.h:289
mim::plug::buffer
The buffer Plugin
Definition
buffer.h:8
mim::plug::buffer::Buf
Buf
Definition
autogen.h:14
mim::plug::buffer::lit
lit
Definition
autogen.h:52
mim::plug::buffer::normalize_write
const Def * normalize_write(const Def *, const Def *, const Def *)
Definition
normalizers.cpp:42
mim::plug::buffer::lower_ptr
lower_ptr
Definition
autogen.h:81
mim::plug::buffer::copy
copy
Definition
autogen.h:67
mim::plug::buffer::Plugin_Id
static constexpr plugin_t Plugin_Id
Definition
autogen.h:10
mim::plug::buffer::write
write
Definition
autogen.h:37
mim::plug::buffer::init
init
Definition
autogen.h:45
mim::plug::buffer::normalize_read
const Def * normalize_read(const Def *type, const Def *, const Def *arg)
read (constant v) idx ↦ v.
Definition
normalizers.cpp:30
mim::plug::buffer::register_normalizers
void register_normalizers(Normalizers &normalizers)
mim::plug::buffer::alloc
alloc
Definition
autogen.h:22
mim::plug::buffer::shape
shape
Definition
autogen.h:59
mim::plug::buffer::read
read
Definition
autogen.h:29
mim::plug::buffer::normalize_shape
const Def * normalize_shape(const Def *type, const Def *callee, const Def *arg)
shape (r, s, T) (buf, i) ↦ s#i; the logical shape, since the type of buf has its size-1 axes folded a...
Definition
normalizers.cpp:45
mim::plug::buffer::free
free
Definition
autogen.h:74
mim::plug::buffer::normalize_Buf
const Def * normalize_Buf(const Def *, const Def *callee, const Def *arg)
Buf (r, s, T) with literal size-1 axes in s ↦ Buf (r', s', T) with those axes dropped.
Definition
normalizers.cpp:12
mim::plug
Definition
affine.h:10
mim
Definition
ast.h:16
mim::flags_t
u64 flags_t
Definition
types.h:39
mim::Normalizers
ankerl::unordered_dense::map< flags_t, NormalizeFn > Normalizers
Definition
plugin.h:27
mim::plugin_t
u64 plugin_t
Definition
types.h:40
mim::Node::Axm
@ Axm
Definition
def.h:125
plugin.h
mim::Annex::Num
static constexpr size_t Num
Number of Axm::subtags.
Definition
plugin.h:273
mim::Annex::Base
static constexpr flags_t Base
Definition
plugin.h:274
build
include
mim
plug
buffer
autogen.h
Generated by
1.18.0