MimIR
0.4-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.lower_ptr
73
///@{
74
enum class
lower_ptr
:
flags_t
{
75
};
76
77
///@}
78
79
void
register_normalizers
(
Normalizers
& normalizers);
80
81
#define MIM_buffer_NORMALIZER_IMPL \
82
void register_normalizers(Normalizers& normalizers) {\
83
normalizers[flags_t(Annex::Base<Buf>)] = &normalize_Buf; \
84
normalizers[flags_t(Annex::Base<read>)] = &normalize_read; \
85
normalizers[flags_t(Annex::Base<write>)] = &normalize_write; \
86
normalizers[flags_t(Annex::Base<shape>)] = &normalize_shape; \
87
}
88
}
// namespace plug::buffer
89
90
#ifndef DOXYGEN
// don't include in Doxygen documentation
91
92
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::Buf>
= 0xd61c71930000000;
93
template
<>
constexpr
size_t
Annex::Num<plug::buffer::Buf>
= 0;
94
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::alloc>
= 0xd61c71930000100;
95
template
<>
constexpr
size_t
Annex::Num<plug::buffer::alloc>
= 0;
96
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::read>
= 0xd61c71930000200;
97
template
<>
constexpr
size_t
Annex::Num<plug::buffer::read>
= 0;
98
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::write>
= 0xd61c71930000300;
99
template
<>
constexpr
size_t
Annex::Num<plug::buffer::write>
= 0;
100
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::init>
= 0xd61c71930000400;
101
template
<>
constexpr
size_t
Annex::Num<plug::buffer::init>
= 0;
102
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::lit>
= 0xd61c71930000500;
103
template
<>
constexpr
size_t
Annex::Num<plug::buffer::lit>
= 0;
104
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::shape>
= 0xd61c71930000600;
105
template
<>
constexpr
size_t
Annex::Num<plug::buffer::shape>
= 0;
106
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::copy>
= 0xd61c71930000700;
107
template
<>
constexpr
size_t
Annex::Num<plug::buffer::copy>
= 0;
108
template
<>
constexpr
flags_t
Annex::Base<plug::buffer::lower_ptr>
= 0xd61c71930000800;
109
template
<>
constexpr
size_t
Annex::Num<plug::buffer::lower_ptr>
= 0;
110
111
template
<>
struct
Axm::IsANode
<
plug
::buffer::lower_ptr> {
using
type
=
Axm
; };
112
113
#endif
114
}
// namespace mim
115
116
#ifndef DOXYGEN
// don't include in Doxygen documentation
117
118
119
#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:273
mim::plug::buffer
The buffer Plugin
Definition
buffer.h:7
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:41
mim::plug::buffer::normalize_shape
const Def * normalize_shape(const Def *type, const Def *, const Def *arg)
shape buf i ↦ the i-th size, read off the buffer's type.
Definition
normalizers.cpp:44
mim::plug::buffer::lower_ptr
lower_ptr
Definition
autogen.h:74
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_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
lower_for.h:5
mim
Definition
ast.h:16
mim::flags_t
u64 flags_t
Definition
types.h:39
mim::Normalizers
absl::flat_hash_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:122
plugin.h
mim::Annex::Num
static constexpr size_t Num
Number of Axm::subtags.
Definition
plugin.h:247
mim::Annex::Base
static constexpr flags_t Base
Definition
plugin.h:248
build
include
mim
plug
buffer
autogen.h
Generated by
1.18.0