Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
dc85aa6b
Unverified
Commit
dc85aa6b
authored
Mar 29, 2019
by
mvermeulen
Committed by
GitHub
Mar 29, 2019
Browse files
Merge pull request #221 from ROCmSoftwarePlatform/rm_identity
minor fixes to eliminate identity pass
parents
15ba8a36
8f08607e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
src/eliminate_identity.cpp
src/eliminate_identity.cpp
+0
-1
src/include/migraphx/eliminate_identity.hpp
src/include/migraphx/eliminate_identity.hpp
+3
-1
test/eliminate_identity_test.cpp
test/eliminate_identity_test.cpp
+1
-1
No files found.
src/eliminate_identity.cpp
View file @
dc85aa6b
...
...
@@ -3,7 +3,6 @@
#include <migraphx/instruction.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/iterator_for.hpp>
#include <migraphx/ranges.hpp>
#include <migraphx/stringutils.hpp>
#include <utility>
...
...
src/include/migraphx/eliminate_identity.hpp
View file @
dc85aa6b
...
...
@@ -11,7 +11,9 @@ inline namespace MIGRAPHX_INLINE_NS {
struct
program
;
/**
* Remove identity instructions.
* Remove identity instructions. Currently when used as the last pass, it will
* preserve the semantics of previous program state, therefore dead code elimination
* should not be used afterwards.
*/
struct
eliminate_identity
{
...
...
test/eliminate_identity_test.cpp
View file @
dc85aa6b
...
...
@@ -59,7 +59,7 @@ TEST_CASE(simple_test_end_dependency)
p
.
add_instruction
(
sum_op
{},
ans
,
three
);
p
.
add_instruction
(
migraphx
::
op
::
identity
{},
ans
);
p
.
compile
(
eliminate_identity_target
{});
EXPECT
(
!
std
::
none
_of
(
p
.
begin
(),
p
.
end
(),
[](
const
migraphx
::
instruction
&
ins
)
{
EXPECT
(
std
::
any
_of
(
p
.
begin
(),
p
.
end
(),
[](
const
migraphx
::
instruction
&
ins
)
{
return
ins
.
name
()
==
"identity"
;
}));
auto
result
=
p
.
eval
({});
...
...
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