@@ -192,7 +192,8 @@ def GenericOp : LinalgStructuredBase_Op<"generic", [
192
192
}
193
193
194
194
static std::function<void(ImplicitLocOpBuilder &,
195
- Block &, ArrayRef<NamedAttribute>)>
195
+ Block &, ArrayRef<NamedAttribute>,
196
+ function_ref<InFlightDiagnostic()>)>
196
197
getRegionBuilder() {
197
198
return nullptr;
198
199
}
@@ -300,7 +301,8 @@ def MapOp : LinalgStructuredBase_Op<"map", [
300
301
}
301
302
302
303
static std::function<void(mlir::ImplicitLocOpBuilder &, mlir::Block &,
303
- mlir::ArrayRef<mlir::NamedAttribute>)>
304
+ mlir::ArrayRef<mlir::NamedAttribute>,
305
+ function_ref<InFlightDiagnostic()>)>
304
306
getRegionBuilder() {
305
307
return nullptr;
306
308
}
@@ -380,7 +382,8 @@ def ReduceOp : LinalgStructuredBase_Op<"reduce", [
380
382
381
383
// Implement functions necessary for DestinationStyleOpInterface.
382
384
static std::function<void(mlir::ImplicitLocOpBuilder &, mlir::Block &,
383
- mlir::ArrayRef<mlir::NamedAttribute>)>
385
+ mlir::ArrayRef<mlir::NamedAttribute>,
386
+ function_ref<InFlightDiagnostic()>)>
384
387
getRegionBuilder() {
385
388
return nullptr;
386
389
}
@@ -449,13 +452,14 @@ def TransposeOp : LinalgStructuredBase_Op<"transpose", [
449
452
MutableOperandRange getDpsInitsMutable() { return getInitMutable(); }
450
453
451
454
static void regionBuilder(mlir::ImplicitLocOpBuilder &b, mlir::Block &block,
452
- mlir::ArrayRef<mlir::NamedAttribute>) {
455
+ mlir::ArrayRef<mlir::NamedAttribute>, function_ref<InFlightDiagnostic()> emitError ) {
453
456
OpBuilder::InsertionGuard guard(b);
454
457
b.create<linalg::YieldOp>(b.getLoc(), block.getArgument(0));
455
458
}
456
459
457
460
static std::function<void(mlir::ImplicitLocOpBuilder &, mlir::Block &,
458
- mlir::ArrayRef<mlir::NamedAttribute>)>
461
+ mlir::ArrayRef<mlir::NamedAttribute>,
462
+ function_ref<InFlightDiagnostic()>)>
459
463
getRegionBuilder() {
460
464
return regionBuilder;
461
465
}
@@ -521,13 +525,15 @@ def BroadcastOp : LinalgStructuredBase_Op<"broadcast", [
521
525
MutableOperandRange getDpsInitsMutable() { return getInitMutable(); }
522
526
523
527
static void regionBuilder(mlir::ImplicitLocOpBuilder &b, mlir::Block &block,
524
- mlir::ArrayRef<mlir::NamedAttribute>) {
528
+ mlir::ArrayRef<mlir::NamedAttribute>,
529
+ function_ref<InFlightDiagnostic()> emitError) {
525
530
OpBuilder::InsertionGuard guard(b);
526
531
b.create<linalg::YieldOp>(b.getLoc(), block.getArgument(0));
527
532
}
528
533
529
534
static std::function<void(mlir::ImplicitLocOpBuilder &, mlir::Block &,
530
- mlir::ArrayRef<mlir::NamedAttribute>)>
535
+ mlir::ArrayRef<mlir::NamedAttribute>,
536
+ function_ref<InFlightDiagnostic()>)>
531
537
getRegionBuilder() {
532
538
return regionBuilder;
533
539
}
@@ -631,10 +637,12 @@ def ElementwiseOp : LinalgStructuredBase_Op<"elementwise", [
631
637
/// Implements the block region builder for the elementwiseOp. This is
632
638
/// called by the 'fillStructuredOpRegion'.
633
639
static void regionBuilder(ImplicitLocOpBuilder &b,
634
- Block &block, ArrayRef<NamedAttribute> attrs);
640
+ Block &block, ArrayRef<NamedAttribute> attrs,
641
+ function_ref<InFlightDiagnostic()> emitError);
635
642
636
643
static std::function<void(ImplicitLocOpBuilder &,
637
- Block &, ArrayRef<NamedAttribute>)>
644
+ Block &, ArrayRef<NamedAttribute>,
645
+ function_ref<InFlightDiagnostic()>)>
638
646
getRegionBuilder() {
639
647
return regionBuilder;
640
648
}
@@ -771,7 +779,8 @@ def MatmulOp : LinalgStructuredBase_Op<"matmul", [
771
779
772
780
/// Implements the block region builder.
773
781
static void regionBuilder(ImplicitLocOpBuilder &b,
774
- Block &block, ArrayRef<NamedAttribute> attrs);
782
+ Block &block, ArrayRef<NamedAttribute> attrs,
783
+ function_ref<InFlightDiagnostic()> emitError);
775
784
776
785
/// Returns a list of AffineMap with the default matmul indexing charactristic.
777
786
static SmallVector<AffineMap> getDefaultIndexingMaps(MLIRContext *context);
@@ -780,7 +789,8 @@ def MatmulOp : LinalgStructuredBase_Op<"matmul", [
780
789
bool isValidLhsRhsBroadcastMap(AffineMap bcastMap);
781
790
782
791
static std::function<void(ImplicitLocOpBuilder &,
783
- Block &, ArrayRef<NamedAttribute>)>
792
+ Block &, ArrayRef<NamedAttribute>,
793
+ function_ref<InFlightDiagnostic()>)>
784
794
getRegionBuilder() {
785
795
return regionBuilder;
786
796
}
@@ -916,10 +926,12 @@ def ContractOp : LinalgStructuredBase_Op<"contract", [
916
926
static unsigned getNumRegionArgs();
917
927
918
928
static void regionBuilder(ImplicitLocOpBuilder &b,
919
- Block &block, ArrayRef<NamedAttribute> attrs);
929
+ Block &block, ArrayRef<NamedAttribute> attrs,
930
+ function_ref<InFlightDiagnostic()> emitError);
920
931
921
932
static std::function<void(ImplicitLocOpBuilder &,
922
- Block &, ArrayRef<NamedAttribute>)>
933
+ Block &, ArrayRef<NamedAttribute>,
934
+ function_ref<InFlightDiagnostic()>)>
923
935
getRegionBuilder() {
924
936
return regionBuilder;
925
937
}
@@ -1033,9 +1045,11 @@ def BatchMatmulOp : LinalgStructuredBase_Op<"batch_matmul", !listconcat([AttrSiz
1033
1045
1034
1046
SmallVector<utils::IteratorType> getIteratorTypesArray();
1035
1047
static void regionBuilder(ImplicitLocOpBuilder &b,
1036
- Block &block, ArrayRef<NamedAttribute> attrs);
1048
+ Block &block, ArrayRef<NamedAttribute> attrs,
1049
+ function_ref<InFlightDiagnostic()> emitError);
1037
1050
static std::function<void(ImplicitLocOpBuilder &,
1038
- Block &, ArrayRef<NamedAttribute>)>
1051
+ Block &, ArrayRef<NamedAttribute>,
1052
+ function_ref<InFlightDiagnostic()>)>
1039
1053
getRegionBuilder() {
1040
1054
return regionBuilder;
1041
1055
}
@@ -1161,7 +1175,8 @@ def BatchReduceMatmulOp : LinalgStructuredBase_Op<"batch_reduce_matmul", [
1161
1175
1162
1176
/// Implements the block region builder.
1163
1177
static void regionBuilder(ImplicitLocOpBuilder &b,
1164
- Block &block, ArrayRef<NamedAttribute> attrs);
1178
+ Block &block, ArrayRef<NamedAttribute> attrs,
1179
+ function_ref<InFlightDiagnostic()> emitError);
1165
1180
1166
1181
/// Returns a list of AffineMap with the default batch_reduce_matmul indexing charactristic.
1167
1182
static SmallVector<AffineMap> getDefaultIndexingMaps(MLIRContext *context);
@@ -1170,7 +1185,8 @@ def BatchReduceMatmulOp : LinalgStructuredBase_Op<"batch_reduce_matmul", [
1170
1185
bool isValidLhsRhsBroadcastMap(AffineMap bcastMap, bool isLHS = true);
1171
1186
1172
1187
static std::function<void(ImplicitLocOpBuilder &,
1173
- Block &, ArrayRef<NamedAttribute>)>
1188
+ Block &, ArrayRef<NamedAttribute>,
1189
+ function_ref<InFlightDiagnostic()>)>
1174
1190
getRegionBuilder() {
1175
1191
return regionBuilder;
1176
1192
}
0 commit comments