Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
autogen.h
Go to the documentation of this file.
1#pragma once
2
3#include <thorin/axiom.h>
4#include <thorin/plugin.h>
5
6/// @namespace thorin::plug::matrix @ref matrix
7namespace thorin {
8namespace plug::matrix {
9
10static constexpr plugin_t Plugin_Id = 0x3825532990000000;
11
12/// @name %%matrix.Mat
13///@{
14#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
15enum Mat : flags_t {
16#else
17enum class Mat : flags_t {
18#endif
19};
20
21///@}
22
23/// @name %%matrix.shape
24///@{
25#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
26enum shape : flags_t {
27#else
28enum class shape : flags_t {
29#endif
30};
31
33///@}
34
35/// @name %%matrix.constMat
36///@{
37#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
39#else
40enum class constMat : flags_t {
41#endif
42};
43
44///@}
45
46/// @name %%matrix.read
47///@{
48#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
49enum read : flags_t {
50#else
51enum class read : flags_t {
52#endif
53};
54
56///@}
57
58/// @name %%matrix.insert
59///@{
60#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
62#else
63enum class insert : flags_t {
64#endif
65};
66
68///@}
69
70/// @name %%matrix.init
71///@{
72#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
73enum init : flags_t {
74#else
75enum class init : flags_t {
76#endif
77};
78
79///@}
80
81/// @name %%matrix.prod
82///@{
83#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
84enum prod : flags_t {
85#else
86enum class prod : flags_t {
87#endif
88};
89
91///@}
92
93/// @name %%matrix.transpose
94///@{
95#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
97#else
98enum class transpose : flags_t {
99#endif
100};
101
103///@}
104
105/// @name %%matrix.sum
106///@{
107#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
108enum sum : flags_t {
109#else
110enum class sum : flags_t {
111#endif
112};
113
114///@}
115
116/// @name %%matrix.map_reduce
117///@{
118#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
120#else
121enum class map_reduce : flags_t {
122#endif
123};
124
126///@}
127
128/// @name %%matrix.lower_matrix_high_level_map_reduce
129///@{
130#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
136
137///@}
138
139/// @name %%matrix.lower_matrix_medium_level
140///@{
141#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
143#else
145#endif
146};
147
148///@}
149
150/// @name %%matrix.internal_map_reduce_cleanup
151///@{
152#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
154#else
156#endif
157};
158
159///@}
160
161/// @name %%matrix.lower_matrix_low_level
162///@{
163#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
165#else
166enum class lower_matrix_low_level : flags_t {
167#endif
168};
169
170///@}
171
173
174#define THORIN_matrix_NORMALIZER_IMPL \
175 void register_normalizers(Normalizers& normalizers) {\
176 normalizers[flags_t(Annex::Base<shape>)] = &normalize_shape; \
177 normalizers[flags_t(Annex::Base<read>)] = &normalize_read; \
178 normalizers[flags_t(Annex::Base<insert>)] = &normalize_insert; \
179 normalizers[flags_t(Annex::Base<prod>)] = &normalize_prod; \
180 normalizers[flags_t(Annex::Base<transpose>)] = &normalize_transpose; \
181 normalizers[flags_t(Annex::Base<map_reduce>)] = &normalize_map_reduce; \
182 }
183} // namespace plug::matrix
184
185#ifndef DOXYGEN // don't include in Doxygen documentation
186template<> constexpr flags_t Annex::Base<plug::matrix::Mat> = 0x3825532990000000;
187template<> constexpr size_t Annex::Num<plug::matrix::Mat> = 0;
188template<> constexpr flags_t Annex::Base<plug::matrix::shape> = 0x3825532990000100;
189template<> constexpr size_t Annex::Num<plug::matrix::shape> = 0;
190template<> constexpr flags_t Annex::Base<plug::matrix::constMat> = 0x3825532990000200;
191template<> constexpr size_t Annex::Num<plug::matrix::constMat> = 0;
192template<> constexpr flags_t Annex::Base<plug::matrix::read> = 0x3825532990000300;
193template<> constexpr size_t Annex::Num<plug::matrix::read> = 0;
194template<> constexpr flags_t Annex::Base<plug::matrix::insert> = 0x3825532990000400;
195template<> constexpr size_t Annex::Num<plug::matrix::insert> = 0;
196template<> constexpr flags_t Annex::Base<plug::matrix::init> = 0x3825532990000500;
197template<> constexpr size_t Annex::Num<plug::matrix::init> = 0;
198template<> constexpr flags_t Annex::Base<plug::matrix::prod> = 0x3825532990000600;
199template<> constexpr size_t Annex::Num<plug::matrix::prod> = 0;
200template<> constexpr flags_t Annex::Base<plug::matrix::transpose> = 0x3825532990000700;
201template<> constexpr size_t Annex::Num<plug::matrix::transpose> = 0;
202template<> constexpr flags_t Annex::Base<plug::matrix::sum> = 0x3825532990000800;
203template<> constexpr size_t Annex::Num<plug::matrix::sum> = 0;
204template<> constexpr flags_t Annex::Base<plug::matrix::map_reduce> = 0x3825532990000900;
205template<> constexpr size_t Annex::Num<plug::matrix::map_reduce> = 0;
206template<> constexpr flags_t Annex::Base<plug::matrix::lower_matrix_high_level_map_reduce> = 0x3825532990000a00;
208template<> constexpr flags_t Annex::Base<plug::matrix::lower_matrix_medium_level> = 0x3825532990000b00;
209template<> constexpr size_t Annex::Num<plug::matrix::lower_matrix_medium_level> = 0;
210template<> constexpr flags_t Annex::Base<plug::matrix::internal_map_reduce_cleanup> = 0x3825532990000c00;
211template<> constexpr size_t Annex::Num<plug::matrix::internal_map_reduce_cleanup> = 0;
212template<> constexpr flags_t Annex::Base<plug::matrix::lower_matrix_low_level> = 0x3825532990000d00;
213template<> constexpr size_t Annex::Num<plug::matrix::lower_matrix_low_level> = 0;
214
215template<> struct Axiom::Match<plug::matrix::lower_matrix_high_level_map_reduce> { using type = Axiom; };
216template<> struct Axiom::Match<plug::matrix::lower_matrix_medium_level> { using type = Axiom; };
217template<> struct Axiom::Match<plug::matrix::internal_map_reduce_cleanup> { using type = Axiom; };
218template<> struct Axiom::Match<plug::matrix::lower_matrix_low_level> { using type = Axiom; };
219#endif
220} // namespace thorin
Helper class to retrieve Infer::arg if present.
Definition def.h:85
@ Axiom
Definition def.h:39
Ref normalize_transpose(Ref type, Ref callee, Ref arg)
Ref normalize_prod(Ref type, Ref callee, Ref arg)
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
void register_normalizers(Normalizers &normalizers)
Ref normalize_insert(Ref type, Ref callee, Ref arg)
Normalizer for write operations TODO: implement.
Ref normalize_shape(Ref type, Ref callee, Ref arg)
Normalizer for transpose operations.
Ref normalize_map_reduce(Ref type, Ref callee, Ref arg)
map_reduce normalizers
Ref normalize_read(Ref type, Ref callee, Ref arg)
Normalizer for read opertions.
Definition cfg.h:11
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:19
u64 plugin_t
Definition types.h:47
u64 flags_t
Definition types.h:46
static constexpr flags_t Base
Definition plugin.h:121