Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding verifiers for some tosa operators #90

Draft
wants to merge 12 commits into
base: feature/fused-ops
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ def Tosa_MaxPool2dOp : Tosa_Op<"max_pool2d", [
);

let hasCanonicalizer = 1;
let hasVerifier = 1;
}

//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -498,7 +499,8 @@ def Tosa_AddOp : Tosa_ElemWiseBinaryOp<"add", [Commutative]> {
Tosa_Tensor:$output
);

let hasFolder = 1;
let hasFolder = 1;
let hasVerifier = 1;
}

//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -783,6 +785,9 @@ def Tosa_MulOp : Tosa_ElemWiseBinaryOp<"mul", [Commutative]> {
);

let hasFolder = 1;

let hasVerifier = 1;

}

//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -1125,6 +1130,7 @@ def Tosa_SelectOp : Tosa_Op<"select", [
);
let hasCanonicalizeMethod = 1;
let hasFolder = 1;
let hasVerifier = 1;
}

//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -1209,6 +1215,7 @@ def Tosa_GreaterEqualOp : Tosa_Op<"greater_equal", [
);

let hasFolder = 1;
let hasVerifier = 1;
}

//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -1591,8 +1598,7 @@ def Tosa_TileOp: Tosa_Op<"tile", [
// Operator: transpose
//===----------------------------------------------------------------------===//
def Tosa_TransposeOp : Tosa_Op<"transpose", [
DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
["inferReturnTypeComponents"]>,
InferTensorType,
Pure]> {
let summary = "Transpose operator";

Expand All @@ -1611,11 +1617,13 @@ def Tosa_TransposeOp : Tosa_Op<"transpose", [

let extraClassDeclaration = [{
LogicalResult getConstantPerms(llvm::SmallVector<int64_t> &perms);
/// Returns true when two result types are compatible for this op;
/// Method used by InferTypeOpInterface.
static bool isCompatibleReturnTypes(TypeRange l, TypeRange r);
}];

let hasCanonicalizer = 1;
let hasFolder = 1;
}
let hasFolder = 1;}

//===----------------------------------------------------------------------===//
// TOSA Spec Section 2.10
Expand Down
Loading