MimIR 0.1
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.Mat
13///@{
14enum class Mat : flags_t {
15};
16
17///@}
18
19/// @name %%matrix.shape
20///@{
21enum class shape : flags_t {
22};
23
24const Def* normalize_shape(const Def*, const Def*, const Def*);
25///@}
26
27/// @name %%matrix.constMat
28///@{
29enum class constMat : flags_t {
30};
31
32///@}
33
34/// @name %%matrix.read
35///@{
36enum class read : flags_t {
37};
38
39const Def* normalize_read(const Def*, const Def*, const Def*);
40///@}
41
42/// @name %%matrix.insert
43///@{
44enum class insert : flags_t {
45};
46
47const Def* normalize_insert(const Def*, const Def*, const Def*);
48///@}
49
50/// @name %%matrix.init
51///@{
52enum class init : flags_t {
53};
54
55///@}
56
57/// @name %%matrix.prod
58///@{
59enum class prod : flags_t {
60};
61
62const Def* normalize_prod(const Def*, const Def*, const Def*);
63///@}
64
65/// @name %%matrix.transpose
66///@{
67enum class transpose : flags_t {
68};
69
70const Def* normalize_transpose(const Def*, const Def*, const Def*);
71///@}
72
73/// @name %%matrix.sum
74///@{
75enum class sum : flags_t {
76};
77
78///@}
79
80/// @name %%matrix.map_reduce
81///@{
82enum class map_reduce : flags_t {
83};
84
85const Def* normalize_map_reduce(const Def*, const Def*, const Def*);
86///@}
87
88/// @name %%matrix.mapRed_prod
89///@{
90enum class mapRed_prod : flags_t {
91};
92
93///@}
94
95/// @name %%matrix.mapRed_transpose
96///@{
98};
99
100///@}
101
102/// @name %%matrix.mapRed_sum
103///@{
104enum class mapRed_sum : flags_t {
105};
106
107///@}
108
109/// @name %%matrix.lower_matrix_high_level_map_reduce
110///@{
113
114///@}
115
116/// @name %%matrix.lower_matrix_medium_level
117///@{
120
121///@}
122
123/// @name %%matrix.lower_matrix_low_level
124///@{
126};
127
128///@}
129
131
132#define MIM_matrix_NORMALIZER_IMPL \
133 void register_normalizers(Normalizers& normalizers) {\
134 normalizers[flags_t(Annex::Base<shape>)] = &normalize_shape; \
135 normalizers[flags_t(Annex::Base<read>)] = &normalize_read; \
136 normalizers[flags_t(Annex::Base<insert>)] = &normalize_insert; \
137 normalizers[flags_t(Annex::Base<prod>)] = &normalize_prod; \
138 normalizers[flags_t(Annex::Base<transpose>)] = &normalize_transpose; \
139 normalizers[flags_t(Annex::Base<map_reduce>)] = &normalize_map_reduce; \
140 }
141} // namespace plug::matrix
142
143#ifndef DOXYGEN // don't include in Doxygen documentation
144
145template<> constexpr flags_t Annex::Base<plug::matrix::Mat> = 0x3825532990000000;
146template<> constexpr size_t Annex::Num<plug::matrix::Mat> = 0;
147template<> constexpr flags_t Annex::Base<plug::matrix::shape> = 0x3825532990000100;
148template<> constexpr size_t Annex::Num<plug::matrix::shape> = 0;
149template<> constexpr flags_t Annex::Base<plug::matrix::constMat> = 0x3825532990000200;
150template<> constexpr size_t Annex::Num<plug::matrix::constMat> = 0;
151template<> constexpr flags_t Annex::Base<plug::matrix::read> = 0x3825532990000300;
152template<> constexpr size_t Annex::Num<plug::matrix::read> = 0;
153template<> constexpr flags_t Annex::Base<plug::matrix::insert> = 0x3825532990000400;
154template<> constexpr size_t Annex::Num<plug::matrix::insert> = 0;
155template<> constexpr flags_t Annex::Base<plug::matrix::init> = 0x3825532990000500;
156template<> constexpr size_t Annex::Num<plug::matrix::init> = 0;
157template<> constexpr flags_t Annex::Base<plug::matrix::prod> = 0x3825532990000600;
158template<> constexpr size_t Annex::Num<plug::matrix::prod> = 0;
159template<> constexpr flags_t Annex::Base<plug::matrix::transpose> = 0x3825532990000700;
160template<> constexpr size_t Annex::Num<plug::matrix::transpose> = 0;
161template<> constexpr flags_t Annex::Base<plug::matrix::sum> = 0x3825532990000800;
162template<> constexpr size_t Annex::Num<plug::matrix::sum> = 0;
163template<> constexpr flags_t Annex::Base<plug::matrix::map_reduce> = 0x3825532990000900;
164template<> constexpr size_t Annex::Num<plug::matrix::map_reduce> = 0;
165template<> constexpr flags_t Annex::Base<plug::matrix::mapRed_prod> = 0x3825532990000a00;
166template<> constexpr size_t Annex::Num<plug::matrix::mapRed_prod> = 0;
167template<> constexpr flags_t Annex::Base<plug::matrix::mapRed_transpose> = 0x3825532990000b00;
168template<> constexpr size_t Annex::Num<plug::matrix::mapRed_transpose> = 0;
169template<> constexpr flags_t Annex::Base<plug::matrix::mapRed_sum> = 0x3825532990000c00;
170template<> constexpr size_t Annex::Num<plug::matrix::mapRed_sum> = 0;
171template<> constexpr flags_t Annex::Base<plug::matrix::lower_matrix_high_level_map_reduce> = 0x3825532990000d00;
173template<> constexpr flags_t Annex::Base<plug::matrix::lower_matrix_medium_level> = 0x3825532990000e00;
174template<> constexpr size_t Annex::Num<plug::matrix::lower_matrix_medium_level> = 0;
175template<> constexpr flags_t Annex::Base<plug::matrix::lower_matrix_low_level> = 0x3825532990000f00;
176template<> constexpr size_t Annex::Num<plug::matrix::lower_matrix_low_level> = 0;
177
178template<> struct Axm::IsANode<plug::matrix::mapRed_prod> { using type = Axm; };
179template<> struct Axm::IsANode<plug::matrix::mapRed_transpose> { using type = Axm; };
180template<> struct Axm::IsANode<plug::matrix::mapRed_sum> { using type = Axm; };
181template<> struct Axm::IsANode<plug::matrix::lower_matrix_high_level_map_reduce> { using type = Axm; };
182template<> struct Axm::IsANode<plug::matrix::lower_matrix_medium_level> { using type = Axm; };
183template<> struct Axm::IsANode<plug::matrix::lower_matrix_low_level> { using type = Axm; };
184
185#endif
186} // namespace mim
187
188#ifndef DOXYGEN // don't include in Doxygen documentation
189
190
191#endif
Base class for all Defs.
Definition def.h:251
The matrix Plugin
Definition matrix.h:7
const Def * normalize_insert(const Def *, const Def *, const Def *)
Normalizer for write operations TODO: implement.
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
const Def * normalize_map_reduce(const Def *, const Def *, const Def *)
map_reduce normalizers
lower_matrix_high_level_map_reduce
Definition autogen.h:111
const Def * normalize_shape(const Def *type, const Def *callee, const Def *arg)
Normalizer for transpose operations.
void register_normalizers(Normalizers &normalizers)
const Def * normalize_prod(const Def *, const Def *, const Def *)
const Def * normalize_read(const Def *type, const Def *, const Def *arg)
Normalizer for read opertions.
const Def * normalize_transpose(const Def *, const Def *, const Def *)
Definition ast.h:14
u64 flags_t
Definition types.h:46
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:19
u64 plugin_t
Definition types.h:47
@ Axm
Definition def.h:114
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:116
static constexpr flags_t Base
Definition plugin.h:117