Skip to content

Commit cb26979

Browse files
committed
format code
1 parent 4838b52 commit cb26979

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

mlir/lib/Dialect/XeGPU/IR/XeGPUDialect.cpp

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,34 +72,39 @@ LogicalResult ScatterTensorDescAttr::verify(
7272
//===----------------------------------------------------------------------===//
7373
LogicalResult
7474
LayoutAttr::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
}

mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,9 @@ LogicalResult DpasOp::verify() {
617617
};
618618

619619
if (!isValidSet())
620-
return emitOpError("layout attributes should be either set for all operands (for SIMT code) or not set at all (for SIMD code).");
620+
return emitOpError(
621+
"layout attributes should be either set for all operands (for SIMT "
622+
"code) or not set at all (for SIMD code).");
621623

622624
// query the scope from layoutA (a valid setting).
623625
if (layoutA && layoutA.isForWorkItemLevel()) {
@@ -643,7 +645,8 @@ LogicalResult DpasOp::verify() {
643645
return emitOpError("M-dimension mismatch.");
644646
if (expandedShapeB[1] != expandedShapeC[1])
645647
return emitOpError("N-dimension mismatch.");
646-
} else { // For other scopes, operands' shape should match the mxkxn semantics.
648+
} else { // For other scopes, operands' shape should match the mxkxn
649+
// semantics.
647650
if (lhsRank != 2 || (rhsRank != 2 && rhsRank != 3) || resRank != 2)
648651
return emitOpError(
649652
"expecting lhs and result to be a 2D vector, and rhs to be either "

0 commit comments

Comments
 (0)