@@ -28,7 +28,7 @@ def TilingInterface : OpInterface<"TilingInterface"> {
28
28
/*desc=*/[{
29
29
Returns a list of iterator types that describe the number of loops.
30
30
}],
31
- /*retType=*/"SmallVector<utils::IteratorType>",
31
+ /*retType=*/"SmallVector<::mlir:: utils::IteratorType>",
32
32
/*methodName=*/"getLoopIteratorTypes",
33
33
/*args=*/(ins),
34
34
/*methodBody=*/"",
@@ -39,9 +39,9 @@ def TilingInterface : OpInterface<"TilingInterface"> {
39
39
Returns a list of ranges that describe the loop bounds and
40
40
step for the loops of the operation.
41
41
}],
42
- /*retTy=*/"SmallVector<Range>",
42
+ /*retTy=*/"SmallVector<::mlir:: Range>",
43
43
/*methodName=*/"getIterationDomain",
44
- /*args=*/(ins "OpBuilder &":$b),
44
+ /*args=*/(ins "::mlir:: OpBuilder &":$b),
45
45
/*methodBody=*/"",
46
46
/*defaultImplementation=*/"return {};"
47
47
>,
@@ -63,12 +63,12 @@ def TilingInterface : OpInterface<"TilingInterface"> {
63
63
The method returns the operation that is the tiled
64
64
implementation.
65
65
}],
66
- /*retType=*/"FailureOr<TilingResult>",
66
+ /*retType=*/"FailureOr<::mlir:: TilingResult>",
67
67
/*methodName=*/"getTiledImplementation",
68
68
/*args=*/(ins
69
- "OpBuilder &":$b,
70
- "ArrayRef<OpFoldResult> ":$offsets,
71
- "ArrayRef<OpFoldResult> ":$sizes),
69
+ "::mlir:: OpBuilder &":$b,
70
+ "ArrayRef<::mlir:: OpFoldResult> ":$offsets,
71
+ "ArrayRef<::mlir:: OpFoldResult> ":$sizes),
72
72
/*methodBody=*/"",
73
73
/*defaultImplementation=*/[{
74
74
return {};
@@ -82,15 +82,34 @@ def TilingInterface : OpInterface<"TilingInterface"> {
82
82
by the tiled implementation. Expects the same `offsets` and `sizes` as
83
83
used to obtain the tiled implementation of the operation.
84
84
}],
85
- /*retType=*/"LogicalResult",
85
+ /*retType=*/"::mlir:: LogicalResult",
86
86
/*methodName=*/"getResultTilePosition",
87
87
/*args=*/(ins
88
- "OpBuilder &":$b,
88
+ "::mlir:: OpBuilder &":$b,
89
89
"unsigned":$resultNumber,
90
- "ArrayRef<OpFoldResult> ":$offsets,
91
- "ArrayRef<OpFoldResult> ":$sizes,
92
- "SmallVector<OpFoldResult> &":$resultOffsets,
93
- "SmallVector<OpFoldResult> &":$resultSizes),
90
+ "ArrayRef<::mlir::OpFoldResult> ":$offsets,
91
+ "ArrayRef<::mlir::OpFoldResult> ":$sizes,
92
+ "SmallVectorImpl<::mlir::OpFoldResult> &":$resultOffsets,
93
+ "SmallVectorImpl<::mlir::OpFoldResult> &":$resultSizes),
94
+ /*methodBody=*/"",
95
+ /*defaultImplementation=*/[{
96
+ return failure();
97
+ }]
98
+ >,
99
+ InterfaceMethod<
100
+ /*desc=*/[{
101
+ Method to return the position of iteration domain tile computed by the
102
+ tiled operation.
103
+ }],
104
+ /*retType=*/"::mlir::LogicalResult",
105
+ /*methodName=*/"getIterationDomainTileFromOperandTile",
106
+ /*args=*/(ins
107
+ "::mlir::OpBuilder &":$b,
108
+ "unsigned":$operandNumber,
109
+ "ArrayRef<::mlir::OpFoldResult> ":$offsets,
110
+ "ArrayRef<::mlir::OpFoldResult> ":$sizes,
111
+ "SmallVectorImpl<::mlir::OpFoldResult> &":$iterDomainOffsets,
112
+ "SmallVectorImpl<::mlir::OpFoldResult> &":$iterDomainSizes),
94
113
/*methodBody=*/"",
95
114
/*defaultImplementation=*/[{
96
115
return failure();
@@ -119,13 +138,49 @@ def TilingInterface : OpInterface<"TilingInterface"> {
119
138
iteration space).
120
139
- `sizes` provides the size of the tile.
121
140
}],
122
- /*retType=*/"FailureOr<TilingResult>",
141
+ /*retType=*/"FailureOr<::mlir:: TilingResult>",
123
142
/*methodName=*/"generateResultTileValue",
124
143
/*args=*/(ins
125
- "OpBuilder &":$b,
144
+ "::mlir:: OpBuilder &":$b,
126
145
"unsigned":$resultNumber,
127
- "ArrayRef<OpFoldResult>":$offsets,
128
- "ArrayRef<OpFoldResult>":$sizes),
146
+ "ArrayRef<::mlir::OpFoldResult>":$offsets,
147
+ "ArrayRef<::mlir::OpFoldResult>":$sizes),
148
+ /*methodBody=*/"",
149
+ /*defaultImplementation=*/[{
150
+ return failure();
151
+ }]
152
+ >,
153
+ InterfaceMethod<
154
+ /*desc=*/[{
155
+ Method to generate the tiled implementation of an operation from
156
+ operand tile position.
157
+
158
+ Generates the IR that computes the tiled implementation of an
159
+ operation from operand tile. The `offsets` and `sizes`
160
+ describe the tile of the operand required. This is different from
161
+ `getTiledImplementation` which generates the tiled
162
+ implementation of the operation given a tile of the
163
+ iteration space. This method generates a tiled
164
+ implementation of the operation based on the tile of the
165
+ operand required. This method enables consumer fusion by using
166
+ tile and fuse. The method returns failure if the operation
167
+ can't be tiled to generate the operand tile. In practical terms
168
+ this implies it cannot be tiled and fused with its producers.
169
+
170
+ - `offsets` provides the offset of the tile in the coordinate system
171
+ of the original iteration space, i.e., if an iteration space
172
+ dimension had non-zero offset, it must be included in the offset
173
+ provided here (as opposed to zero-based offset "relative" to the
174
+ iteration space).
175
+ - `sizes` provides the size of the tile.
176
+ }],
177
+ /*retType=*/"FailureOr<::mlir::TilingResult>",
178
+ /*methodName=*/"getTiledImplementationFromOperandTile",
179
+ /*args=*/(ins
180
+ "::mlir::OpBuilder &":$b,
181
+ "unsigned":$operandNumber,
182
+ "ArrayRef<::mlir::OpFoldResult>":$offsets,
183
+ "ArrayRef<::mlir::OpFoldResult>":$sizes),
129
184
/*methodBody=*/"",
130
185
/*defaultImplementation=*/[{
131
186
return failure();
@@ -142,12 +197,12 @@ def TilingInterface : OpInterface<"TilingInterface"> {
142
197
transformations are done, this method can be used to lower to scalar
143
198
code that can then be lowered to LLVM or SPIR-V dialects.
144
199
}],
145
- /*retType=*/"LogicalResult",
200
+ /*retType=*/"::mlir:: LogicalResult",
146
201
/*methodName=*/"generateScalarImplementation",
147
202
/*args=*/(ins
148
- "OpBuilder &":$b,
149
- "Location ":$loc,
150
- "ValueRange ":$ivs),
203
+ "::mlir:: OpBuilder &":$b,
204
+ "::mlir:: Location ":$loc,
205
+ "::mlir:: ValueRange ":$ivs),
151
206
/*methodBody=*/"",
152
207
/*defaultImplementation=*/[{
153
208
return failure();
@@ -170,12 +225,12 @@ def PartialReductionOpInterface : OpInterface<"PartialReductionOpInterface"> {
170
225
operation reduction. The tensor shape is equal to operation result
171
226
shape with new dimension for each non zero tile size.
172
227
}],
173
- /*retType=*/"FailureOr<Operation*>",
228
+ /*retType=*/"FailureOr<::mlir:: Operation*>",
174
229
/*methodName=*/"generateInitialTensorForPartialReduction",
175
230
/*args=*/(ins
176
- "OpBuilder &":$b,
177
- "Location ":$loc,
178
- "ArrayRef<OpFoldResult>":$sizes,
231
+ "::mlir:: OpBuilder &":$b,
232
+ "::mlir:: Location ":$loc,
233
+ "ArrayRef<::mlir:: OpFoldResult>":$sizes,
179
234
"ArrayRef<int>":$reductionDim),
180
235
/*methodBody=*/"",
181
236
/*defaultImplementation=*/[{
@@ -189,14 +244,14 @@ def PartialReductionOpInterface : OpInterface<"PartialReductionOpInterface"> {
189
244
less or equal to the tile size. This is meant to be used with
190
245
`mergeReductions` method which will combine the partial reductions.
191
246
}],
192
- /*retType=*/"Operation*",
247
+ /*retType=*/"::mlir:: Operation*",
193
248
/*methodName=*/"tileToPartialReduction",
194
249
/*args=*/(ins
195
- "OpBuilder &":$b,
196
- "Location ":$loc,
197
- "ValueRange":$init,
198
- "ArrayRef<OpFoldResult>":$offsets,
199
- "ArrayRef<OpFoldResult>":$sizes,
250
+ "::mlir:: OpBuilder &":$b,
251
+ "::mlir:: Location ":$loc,
252
+ "::mlir:: ValueRange":$init,
253
+ "ArrayRef<::mlir:: OpFoldResult>":$offsets,
254
+ "ArrayRef<::mlir:: OpFoldResult>":$sizes,
200
255
"ArrayRef<int>":$reductionDims),
201
256
/*methodBody=*/"",
202
257
/*defaultImplementation=*/[{
@@ -209,12 +264,12 @@ def PartialReductionOpInterface : OpInterface<"PartialReductionOpInterface"> {
209
264
tiled along the reduction dimensions. This will only apply the
210
265
reduction the operation.
211
266
}],
212
- /*retType=*/"Operation*",
267
+ /*retType=*/"::mlir:: Operation*",
213
268
/*methodName=*/"mergeReductions",
214
269
/*args=*/(ins
215
- "OpBuilder &":$b,
216
- "Location ":$loc,
217
- "ValueRange":$partialReduce,
270
+ "::mlir:: OpBuilder &":$b,
271
+ "::mlir:: Location ":$loc,
272
+ "::mlir:: ValueRange":$partialReduce,
218
273
"ArrayRef<int>":$reductionDim),
219
274
/*methodBody=*/"",
220
275
/*defaultImplementation=*/[{
0 commit comments