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
22c28f75
Commit
22c28f75
authored
Apr 15, 2019
by
Paul
Browse files
Formatting
parent
8607853b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
test/propagate_constant_test.cpp
test/propagate_constant_test.cpp
+10
-5
No files found.
test/propagate_constant_test.cpp
View file @
22c28f75
...
@@ -82,14 +82,17 @@ TEST_CASE(const_add_mul)
...
@@ -82,14 +82,17 @@ TEST_CASE(const_add_mul)
TEST_CASE
(
const_add_scalar
)
TEST_CASE
(
const_add_scalar
)
{
{
migraphx
::
program
p1
;
migraphx
::
program
p1
;
auto
one
=
p1
.
add_instruction
(
migraphx
::
op
::
scalar
{{
migraphx
::
shape
::
int32_type
,
{
2
,
2
}}},
p1
.
add_literal
(
1
));
auto
one
=
p1
.
add_instruction
(
migraphx
::
op
::
scalar
{{
migraphx
::
shape
::
int32_type
,
{
2
,
2
}}},
auto
two
=
p1
.
add_instruction
(
migraphx
::
op
::
scalar
{{
migraphx
::
shape
::
int32_type
,
{
2
,
2
}}},
p1
.
add_literal
(
2
));
p1
.
add_literal
(
1
));
auto
two
=
p1
.
add_instruction
(
migraphx
::
op
::
scalar
{{
migraphx
::
shape
::
int32_type
,
{
2
,
2
}}},
p1
.
add_literal
(
2
));
auto
sum
=
p1
.
add_instruction
(
migraphx
::
op
::
add
{},
one
,
two
);
auto
sum
=
p1
.
add_instruction
(
migraphx
::
op
::
add
{},
one
,
two
);
p1
.
add_instruction
(
pass_op
{},
sum
);
p1
.
add_instruction
(
pass_op
{},
sum
);
p1
.
compile
(
const_prop_target
{});
p1
.
compile
(
const_prop_target
{});
migraphx
::
program
p2
;
migraphx
::
program
p2
;
auto
total
=
p2
.
add_literal
(
migraphx
::
literal
{{
migraphx
::
shape
::
int32_type
,
{
2
,
2
}},
{
3
,
3
,
3
,
3
}});
auto
total
=
p2
.
add_literal
(
migraphx
::
literal
{{
migraphx
::
shape
::
int32_type
,
{
2
,
2
}},
{
3
,
3
,
3
,
3
}});
p2
.
add_instruction
(
pass_op
{},
total
);
p2
.
add_instruction
(
pass_op
{},
total
);
EXPECT
(
p1
==
p2
);
EXPECT
(
p1
==
p2
);
}
}
...
@@ -98,14 +101,16 @@ TEST_CASE(const_scalar)
...
@@ -98,14 +101,16 @@ TEST_CASE(const_scalar)
{
{
migraphx
::
program
p1
;
migraphx
::
program
p1
;
{
{
auto
one
=
p1
.
add_instruction
(
migraphx
::
op
::
scalar
{{
migraphx
::
shape
::
int32_type
,
{
2
,
2
}}},
p1
.
add_literal
(
1
));
auto
one
=
p1
.
add_instruction
(
migraphx
::
op
::
scalar
{{
migraphx
::
shape
::
int32_type
,
{
2
,
2
}}},
p1
.
add_literal
(
1
));
p1
.
add_instruction
(
pass_op
{},
one
);
p1
.
add_instruction
(
pass_op
{},
one
);
}
}
p1
.
compile
(
const_prop_target
{});
p1
.
compile
(
const_prop_target
{});
migraphx
::
program
p2
;
migraphx
::
program
p2
;
{
{
auto
one
=
p2
.
add_instruction
(
migraphx
::
op
::
scalar
{{
migraphx
::
shape
::
int32_type
,
{
2
,
2
}}},
p2
.
add_literal
(
1
));
auto
one
=
p2
.
add_instruction
(
migraphx
::
op
::
scalar
{{
migraphx
::
shape
::
int32_type
,
{
2
,
2
}}},
p2
.
add_literal
(
1
));
p2
.
add_instruction
(
pass_op
{},
one
);
p2
.
add_instruction
(
pass_op
{},
one
);
}
}
EXPECT
(
p1
==
p2
);
EXPECT
(
p1
==
p2
);
...
...
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