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/axiom.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
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
40///@}
41
42/// @name %%matrix.insert
43///@{
44enum class insert : flags_t {
45};
46
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
63///@}
64
65/// @name %%matrix.transpose
66///@{
67enum class transpose : flags_t {
68};
69
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
86///@}
87
88/// @name %%matrix.lower_matrix_high_level_map_reduce
89///@{
92
93///@}
94
95/// @name %%matrix.lower_matrix_medium_level
96///@{
99
100///@}
101
102/// @name %%matrix.internal_map_reduce_cleanup
103///@{
106
107///@}
108
109/// @name %%matrix.lower_matrix_low_level
110///@{
112};
113
114///@}
115
117
118#define MIM_matrix_NORMALIZER_IMPL \
119 void register_normalizers(Normalizers& normalizers) {\
120 normalizers[flags_t(Annex::Base<shape>)] = &normalize_shape; \
121 normalizers[flags_t(Annex::Base<read>)] = &normalize_read; \
122 normalizers[flags_t(Annex::Base<insert>)] = &normalize_insert; \
123 normalizers[flags_t(Annex::Base<prod>)] = &normalize_prod; \
124 normalizers[flags_t(Annex::Base<transpose>)] = &normalize_transpose; \
125 normalizers[flags_t(Annex::Base<map_reduce>)] = &normalize_map_reduce; \
126 }
127} // namespace plug::matrix
128
129#ifndef DOXYGEN // don't include in Doxygen documentation
130
131template<> constexpr flags_t Annex::Base<plug::matrix::Mat> = 0x3825532990000000;
132template<> constexpr size_t Annex::Num<plug::matrix::Mat> = 0;
133template<> constexpr flags_t Annex::Base<plug::matrix::shape> = 0x3825532990000100;
134template<> constexpr size_t Annex::Num<plug::matrix::shape> = 0;
135template<> constexpr flags_t Annex::Base<plug::matrix::constMat> = 0x3825532990000200;
136template<> constexpr size_t Annex::Num<plug::matrix::constMat> = 0;
137template<> constexpr flags_t Annex::Base<plug::matrix::read> = 0x3825532990000300;
138template<> constexpr size_t Annex::Num<plug::matrix::read> = 0;
139template<> constexpr flags_t Annex::Base<plug::matrix::insert> = 0x3825532990000400;
140template<> constexpr size_t Annex::Num<plug::matrix::insert> = 0;
141template<> constexpr flags_t Annex::Base<plug::matrix::init> = 0x3825532990000500;
142template<> constexpr size_t Annex::Num<plug::matrix::init> = 0;
143template<> constexpr flags_t Annex::Base<plug::matrix::prod> = 0x3825532990000600;
144template<> constexpr size_t Annex::Num<plug::matrix::prod> = 0;
145template<> constexpr flags_t Annex::Base<plug::matrix::transpose> = 0x3825532990000700;
146template<> constexpr size_t Annex::Num<plug::matrix::transpose> = 0;
147template<> constexpr flags_t Annex::Base<plug::matrix::sum> = 0x3825532990000800;
148template<> constexpr size_t Annex::Num<plug::matrix::sum> = 0;
149template<> constexpr flags_t Annex::Base<plug::matrix::map_reduce> = 0x3825532990000900;
150template<> constexpr size_t Annex::Num<plug::matrix::map_reduce> = 0;
151template<> constexpr flags_t Annex::Base<plug::matrix::lower_matrix_high_level_map_reduce> = 0x3825532990000a00;
153template<> constexpr flags_t Annex::Base<plug::matrix::lower_matrix_medium_level> = 0x3825532990000b00;
154template<> constexpr size_t Annex::Num<plug::matrix::lower_matrix_medium_level> = 0;
155template<> constexpr flags_t Annex::Base<plug::matrix::internal_map_reduce_cleanup> = 0x3825532990000c00;
156template<> constexpr size_t Annex::Num<plug::matrix::internal_map_reduce_cleanup> = 0;
157template<> constexpr flags_t Annex::Base<plug::matrix::lower_matrix_low_level> = 0x3825532990000d00;
158template<> constexpr size_t Annex::Num<plug::matrix::lower_matrix_low_level> = 0;
159
160template<> struct Axiom::Match<plug::matrix::lower_matrix_high_level_map_reduce> { using type = Axiom; };
161template<> struct Axiom::Match<plug::matrix::lower_matrix_medium_level> { using type = Axiom; };
162template<> struct Axiom::Match<plug::matrix::internal_map_reduce_cleanup> { using type = Axiom; };
163template<> struct Axiom::Match<plug::matrix::lower_matrix_low_level> { using type = Axiom; };
164
165#endif
166} // namespace mim
167
168#ifndef DOXYGEN // don't include in Doxygen documentation
169
170
171#endif
Helper class to retrieve Infer::arg if present.
Definition def.h:86
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
Ref normalize_shape(Ref type, Ref callee, Ref arg)
Normalizer for transpose operations.
Ref normalize_insert(Ref type, Ref callee, Ref arg)
Normalizer for write operations TODO: implement.
lower_matrix_high_level_map_reduce
Definition autogen.h:90
Ref normalize_prod(Ref type, Ref callee, Ref arg)
void register_normalizers(Normalizers &normalizers)
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.
Ref normalize_transpose(Ref type, Ref callee, Ref arg)
Definition cfg.h:11
u64 flags_t
Definition types.h:45
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:19
u64 plugin_t
Definition types.h:46
static constexpr size_t Num
Definition plugin.h:115
static constexpr flags_t Base
Definition plugin.h:118