20{
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
112
113
114
115
117 auto ifm =
m.domain().make({1 , 3 , 3 });
118 auto ker =
m.domain().make({1 , 1 , 3 , 3 });
119
120
121
122
123 auto ofm_ch =
m.var().make();
124 auto ofm_row =
m.var().make();
125 auto ofm_col =
m.var().make();
126
127 auto ker_ch =
m.var().make();
128 auto ker_row =
m.var().make();
129 auto ker_col =
m.var().make();
130
131
133
134 m.var().bound(ofm_ch) = Bound{0, 1};
135 m.var().bound(ofm_row) = Bound{0, 1};
136 m.var().bound(ofm_col) = Bound{0, 1};
137
138 m.var().bound(ker_ch) = Bound{0, 1};
139 m.var().bound(ker_row) = Bound{0, 3};
140 m.var().bound(ker_col) = Bound{0, 3};
141
142
143
144
145 auto ifm_value = ifm(ker_ch, ofm_row + ker_row, ofm_col + ker_col);
146 auto ker_value = ker(ofm_ch, ker_ch, ker_row, ker_col);
147
148 m.push(ifm_value * ker_value);
149 m.ret(ofm(ofm_ch, ofm_row, ofm_col));
150
151 return 0;
152}
Domain make(std::initializer_list< uint32_t > dims)
DomainContext & domain(void)