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::matrix @ref matrix
7namespace mim {
8namespace plug::matrix {
9
10static constexpr plugin_t Plugin_Id = 0x3825532990000000;
11
12/// @name %%matrix.prod
13///@{
14enum class prod : flags_t {
15};
16
17const Def* normalize_prod(const Def*, const Def*, const Def*);
18///@}
19
20/// @name %%matrix.transpose
21///@{
22enum class transpose : flags_t {
23};
24
25const Def* normalize_transpose(const Def*, const Def*, const Def*);
26///@}
27
28/// @name %%matrix.sum
29///@{
30enum class sum : flags_t {
31};
32
33///@}
34
35/// @name %%matrix.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 %%matrix.map_reduce_aff
44///@{
45enum class map_reduce_aff : flags_t {
46};
47
48///@}
49
50/// @name %%matrix.broadcast
51///@{
52enum class broadcast : flags_t {
53};
54
55///@}
56
57/// @name %%matrix.pad
58///@{
59enum class pad : flags_t {
60};
61
62///@}
63
64/// @name %%matrix.concat
65///@{
66enum class concat : flags_t {
67};
68
69///@}
70
71/// @name %%matrix.map_reduce_prod
72///@{
74};
75
76///@}
77
78/// @name %%matrix.map_reduce_transpose
79///@{
81};
82
83///@}
84
85/// @name %%matrix.map_reduce_sum
86///@{
87enum class map_reduce_sum : flags_t {
88};
89
90///@}
91
92/// @name %%matrix.lower_matrix_high_level_map_reduce
93///@{
96
97///@}
98
99/// @name %%matrix.lower_matrix_medium_level
100///@{
103
104///@}
105
106/// @name %%matrix.lower_aff
107///@{
108enum class lower_aff : flags_t {
109};
110
111///@}
112
114
115#define MIM_matrix_NORMALIZER_IMPL \
116 void register_normalizers(Normalizers& normalizers) {\
117 normalizers[flags_t(Annex::Base<prod>)] = &normalize_prod; \
118 normalizers[flags_t(Annex::Base<transpose>)] = &normalize_transpose; \
119 normalizers[flags_t(Annex::Base<map_reduce>)] = &normalize_map_reduce; \
120 }
121} // namespace plug::matrix
122
123#ifndef DOXYGEN // don't include in Doxygen documentation
124
125template<> constexpr flags_t Annex::Base<plug::matrix::prod> = 0x3825532990000000;
126template<> constexpr size_t Annex::Num<plug::matrix::prod> = 0;
127template<> constexpr flags_t Annex::Base<plug::matrix::transpose> = 0x3825532990000100;
128template<> constexpr size_t Annex::Num<plug::matrix::transpose> = 0;
129template<> constexpr flags_t Annex::Base<plug::matrix::sum> = 0x3825532990000200;
130template<> constexpr size_t Annex::Num<plug::matrix::sum> = 0;
131template<> constexpr flags_t Annex::Base<plug::matrix::map_reduce> = 0x3825532990000300;
132template<> constexpr size_t Annex::Num<plug::matrix::map_reduce> = 0;
133template<> constexpr flags_t Annex::Base<plug::matrix::map_reduce_aff> = 0x3825532990000400;
134template<> constexpr size_t Annex::Num<plug::matrix::map_reduce_aff> = 0;
135template<> constexpr flags_t Annex::Base<plug::matrix::broadcast> = 0x3825532990000500;
136template<> constexpr size_t Annex::Num<plug::matrix::broadcast> = 0;
137template<> constexpr flags_t Annex::Base<plug::matrix::pad> = 0x3825532990000600;
138template<> constexpr size_t Annex::Num<plug::matrix::pad> = 0;
139template<> constexpr flags_t Annex::Base<plug::matrix::concat> = 0x3825532990000700;
140template<> constexpr size_t Annex::Num<plug::matrix::concat> = 0;
141template<> constexpr flags_t Annex::Base<plug::matrix::map_reduce_prod> = 0x3825532990000800;
142template<> constexpr size_t Annex::Num<plug::matrix::map_reduce_prod> = 0;
143template<> constexpr flags_t Annex::Base<plug::matrix::map_reduce_transpose> = 0x3825532990000900;
144template<> constexpr size_t Annex::Num<plug::matrix::map_reduce_transpose> = 0;
145template<> constexpr flags_t Annex::Base<plug::matrix::map_reduce_sum> = 0x3825532990000a00;
146template<> constexpr size_t Annex::Num<plug::matrix::map_reduce_sum> = 0;
147template<> constexpr flags_t Annex::Base<plug::matrix::lower_matrix_high_level_map_reduce> = 0x3825532990000b00;
149template<> constexpr flags_t Annex::Base<plug::matrix::lower_matrix_medium_level> = 0x3825532990000c00;
150template<> constexpr size_t Annex::Num<plug::matrix::lower_matrix_medium_level> = 0;
151template<> constexpr flags_t Annex::Base<plug::matrix::lower_aff> = 0x3825532990000d00;
152template<> constexpr size_t Annex::Num<plug::matrix::lower_aff> = 0;
153
154template<> struct Axm::IsANode<plug::matrix::map_reduce_prod> { using type = Axm; };
155template<> struct Axm::IsANode<plug::matrix::map_reduce_transpose> { using type = Axm; };
156template<> struct Axm::IsANode<plug::matrix::map_reduce_sum> { using type = Axm; };
157template<> struct Axm::IsANode<plug::matrix::lower_matrix_high_level_map_reduce> { using type = Axm; };
158template<> struct Axm::IsANode<plug::matrix::lower_matrix_medium_level> { using type = Axm; };
159template<> struct Axm::IsANode<plug::matrix::lower_aff> { using type = Axm; };
160
161#endif
162} // namespace mim
163
164#ifndef DOXYGEN // don't include in Doxygen documentation
165
166
167#endif
Base class for all Defs.
Definition def.h:261
The matrix Plugin
Definition matrix.h:8
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
const Def * normalize_map_reduce(const Def *, const Def *, const Def *)
lower_matrix_high_level_map_reduce
Definition autogen.h:94
void register_normalizers(Normalizers &normalizers)
const Def * normalize_prod(const Def *, const Def *, const Def *)
const Def * normalize_transpose(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