Skip to content

Commit 549029b

Browse files
committed
fix failed test
1 parent cdf7647 commit 549029b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3497,10 +3497,14 @@ DiagnosedSilenceableFailure transform::WinogradConv2DOp::applyToOne(
34973497
return true;
34983498
})
34993499
.Default([&](Operation *op) {
3500-
op->emitError("not supported");
35013500
return false;
35023501
});
35033502

3503+
if (!supported) {
3504+
return emitSilenceableError()
3505+
<< "this operation is not supported to convert to Winograd Conv2D";
3506+
}
3507+
35043508
if (supported && failed(maybeTransformed)) {
35053509
return emitSilenceableError() << "apply Winograd Conv2D failed";
35063510
}

mlir/test/Dialect/Linalg/transform-winograd-conv2d.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ module attributes {transform.with_named_sequence} {
4646
// -----
4747

4848
func.func @conv2d_unsupported(%arg0: tensor<2x10x10x5xf32>, %arg1: tensor<3x3x5x2xf32>, %arg2: tensor<1xf32>, %arg3: tensor<2x8x8x2xf32>) -> tensor<2x8x8x2xf32> {
49-
// expected-error @+1 {{not supported}}
5049
%0 = linalg.conv_2d_nhwc_hwcf {dilations = dense<1> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %arg1 : tensor<2x10x10x5xf32>, tensor<3x3x5x2xf32>) outs(%arg3 : tensor<2x8x8x2xf32>) -> tensor<2x8x8x2xf32>
5150
return %0 : tensor<2x8x8x2xf32>
5251
}
5352

5453
module attributes {transform.with_named_sequence} {
5554
transform.named_sequence @__transform_main(%arg1: !transform.any_op {transform.readonly}) {
5655
%0 = transform.structured.match ops{["linalg.conv_2d_nhwc_hwcf"]} in %arg1 : (!transform.any_op) -> !transform.any_op
56+
// expected-error @+1 {{this operation is not supported to convert to Winograd Conv2D}}
5757
%1 = transform.structured.winograd_conv2d %0 { m = 4, r = 3 } : (!transform.any_op) -> (!transform.any_op)
5858
transform.yield
5959
}

0 commit comments

Comments
 (0)