|
1 |
| -// Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved. |
| 1 | +// Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved. |
2 | 2 | //
|
3 | 3 | // Licensed under the Apache License, Version 2.0 (the "License");
|
4 | 4 | // you may not use this file except in compliance with the License.
|
@@ -48,13 +48,16 @@ class FallbackFusionOpToPhiPattern
|
48 | 48 | bool MatchAndRewrite(::cinn::dialect::FusionOp fusion_op,
|
49 | 49 | pir::PatternRewriter& rewriter) const override {
|
50 | 50 | const auto& ret = TryMatchAndRewrite(fusion_op, &rewriter);
|
51 |
| - PADDLE_ENFORCE(!ret.HasError(), |
52 |
| - "FallbackFusionOpToPhiPattern::MatchAndRewrite failed. " |
53 |
| - "\nTraceback (most recent call " |
54 |
| - "last):\n%s\n%s: %s. ", |
55 |
| - ret.GetError().CallStackToString(), |
56 |
| - ret.GetError().class_name(), |
57 |
| - ret.GetError().msg()); |
| 51 | + PADDLE_ENFORCE_EQ( |
| 52 | + ret.HasError(), |
| 53 | + false, |
| 54 | + phi::errors::Fatal( |
| 55 | + "FallbackFusionOpToPhiPattern::MatchAndRewrite failed. " |
| 56 | + "\nTraceback (most recent call " |
| 57 | + "last):\n%s\n%s: %s. ", |
| 58 | + ret.GetError().CallStackToString(), |
| 59 | + ret.GetError().class_name(), |
| 60 | + ret.GetError().msg())); |
58 | 61 | return ret.GetOkValue();
|
59 | 62 | }
|
60 | 63 |
|
|
0 commit comments