@@ -72,34 +72,39 @@ LogicalResult ScatterTensorDescAttr::verify(
7272// ===----------------------------------------------------------------------===//
7373LogicalResult
7474LayoutAttr::verify (llvm::function_ref<mlir::InFlightDiagnostic()> emitError,
75- ScopeAttr scope,
76- DenseI32ArrayAttr sg_layout,
77- DenseI32ArrayAttr sg_data,
78- DenseI32ArrayAttr order,
79- DenseI32ArrayAttr wi_layout,
80- DenseI32ArrayAttr wi_data) {
81-
82- if (scope && scope.getValue () != Scope::WG && (sg_layout || sg_data || order)) {
83- return emitError () << " expected sg_layout, sg_data, and order being only used at workgroup level." ;
75+ ScopeAttr scope, DenseI32ArrayAttr sg_layout,
76+ DenseI32ArrayAttr sg_data, DenseI32ArrayAttr order,
77+ DenseI32ArrayAttr wi_layout, DenseI32ArrayAttr wi_data) {
78+
79+ if (scope && scope.getValue () != Scope::WG &&
80+ (sg_layout || sg_data || order)) {
81+ return emitError () << " expected sg_layout, sg_data, and order being only "
82+ " used at workgroup level." ;
8483 }
8584
8685 if ((sg_layout != nullptr ) ^ (sg_data != nullptr )) {
87- return emitError () << " expected sg_layout and sg_data being both present or both absent" ;
86+ return emitError () << " expected sg_layout and sg_data being both present "
87+ " or both absent" ;
8888 }
8989
9090 if (order) {
9191 if (!sg_layout)
92- return emitError () << " expected order being used with sg_layout and sg_data." ;
92+ return emitError ()
93+ << " expected order being used with sg_layout and sg_data." ;
9394 if (order.size () != sg_layout.size ())
94- return emitError () << " expected order having the same rank as sg_layout and sg_data" ;
95+ return emitError ()
96+ << " expected order having the same rank as sg_layout and sg_data" ;
9597 }
9698
97- if (sg_layout && (sg_layout.size () != sg_data.size () || sg_layout.size () > 2 )) {
98- return emitError () << " expected sg_layout and sg_data having the same rank, which is not larger than 2" ;
99+ if (sg_layout &&
100+ (sg_layout.size () != sg_data.size () || sg_layout.size () > 2 )) {
101+ return emitError () << " expected sg_layout and sg_data having the same "
102+ " rank, which is not larger than 2" ;
99103 }
100104
101105 if (wi_layout.size () != wi_data.size () || wi_layout.size () > 2 )
102- return emitError () << " expected wi_layout and wi_data having the same rank, which is not larger than 2" ;
106+ return emitError () << " expected wi_layout and wi_data having the same "
107+ " rank, which is not larger than 2" ;
103108
104109 return success ();
105110}
0 commit comments