Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
e2cf822d
Commit
e2cf822d
authored
Mar 28, 2019
by
Khalique
Browse files
added more documentation and minor fixes
parent
469d0092
Changes
3
Show 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 @
e2cf822d
...
...
@@ -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 @
e2cf822d
...
...
@@ -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 @
e2cf822d
...
...
@@ -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