MimIR
MimIR is my Intermediate Representation
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::tensor @ref tensor
7namespace mim {
8namespace plug::tensor {
9
10static constexpr plugin_t Plugin_Id = 0x5463d44130000000;
11
12/// @name %%tensor.Ring
13///@{
14enum class Ring : flags_t {
15};
16
17///@}
18
19/// @name %%tensor.get
20///@{
21enum class get : flags_t {
22};
23
24const Def* normalize_get(const Def*, const Def*, const Def*);
25///@}
26
27/// @name %%tensor.set
28///@{
29enum class set : flags_t {
30};
31
32const Def* normalize_set(const Def*, const Def*, const Def*);
33///@}
34
35/// @name %%tensor.map_reduce
36///@{
37enum class map_reduce : flags_t {
38};
39
40const Def* normalize_map_reduce(const Def*, const Def*, const Def*);
41///@}
42
43/// @name %%tensor.map_reduce_ds
44///@{
45enum class map_reduce_ds : flags_t {
46};
47
48///@}
49
50/// @name %%tensor.map_reduce_ds_impl
51///@{
53};
54
55///@}
56
57/// @name %%tensor.map_reduce_aff
58///@{
59enum class map_reduce_aff : flags_t {
60};
61
62const Def* normalize_map_reduce_aff(const Def*, const Def*, const Def*);
63///@}
64
65/// @name %%tensor.dot_product
66///@{
67enum class dot_product : flags_t {
68};
69
70///@}
71
72/// @name %%tensor.dot_product_impl
73///@{
75};
76
77///@}
78
79/// @name %%tensor.product_2d
80///@{
81enum class product_2d : flags_t {
82};
83
84///@}
85
86/// @name %%tensor.product_2d_impl
87///@{
89};
90
91///@}
92
93/// @name %%tensor.transpose
94///@{
95enum class transpose : flags_t {
96};
97
98///@}
99
100/// @name %%tensor.transpose_impl
101///@{
103};
104
105///@}
106
107/// @name %%tensor.transpose_2d
108///@{
109enum class transpose_2d : flags_t {
110};
111
112///@}
113
114/// @name %%tensor.transpose_2d_impl
115///@{
117};
118
119///@}
120
121/// @name %%tensor.broadcast
122///@{
123enum class broadcast : flags_t {
124};
125
126const Def* normalize_broadcast(const Def*, const Def*, const Def*);
127///@}
128
129/// @name %%tensor.broadcast_in_dim
130///@{
132};
133
134const Def* normalize_broadcast_in_dim(const Def*, const Def*, const Def*);
135///@}
136
137/// @name %%tensor.map
138///@{
139enum class map : flags_t {
140};
141
142///@}
143
144/// @name %%tensor.map_impl
145///@{
146enum class map_impl : flags_t {
147};
148
149///@}
150
151/// @name %%tensor.unary
152///@{
153enum class unary : flags_t {
154};
155
156///@}
157
158/// @name %%tensor.unary_impl
159///@{
160enum class unary_impl : flags_t {
161};
162
163///@}
164
165/// @name %%tensor.binary
166///@{
167enum class binary : flags_t {
168};
169
170///@}
171
172/// @name %%tensor.binary_impl
173///@{
174enum class binary_impl : flags_t {
175};
176
177///@}
178
179/// @name %%tensor.select
180///@{
181enum class select : flags_t {
182};
183
184///@}
185
186/// @name %%tensor.select_impl
187///@{
188enum class select_impl : flags_t {
189};
190
191///@}
192
193/// @name %%tensor.lower_tensor
194///@{
195enum class lower_tensor : flags_t {
196};
197
198///@}
199
200/// @name %%tensor.lower_map_reduce
201///@{
203};
204
205///@}
206
207/// @name %%tensor.fuse_tensor
208///@{
209enum class fuse_tensor : flags_t {
210};
211
212///@}
213
215
216#define MIM_tensor_NORMALIZER_IMPL \
217 void register_normalizers(Normalizers& normalizers) {\
218 normalizers[flags_t(Annex::Base<get>)] = &normalize_get; \
219 normalizers[flags_t(Annex::Base<set>)] = &normalize_set; \
220 normalizers[flags_t(Annex::Base<map_reduce>)] = &normalize_map_reduce; \
221 normalizers[flags_t(Annex::Base<map_reduce_aff>)] = &normalize_map_reduce_aff; \
222 normalizers[flags_t(Annex::Base<broadcast>)] = &normalize_broadcast; \
223 normalizers[flags_t(Annex::Base<broadcast_in_dim>)] = &normalize_broadcast_in_dim; \
224 }
225} // namespace plug::tensor
226
227#ifndef DOXYGEN // don't include in Doxygen documentation
228
229template<> constexpr flags_t Annex::Base<plug::tensor::Ring> = 0x5463d44130000000;
230template<> constexpr size_t Annex::Num<plug::tensor::Ring> = 0;
231template<> constexpr flags_t Annex::Base<plug::tensor::get> = 0x5463d44130000100;
232template<> constexpr size_t Annex::Num<plug::tensor::get> = 0;
233template<> constexpr flags_t Annex::Base<plug::tensor::set> = 0x5463d44130000200;
234template<> constexpr size_t Annex::Num<plug::tensor::set> = 0;
235template<> constexpr flags_t Annex::Base<plug::tensor::map_reduce> = 0x5463d44130000300;
236template<> constexpr size_t Annex::Num<plug::tensor::map_reduce> = 0;
237template<> constexpr flags_t Annex::Base<plug::tensor::map_reduce_ds> = 0x5463d44130000400;
238template<> constexpr size_t Annex::Num<plug::tensor::map_reduce_ds> = 0;
239template<> constexpr flags_t Annex::Base<plug::tensor::map_reduce_ds_impl> = 0x5463d44130000500;
240template<> constexpr size_t Annex::Num<plug::tensor::map_reduce_ds_impl> = 0;
241template<> constexpr flags_t Annex::Base<plug::tensor::map_reduce_aff> = 0x5463d44130000600;
242template<> constexpr size_t Annex::Num<plug::tensor::map_reduce_aff> = 0;
243template<> constexpr flags_t Annex::Base<plug::tensor::dot_product> = 0x5463d44130000700;
244template<> constexpr size_t Annex::Num<plug::tensor::dot_product> = 0;
245template<> constexpr flags_t Annex::Base<plug::tensor::dot_product_impl> = 0x5463d44130000800;
246template<> constexpr size_t Annex::Num<plug::tensor::dot_product_impl> = 0;
247template<> constexpr flags_t Annex::Base<plug::tensor::product_2d> = 0x5463d44130000900;
248template<> constexpr size_t Annex::Num<plug::tensor::product_2d> = 0;
249template<> constexpr flags_t Annex::Base<plug::tensor::product_2d_impl> = 0x5463d44130000a00;
250template<> constexpr size_t Annex::Num<plug::tensor::product_2d_impl> = 0;
251template<> constexpr flags_t Annex::Base<plug::tensor::transpose> = 0x5463d44130000b00;
252template<> constexpr size_t Annex::Num<plug::tensor::transpose> = 0;
253template<> constexpr flags_t Annex::Base<plug::tensor::transpose_impl> = 0x5463d44130000c00;
254template<> constexpr size_t Annex::Num<plug::tensor::transpose_impl> = 0;
255template<> constexpr flags_t Annex::Base<plug::tensor::transpose_2d> = 0x5463d44130000d00;
256template<> constexpr size_t Annex::Num<plug::tensor::transpose_2d> = 0;
257template<> constexpr flags_t Annex::Base<plug::tensor::transpose_2d_impl> = 0x5463d44130000e00;
258template<> constexpr size_t Annex::Num<plug::tensor::transpose_2d_impl> = 0;
259template<> constexpr flags_t Annex::Base<plug::tensor::broadcast> = 0x5463d44130000f00;
260template<> constexpr size_t Annex::Num<plug::tensor::broadcast> = 0;
261template<> constexpr flags_t Annex::Base<plug::tensor::broadcast_in_dim> = 0x5463d44130001000;
262template<> constexpr size_t Annex::Num<plug::tensor::broadcast_in_dim> = 0;
263template<> constexpr flags_t Annex::Base<plug::tensor::map> = 0x5463d44130001100;
264template<> constexpr size_t Annex::Num<plug::tensor::map> = 0;
265template<> constexpr flags_t Annex::Base<plug::tensor::map_impl> = 0x5463d44130001200;
266template<> constexpr size_t Annex::Num<plug::tensor::map_impl> = 0;
267template<> constexpr flags_t Annex::Base<plug::tensor::unary> = 0x5463d44130001300;
268template<> constexpr size_t Annex::Num<plug::tensor::unary> = 0;
269template<> constexpr flags_t Annex::Base<plug::tensor::unary_impl> = 0x5463d44130001400;
270template<> constexpr size_t Annex::Num<plug::tensor::unary_impl> = 0;
271template<> constexpr flags_t Annex::Base<plug::tensor::binary> = 0x5463d44130001500;
272template<> constexpr size_t Annex::Num<plug::tensor::binary> = 0;
273template<> constexpr flags_t Annex::Base<plug::tensor::binary_impl> = 0x5463d44130001600;
274template<> constexpr size_t Annex::Num<plug::tensor::binary_impl> = 0;
275template<> constexpr flags_t Annex::Base<plug::tensor::select> = 0x5463d44130001700;
276template<> constexpr size_t Annex::Num<plug::tensor::select> = 0;
277template<> constexpr flags_t Annex::Base<plug::tensor::select_impl> = 0x5463d44130001800;
278template<> constexpr size_t Annex::Num<plug::tensor::select_impl> = 0;
279template<> constexpr flags_t Annex::Base<plug::tensor::lower_tensor> = 0x5463d44130001900;
280template<> constexpr size_t Annex::Num<plug::tensor::lower_tensor> = 0;
281template<> constexpr flags_t Annex::Base<plug::tensor::lower_map_reduce> = 0x5463d44130001a00;
282template<> constexpr size_t Annex::Num<plug::tensor::lower_map_reduce> = 0;
283template<> constexpr flags_t Annex::Base<plug::tensor::fuse_tensor> = 0x5463d44130001b00;
284template<> constexpr size_t Annex::Num<plug::tensor::fuse_tensor> = 0;
285
286template<> struct Axm::IsANode<plug::tensor::Ring> { using type = Axm; };
287template<> struct Axm::IsANode<plug::tensor::map_reduce_ds_impl> { using type = Axm; };
288template<> struct Axm::IsANode<plug::tensor::dot_product_impl> { using type = Axm; };
289template<> struct Axm::IsANode<plug::tensor::product_2d_impl> { using type = Axm; };
290template<> struct Axm::IsANode<plug::tensor::transpose_impl> { using type = Axm; };
291template<> struct Axm::IsANode<plug::tensor::transpose_2d_impl> { using type = Axm; };
292template<> struct Axm::IsANode<plug::tensor::map_impl> { using type = Axm; };
293template<> struct Axm::IsANode<plug::tensor::unary_impl> { using type = Axm; };
294template<> struct Axm::IsANode<plug::tensor::binary_impl> { using type = Axm; };
295template<> struct Axm::IsANode<plug::tensor::select_impl> { using type = Axm; };
296template<> struct Axm::IsANode<plug::tensor::lower_tensor> { using type = Axm; };
297template<> struct Axm::IsANode<plug::tensor::lower_map_reduce> { using type = Axm; };
298template<> struct Axm::IsANode<plug::tensor::fuse_tensor> { using type = Axm; };
299
300#endif
301} // namespace mim
302
303#ifndef DOXYGEN // don't include in Doxygen documentation
304
305
306#endif
Base class for all Defs.
Definition def.h:246
The tensor Plugin
Definition fuse.h:5
const Def * normalize_broadcast(const Def *, const Def *c, const Def *arg)
const Def * normalize_get(const Def *, const Def *c, const Def *arg)
const Def * normalize_broadcast_in_dim(const Def *, const Def *, const Def *)
const Def * normalize_set(const Def *, const Def *c, const Def *arg)
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
void register_normalizers(Normalizers &normalizers)
const Def * normalize_map_reduce(const Def *, const Def *, const Def *)
const Def * normalize_map_reduce_aff(const Def *, const Def *, const Def *)
Definition ast.h:14
u64 flags_t
Definition types.h:39
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:22
u64 plugin_t
Definition types.h:40
@ Axm
Definition def.h:109
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:147
static constexpr flags_t Base
Definition plugin.h:148