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
57a1e24e
Commit
57a1e24e
authored
Apr 12, 2019
by
Paul
Browse files
Add another test
parent
eaaed921
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
test/propagate_constant_test.cpp
test/propagate_constant_test.cpp
+18
-0
No files found.
test/propagate_constant_test.cpp
View file @
57a1e24e
#include <migraphx/propagate_constant.hpp>
#include <migraphx/dead_code_elimination.hpp>
#include <migraphx/op/add.hpp>
#include <migraphx/op/mul.hpp>
#include <basic_ops.hpp>
#include <test.hpp>
...
...
@@ -60,4 +61,21 @@ TEST_CASE(const_add3)
EXPECT
(
p1
==
p2
);
}
TEST_CASE
(
const_add4
)
{
migraphx
::
program
p1
;
auto
one
=
p1
.
add_literal
(
1
);
auto
two
=
p1
.
add_literal
(
2
);
auto
mul
=
p1
.
add_instruction
(
migraphx
::
op
::
mul
{},
two
,
two
);
auto
sum1
=
p1
.
add_instruction
(
migraphx
::
op
::
add
{},
one
,
mul
);
auto
sum2
=
p1
.
add_instruction
(
migraphx
::
op
::
add
{},
sum1
,
two
);
p1
.
add_instruction
(
pass_op
{},
sum2
);
p1
.
compile
(
const_prop_target
{});
migraphx
::
program
p2
;
auto
total
=
p2
.
add_literal
(
7
);
p2
.
add_instruction
(
pass_op
{},
total
);
EXPECT
(
p1
==
p2
);
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
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