Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
ea441a6e
Commit
ea441a6e
authored
May 22, 2019
by
Nagy Mostafa
Committed by
nmostafa
Jun 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MLIR] Add all elt-wise ops (#24)
parent
c31940d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
6 deletions
+32
-6
dialect.cpp
src/contrib/mlir/dialect/dialect.cpp
+4
-4
ops.td
src/contrib/mlir/dialect/ops.td
+28
-2
No files found.
src/contrib/mlir/dialect/dialect.cpp
View file @
ea441a6e
...
...
@@ -30,10 +30,10 @@ NGDialect::NGDialect(mlir::MLIRContext* ctx)
addTypes
<
NGIntegerType
>
();
addTypes
<
NGBoolType
>
();
addOperations
<
NGAddOp
>
();
addOperations
<
NGMatMulBiasOp
>
();
addOperations
<
NGReturnOp
>
();
addOperations
<
NGFakeInputOp
>
();
addOperations
<
#define GET_OP_LIST
#include "ops.cpp.inc"
>
();
}
void
NGDialect
::
printType
(
mlir
::
Type
type
,
raw_ostream
&
os
)
const
...
...
src/contrib/mlir/dialect/ops.td
View file @
ea441a6e
...
...
@@ -95,19 +95,45 @@ class NG_Terminator_Op<string mnemonic, list<OpTrait> traits = []> :
// Unary Operations
def NGAbsOp : NG_Unary_Arith_Op<"abs">;
def NGACosOp : NG_Unary_Arith_Op<"acos">;
def NGASinOp : NG_Unary_Arith_Op<"asin">;
def NGATanOp : NG_Unary_Arith_Op<"atan">;
def NGCeilOp : NG_Unary_Arith_Op<"ceil">;
def NGConvertOp : NG_Unary_Arith_Op<"conv">;
def NGCosOp : NG_Unary_Arith_Op<"cos">;
def NGCoshOp : NG_Unary_Arith_Op<"cosh">;
def NGExpOp : NG_Unary_Arith_Op<"exp">;
def NGFloorOp : NG_Unary_Arith_Op<"floor">;
def NGLogOp : NG_Unary_Arith_Op<"log">;
def NGNegOp : NG_Unary_Arith_Op<"neg">;
def NGNotOp : NG_Unary_Arith_Op<"not">;
def NGSignOp : NG_Unary_Arith_Op<"sign">;
def NGSinOp : NG_Unary_Arith_Op<"sin">;
def NGSinhOp : NG_Unary_Arith_Op<"sinh">;
def NGTanOp : NG_Unary_Arith_Op<"tan">;
def NGTanhOp : NG_Unary_Arith_Op<"tanh">;
def NGSqrtOp : NG_Unary_Arith_Op<"sqrt">;
// Binary Operations
def NGAddOp : NG_Binary_Arith_Op<"add", [Commutative]>;
def NGAndOp : NG_Binary_Arith_Op<"and", [Commutative]>;
def NGSubOp : NG_Binary_Arith_Op<"sub">;
def NGDivOp : NG_Binary_Arith_Op<"div">;
def NGMaxOp : NG_Binary_Arith_Op<"max", [Commutative]>;
def NGMinOp : NG_Binary_Arith_Op<"min", [Commutative]>;
def NGMulOp : NG_Binary_Arith_Op<"mul", [Commutative]>;
def NGPowOp : NG_Binary_Arith_Op<"pow">;
// Comparison
def NGEqOp : NG_OneResult_Op<"equal", [NoSideEffect]>;
def NGNotEqOp : NG_OneResult_Op<"not.equal", [NoSideEffect]>;
def NGEqOp : NG_OneResult_Op<"equal", [NoSideEffect]>;
def NGGreaterOp : NG_OneResult_Op<"greater", [NoSideEffect]>;
def NGGreaterEqOp : NG_OneResult_Op<"greater.eq", [NoSideEffect]>;
def NGLessOp : NG_OneResult_Op<"less", [NoSideEffect]>;
def NGLessEqOp : NG_OneResult_Op<"less.eq", [NoSideEffect]>;
def NGNotEqOp : NG_OneResult_Op<"not.equal", [NoSideEffect]>;
// Other
def NGSelectOp : NG_OneResult_Op<"select", [NoSideEffect]>;
// Matrix Multiply
def NGMatMulBiasOp : NG_Binary_Arith_Op<"matmul.bias">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment