});
if (didEncounterError)
- return failure();
+ return rewriter.notifyMatchFailure(
+ operation, "unable to create linalg.generic body for elementwise op");
rewriter.replaceOp(operation, linalgOp->getResults());
return success();
});
if (!didEncounterError)
- return failure();
+ return rewriter.notifyMatchFailure(
+ op, "unable to create linalg.generic body for reduce op");
SmallVector<ReassociationExprs, 4> reassociationMap;
uint64_t expandInputRank =
PatternRewriter &rewriter) const final {
DenseIntElementsAttr perms;
if (!matchPattern(op.getPerms(), m_Constant(&perms))) {
- return failure();
+ return rewriter.notifyMatchFailure(op, "unmatched permutation tensor");
}
auto loc = op.getLoc();
// TODO(suderman): These string values should be declared the TOSA dialect.
if (op.getMode() != "NEAREST_NEIGHBOR" && op.getMode() != "BILINEAR")
- return failure();
+ return rewriter.notifyMatchFailure(
+ op, "tosa.resize mode should be NEAREST_NEIGHBOR or BILINEAR");
const bool isBilinear = op.getMode() == "BILINEAR";
auto dynamicDimsOr =
checkHasDynamicBatchDims(rewriter, op, {input, op.getOutput()});
if (!dynamicDimsOr.has_value())
- return failure();
+ return rewriter.notifyMatchFailure(
+ op, "unable to get dynamic dimensions of tosa.resize");
SmallVector<Value> dynamicDims = dynamicDimsOr.value();
if (op.getMode() != "NEAREST_NEIGHBOR" && op.getMode() != "BILINEAR")
- return failure();
+ return rewriter.notifyMatchFailure(
+ op, "tosa.resize mode should be NEAREST_NEIGHBOR or BILINEAR");
auto emptyTensor = rewriter.create<tensor::EmptyOp>(
loc, resultTy.getShape(), resultElementTy, dynamicDims);
auto dynamicDimsOr = checkHasDynamicBatchDims(
rewriter, op, {input, indices, op.getOutput()});
if (!dynamicDimsOr.has_value())
- return failure();
+ return rewriter.notifyMatchFailure(
+ op, "tosa.gather currently only supports dynamic batch dimensions");
SmallVector<Value> dynamicDims = dynamicDimsOr.value();
auto resultElementTy = resultTy.getElementType();