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
b329fb2c
Commit
b329fb2c
authored
Aug 28, 2019
by
Diego Caballero
Committed by
Scott Cyphers
Aug 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MLIR] Remove warnings (unused code + wrong neg op) (#3512)
parent
cdfd67cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
37 deletions
+1
-37
ops.cpp
src/contrib/mlir/dialect/ops.cpp
+1
-1
lowerer.cpp
src/contrib/mlir/lowerer.cpp
+0
-36
No files found.
src/contrib/mlir/dialect/ops.cpp
View file @
b329fb2c
...
...
@@ -199,7 +199,7 @@ mlir::LogicalResult verifyOp(NGGatherOp* op)
NGTensorType
resType
=
r0
.
cast
<
NGTensorType
>
();
// ensure result is compatible with input
if
(
!
resType
.
getRank
()
=
=
inputType
.
getRank
()
+
indicesType
.
getRank
()
-
1
)
if
(
resType
.
getRank
()
!
=
inputType
.
getRank
()
+
indicesType
.
getRank
()
-
1
)
return
op
->
emitOpError
(
"Incompatible result shape and/or type"
);
return
mlir
::
success
();
...
...
src/contrib/mlir/lowerer.cpp
View file @
b329fb2c
...
...
@@ -127,11 +127,6 @@ namespace
SmallVector
<
Value
*
,
4
>
buildOutputDefs
(
Operation
*
op
,
PatternRewriter
&
rewriter
);
Value
*
createTempTensor
(
Type
type
,
PatternRewriter
&
rewriter
);
mlir
::
FuncOp
getCallDecl
(
StringRef
name
,
ArrayRef
<
Type
>
args
,
ArrayRef
<
Type
>
output
,
PatternRewriter
&
rewriter
);
/// Inserts dealloc Ops for each temporary allocated by AllocOp
void
insertDeallocs
(
PatternRewriter
&
rewriter
);
...
...
@@ -143,7 +138,6 @@ namespace
void
findOutputValues
();
void
processFakeInstrs
();
void
insertNoAliasArgAttrs
();
Value
*
insertMemMgrDef
(
PatternRewriter
*
rewriter
=
nullptr
);
private
:
NGraphTypeConverter
typeConverter
;
...
...
@@ -230,21 +224,6 @@ namespace
loweredOutputValues
.
resize
(
outputCount
,
nullptr
);
}
/// Inserts a fake def for Mem Mgr pointer at converted func start
Value
*
DialectLoweringPass
::
insertMemMgrDef
(
PatternRewriter
*
rewriter
)
{
// it would be nice to insert one fake def at the start of the new func
// however, due to how DialectConversion framework works, new func is only
// materialized after conversion is done (rewriter->getFunction, or even
// rewriter->getInsertionBlock()->getFunction() will give you the original func). This
// makes it very convoluted to insert instructions at entry block.
auto
op
=
rewriter
->
create
<
NGFakeInputOp
>
(
rewriter
->
getUnknownLoc
(),
IndexType
::
get
(
&
getContext
()));
// will be fixed later to read passed arg instead.
memMgrDefs
.
push_back
(
op
.
getResult
());
return
op
.
getResult
();
}
SmallVector
<
Value
*
,
4
>
DialectLoweringPass
::
buildOutputDefs
(
Operation
*
op
,
PatternRewriter
&
rewriter
)
{
...
...
@@ -368,21 +347,6 @@ namespace
}
}
mlir
::
FuncOp
DialectLoweringPass
::
getCallDecl
(
StringRef
name
,
ArrayRef
<
Type
>
args
,
ArrayRef
<
Type
>
output
,
PatternRewriter
&
rewriter
)
{
auto
callBackFunc
=
getModule
().
lookupSymbol
<
mlir
::
FuncOp
>
(
name
);
if
(
!
callBackFunc
)
{
auto
callBackType
=
rewriter
.
getFunctionType
(
args
,
output
);
auto
callBackFunc
=
mlir
::
FuncOp
::
create
(
rewriter
.
getUnknownLoc
(),
name
,
callBackType
);
getModule
().
push_back
(
callBackFunc
);
}
return
callBackFunc
;
}
// NGDialect converters
Type
NGraphTypeConverter
::
convertType
(
Type
type
)
{
...
...
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