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.shape
36///@{
37enum class shape : flags_t {
38};
39
40const Def* normalize_shape(const Def*, const Def*, const Def*);
41///@}
42
43/// @name %%tensor.map_reduce
44///@{
45enum class map_reduce : flags_t {
46};
47
48const Def* normalize_map_reduce(const Def*, const Def*, const Def*);
49///@}
50
51/// @name %%tensor.proj_map
52///@{
53enum class proj_map : flags_t {
54};
55
56///@}
57
58/// @name %%tensor.repeat
59///@{
60enum class repeat : flags_t {
61};
62
63const Def* normalize_repeat(const Def*, const Def*, const Def*);
64///@}
65
66/// @name %%tensor.repeat_impl
67///@{
68enum class repeat_impl : flags_t {
69};
70
71///@}
72
73/// @name %%tensor.reshape
74///@{
75enum class reshape : flags_t {
76};
77
78const Def* normalize_reshape(const Def*, const Def*, const Def*);
79///@}
80
81/// @name %%tensor.reshape_impl
82///@{
83enum class reshape_impl : flags_t {
84};
85
86///@}
87
88/// @name %%tensor.slice
89///@{
90enum class slice : flags_t {
91};
92
93const Def* normalize_slice(const Def*, const Def*, const Def*);
94///@}
95
96/// @name %%tensor.slice_impl
97///@{
98enum class slice_impl : flags_t {
99};
100
101///@}
102
103/// @name %%tensor.flip
104///@{
105enum class flip : flags_t {
106};
107
108const Def* normalize_flip(const Def*, const Def*, const Def*);
109///@}
110
111/// @name %%tensor.flip_impl
112///@{
113enum class flip_impl : flags_t {
114};
115
116///@}
117
118/// @name %%tensor.pad
119///@{
120enum class pad : flags_t {
121};
122
123const Def* normalize_pad(const Def*, const Def*, const Def*);
124///@}
125
126/// @name %%tensor.concat
127///@{
128enum class concat : flags_t {
129};
130
131const Def* normalize_concat(const Def*, const Def*, const Def*);
132///@}
133
134/// @name %%tensor.conv
135///@{
136enum class conv : flags_t {
137};
138
139///@}
140
141/// @name %%tensor.conv_impl
142///@{
143enum class conv_impl : flags_t {
144};
145
146///@}
147
148/// @name %%tensor.pool
149///@{
150enum class pool : flags_t {
151};
152
153///@}
154
155/// @name %%tensor.pool_impl
156///@{
157enum class pool_impl : flags_t {
158};
159
160///@}
161
162/// @name %%tensor.dot_product
163///@{
164enum class dot_product : flags_t {
165};
166
167///@}
168
169/// @name %%tensor.dot_product_impl
170///@{
172};
173
174///@}
175
176/// @name %%tensor.product_2d
177///@{
178enum class product_2d : flags_t {
179};
180
181///@}
182
183/// @name %%tensor.product_2d_impl
184///@{
186};
187
188///@}
189
190/// @name %%tensor.bmm
191///@{
192enum class bmm : flags_t {
193};
194
195///@}
196
197/// @name %%tensor.bmm_impl
198///@{
199enum class bmm_impl : flags_t {
200};
201
202///@}
203
204/// @name %%tensor.transpose
205///@{
206enum class transpose : flags_t {
207};
208
209///@}
210
211/// @name %%tensor.transpose_impl
212///@{
214};
215
216///@}
217
218/// @name %%tensor.transpose_2d
219///@{
220enum class transpose_2d : flags_t {
221};
222
223///@}
224
225/// @name %%tensor.transpose_2d_impl
226///@{
228};
229
230///@}
231
232/// @name %%tensor.broadcast
233///@{
234enum class broadcast : flags_t {
235};
236
237const Def* normalize_broadcast(const Def*, const Def*, const Def*);
238///@}
239
240/// @name %%tensor.broadcast_in_dim
241///@{
243};
244
245const Def* normalize_broadcast_in_dim(const Def*, const Def*, const Def*);
246///@}
247
248/// @name %%tensor.broadcast_in_dim_impl
249///@{
251};
252
253///@}
254
255/// @name %%tensor.map
256///@{
257enum class map : flags_t {
258};
259
260///@}
261
262/// @name %%tensor.map_impl
263///@{
264enum class map_impl : flags_t {
265};
266
267///@}
268
269/// @name %%tensor.unary
270///@{
271enum class unary : flags_t {
272};
273
274///@}
275
276/// @name %%tensor.unary_impl
277///@{
278enum class unary_impl : flags_t {
279};
280
281///@}
282
283/// @name %%tensor.binary
284///@{
285enum class binary : flags_t {
286};
287
288///@}
289
290/// @name %%tensor.binary_impl
291///@{
292enum class binary_impl : flags_t {
293};
294
295///@}
296
297/// @name %%tensor.select
298///@{
299enum class select : flags_t {
300};
301
302///@}
303
304/// @name %%tensor.select_impl
305///@{
306enum class select_impl : flags_t {
307};
308
309///@}
310
311/// @name %%tensor.lower_tensor
312///@{
313enum class lower_tensor : flags_t {
314};
315
316///@}
317
318/// @name %%tensor.lower_map_reduce
319///@{
321};
322
323///@}
324
325/// @name %%tensor.lower_get_set
326///@{
327enum class lower_get_set : flags_t {
328};
329
330///@}
331
332/// @name %%tensor.fuse_tensor
333///@{
334enum class fuse_tensor : flags_t {
335};
336
337///@}
338
339/// @name %%tensor.lower_to_mem
340///@{
341enum class lower_to_mem : flags_t {
342};
343
344///@}
345
347
348#define MIM_tensor_NORMALIZER_IMPL \
349 void register_normalizers(Normalizers& normalizers) {\
350 normalizers[flags_t(Annex::Base<get>)] = &normalize_get; \
351 normalizers[flags_t(Annex::Base<set>)] = &normalize_set; \
352 normalizers[flags_t(Annex::Base<shape>)] = &normalize_shape; \
353 normalizers[flags_t(Annex::Base<map_reduce>)] = &normalize_map_reduce; \
354 normalizers[flags_t(Annex::Base<repeat>)] = &normalize_repeat; \
355 normalizers[flags_t(Annex::Base<reshape>)] = &normalize_reshape; \
356 normalizers[flags_t(Annex::Base<slice>)] = &normalize_slice; \
357 normalizers[flags_t(Annex::Base<flip>)] = &normalize_flip; \
358 normalizers[flags_t(Annex::Base<pad>)] = &normalize_pad; \
359 normalizers[flags_t(Annex::Base<concat>)] = &normalize_concat; \
360 normalizers[flags_t(Annex::Base<broadcast>)] = &normalize_broadcast; \
361 normalizers[flags_t(Annex::Base<broadcast_in_dim>)] = &normalize_broadcast_in_dim; \
362 }
363} // namespace plug::tensor
364
365#ifndef DOXYGEN // don't include in Doxygen documentation
366
367template<> constexpr flags_t Annex::Base<plug::tensor::Ring> = 0x5463d44130000000;
368template<> constexpr size_t Annex::Num<plug::tensor::Ring> = 0;
369template<> constexpr flags_t Annex::Base<plug::tensor::get> = 0x5463d44130000100;
370template<> constexpr size_t Annex::Num<plug::tensor::get> = 0;
371template<> constexpr flags_t Annex::Base<plug::tensor::set> = 0x5463d44130000200;
372template<> constexpr size_t Annex::Num<plug::tensor::set> = 0;
373template<> constexpr flags_t Annex::Base<plug::tensor::shape> = 0x5463d44130000300;
374template<> constexpr size_t Annex::Num<plug::tensor::shape> = 0;
375template<> constexpr flags_t Annex::Base<plug::tensor::map_reduce> = 0x5463d44130000400;
376template<> constexpr size_t Annex::Num<plug::tensor::map_reduce> = 0;
377template<> constexpr flags_t Annex::Base<plug::tensor::proj_map> = 0x5463d44130000500;
378template<> constexpr size_t Annex::Num<plug::tensor::proj_map> = 0;
379template<> constexpr flags_t Annex::Base<plug::tensor::repeat> = 0x5463d44130000600;
380template<> constexpr size_t Annex::Num<plug::tensor::repeat> = 0;
381template<> constexpr flags_t Annex::Base<plug::tensor::repeat_impl> = 0x5463d44130000700;
382template<> constexpr size_t Annex::Num<plug::tensor::repeat_impl> = 0;
383template<> constexpr flags_t Annex::Base<plug::tensor::reshape> = 0x5463d44130000800;
384template<> constexpr size_t Annex::Num<plug::tensor::reshape> = 0;
385template<> constexpr flags_t Annex::Base<plug::tensor::reshape_impl> = 0x5463d44130000900;
386template<> constexpr size_t Annex::Num<plug::tensor::reshape_impl> = 0;
387template<> constexpr flags_t Annex::Base<plug::tensor::slice> = 0x5463d44130000a00;
388template<> constexpr size_t Annex::Num<plug::tensor::slice> = 0;
389template<> constexpr flags_t Annex::Base<plug::tensor::slice_impl> = 0x5463d44130000b00;
390template<> constexpr size_t Annex::Num<plug::tensor::slice_impl> = 0;
391template<> constexpr flags_t Annex::Base<plug::tensor::flip> = 0x5463d44130000c00;
392template<> constexpr size_t Annex::Num<plug::tensor::flip> = 0;
393template<> constexpr flags_t Annex::Base<plug::tensor::flip_impl> = 0x5463d44130000d00;
394template<> constexpr size_t Annex::Num<plug::tensor::flip_impl> = 0;
395template<> constexpr flags_t Annex::Base<plug::tensor::pad> = 0x5463d44130000e00;
396template<> constexpr size_t Annex::Num<plug::tensor::pad> = 0;
397template<> constexpr flags_t Annex::Base<plug::tensor::concat> = 0x5463d44130000f00;
398template<> constexpr size_t Annex::Num<plug::tensor::concat> = 0;
399template<> constexpr flags_t Annex::Base<plug::tensor::conv> = 0x5463d44130001000;
400template<> constexpr size_t Annex::Num<plug::tensor::conv> = 0;
401template<> constexpr flags_t Annex::Base<plug::tensor::conv_impl> = 0x5463d44130001100;
402template<> constexpr size_t Annex::Num<plug::tensor::conv_impl> = 0;
403template<> constexpr flags_t Annex::Base<plug::tensor::pool> = 0x5463d44130001200;
404template<> constexpr size_t Annex::Num<plug::tensor::pool> = 0;
405template<> constexpr flags_t Annex::Base<plug::tensor::pool_impl> = 0x5463d44130001300;
406template<> constexpr size_t Annex::Num<plug::tensor::pool_impl> = 0;
407template<> constexpr flags_t Annex::Base<plug::tensor::dot_product> = 0x5463d44130001400;
408template<> constexpr size_t Annex::Num<plug::tensor::dot_product> = 0;
409template<> constexpr flags_t Annex::Base<plug::tensor::dot_product_impl> = 0x5463d44130001500;
410template<> constexpr size_t Annex::Num<plug::tensor::dot_product_impl> = 0;
411template<> constexpr flags_t Annex::Base<plug::tensor::product_2d> = 0x5463d44130001600;
412template<> constexpr size_t Annex::Num<plug::tensor::product_2d> = 0;
413template<> constexpr flags_t Annex::Base<plug::tensor::product_2d_impl> = 0x5463d44130001700;
414template<> constexpr size_t Annex::Num<plug::tensor::product_2d_impl> = 0;
415template<> constexpr flags_t Annex::Base<plug::tensor::bmm> = 0x5463d44130001800;
416template<> constexpr size_t Annex::Num<plug::tensor::bmm> = 0;
417template<> constexpr flags_t Annex::Base<plug::tensor::bmm_impl> = 0x5463d44130001900;
418template<> constexpr size_t Annex::Num<plug::tensor::bmm_impl> = 0;
419template<> constexpr flags_t Annex::Base<plug::tensor::transpose> = 0x5463d44130001a00;
420template<> constexpr size_t Annex::Num<plug::tensor::transpose> = 0;
421template<> constexpr flags_t Annex::Base<plug::tensor::transpose_impl> = 0x5463d44130001b00;
422template<> constexpr size_t Annex::Num<plug::tensor::transpose_impl> = 0;
423template<> constexpr flags_t Annex::Base<plug::tensor::transpose_2d> = 0x5463d44130001c00;
424template<> constexpr size_t Annex::Num<plug::tensor::transpose_2d> = 0;
425template<> constexpr flags_t Annex::Base<plug::tensor::transpose_2d_impl> = 0x5463d44130001d00;
426template<> constexpr size_t Annex::Num<plug::tensor::transpose_2d_impl> = 0;
427template<> constexpr flags_t Annex::Base<plug::tensor::broadcast> = 0x5463d44130001e00;
428template<> constexpr size_t Annex::Num<plug::tensor::broadcast> = 0;
429template<> constexpr flags_t Annex::Base<plug::tensor::broadcast_in_dim> = 0x5463d44130001f00;
430template<> constexpr size_t Annex::Num<plug::tensor::broadcast_in_dim> = 0;
431template<> constexpr flags_t Annex::Base<plug::tensor::broadcast_in_dim_impl> = 0x5463d44130002000;
432template<> constexpr size_t Annex::Num<plug::tensor::broadcast_in_dim_impl> = 0;
433template<> constexpr flags_t Annex::Base<plug::tensor::map> = 0x5463d44130002100;
434template<> constexpr size_t Annex::Num<plug::tensor::map> = 0;
435template<> constexpr flags_t Annex::Base<plug::tensor::map_impl> = 0x5463d44130002200;
436template<> constexpr size_t Annex::Num<plug::tensor::map_impl> = 0;
437template<> constexpr flags_t Annex::Base<plug::tensor::unary> = 0x5463d44130002300;
438template<> constexpr size_t Annex::Num<plug::tensor::unary> = 0;
439template<> constexpr flags_t Annex::Base<plug::tensor::unary_impl> = 0x5463d44130002400;
440template<> constexpr size_t Annex::Num<plug::tensor::unary_impl> = 0;
441template<> constexpr flags_t Annex::Base<plug::tensor::binary> = 0x5463d44130002500;
442template<> constexpr size_t Annex::Num<plug::tensor::binary> = 0;
443template<> constexpr flags_t Annex::Base<plug::tensor::binary_impl> = 0x5463d44130002600;
444template<> constexpr size_t Annex::Num<plug::tensor::binary_impl> = 0;
445template<> constexpr flags_t Annex::Base<plug::tensor::select> = 0x5463d44130002700;
446template<> constexpr size_t Annex::Num<plug::tensor::select> = 0;
447template<> constexpr flags_t Annex::Base<plug::tensor::select_impl> = 0x5463d44130002800;
448template<> constexpr size_t Annex::Num<plug::tensor::select_impl> = 0;
449template<> constexpr flags_t Annex::Base<plug::tensor::lower_tensor> = 0x5463d44130002900;
450template<> constexpr size_t Annex::Num<plug::tensor::lower_tensor> = 0;
451template<> constexpr flags_t Annex::Base<plug::tensor::lower_map_reduce> = 0x5463d44130002a00;
452template<> constexpr size_t Annex::Num<plug::tensor::lower_map_reduce> = 0;
453template<> constexpr flags_t Annex::Base<plug::tensor::lower_get_set> = 0x5463d44130002b00;
454template<> constexpr size_t Annex::Num<plug::tensor::lower_get_set> = 0;
455template<> constexpr flags_t Annex::Base<plug::tensor::fuse_tensor> = 0x5463d44130002c00;
456template<> constexpr size_t Annex::Num<plug::tensor::fuse_tensor> = 0;
457template<> constexpr flags_t Annex::Base<plug::tensor::lower_to_mem> = 0x5463d44130002d00;
458template<> constexpr size_t Annex::Num<plug::tensor::lower_to_mem> = 0;
459
460template<> struct Axm::IsANode<plug::tensor::Ring> { using type = Axm; };
461template<> struct Axm::IsANode<plug::tensor::proj_map> { using type = Axm; };
462template<> struct Axm::IsANode<plug::tensor::repeat_impl> { using type = Axm; };
463template<> struct Axm::IsANode<plug::tensor::reshape_impl> { using type = Axm; };
464template<> struct Axm::IsANode<plug::tensor::slice_impl> { using type = Axm; };
465template<> struct Axm::IsANode<plug::tensor::flip_impl> { using type = Axm; };
466template<> struct Axm::IsANode<plug::tensor::conv_impl> { using type = Axm; };
467template<> struct Axm::IsANode<plug::tensor::pool_impl> { using type = Axm; };
468template<> struct Axm::IsANode<plug::tensor::dot_product_impl> { using type = Axm; };
469template<> struct Axm::IsANode<plug::tensor::product_2d_impl> { using type = Axm; };
470template<> struct Axm::IsANode<plug::tensor::bmm_impl> { using type = Axm; };
471template<> struct Axm::IsANode<plug::tensor::transpose_impl> { using type = Axm; };
472template<> struct Axm::IsANode<plug::tensor::transpose_2d_impl> { using type = Axm; };
473template<> struct Axm::IsANode<plug::tensor::broadcast_in_dim_impl> { using type = Axm; };
474template<> struct Axm::IsANode<plug::tensor::map_impl> { using type = Axm; };
475template<> struct Axm::IsANode<plug::tensor::unary_impl> { using type = Axm; };
476template<> struct Axm::IsANode<plug::tensor::binary_impl> { using type = Axm; };
477template<> struct Axm::IsANode<plug::tensor::select_impl> { using type = Axm; };
478template<> struct Axm::IsANode<plug::tensor::lower_tensor> { using type = Axm; };
479template<> struct Axm::IsANode<plug::tensor::lower_map_reduce> { using type = Axm; };
480template<> struct Axm::IsANode<plug::tensor::lower_get_set> { using type = Axm; };
481template<> struct Axm::IsANode<plug::tensor::fuse_tensor> { using type = Axm; };
482template<> struct Axm::IsANode<plug::tensor::lower_to_mem> { using type = Axm; };
483
484#endif
485} // namespace mim
486
487#ifndef DOXYGEN // don't include in Doxygen documentation
488
489
490#endif
Base class for all Defs.
Definition def.h:261
The tensor Plugin
Definition fuse.h:5
const Def * normalize_broadcast(const Def *, const Def *c, const Def *arg)
const Def * normalize_slice(const Def *, const Def *c, const Def *arg)
const Def * normalize_repeat(const Def *, const Def *c, const Def *arg)
const Def * normalize_pad(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)
const Def * normalize_concat(const Def *, const Def *, const Def *)
const Def * normalize_reshape(const Def *, const Def *c, const Def *arg)
const Def * normalize_shape(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_flip(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