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
38930532
"vscode:/vscode.git/clone" did not exist on "10b38209f5c32b4e7511c980c719c8941e40f2b5"
Commit
38930532
authored
Aug 26, 2019
by
Paul
Browse files
Add test for inner broadcast
parent
86f018cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
test/simplify_algebra_test.cpp
test/simplify_algebra_test.cpp
+25
-0
No files found.
test/simplify_algebra_test.cpp
View file @
38930532
...
@@ -176,4 +176,29 @@ TEST_CASE(simplify_mul_add)
...
@@ -176,4 +176,29 @@ TEST_CASE(simplify_mul_add)
EXPECT
(
p1
==
p2
);
EXPECT
(
p1
==
p2
);
}
}
TEST_CASE
(
simplify_inner_broadcast
)
{
auto
b
=
migraphx
::
op
::
broadcast
{
1
,
{
2
,
1
,
4
,
5
}};
migraphx
::
program
p1
;
{
auto
x
=
p1
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
int32_type
,
{
1
}});
auto
y
=
p1
.
add_parameter
(
"y"
,
{
migraphx
::
shape
::
int32_type
,
{
1
}});
auto
xb
=
p1
.
add_instruction
(
b
,
x
);
auto
yb
=
p1
.
add_instruction
(
b
,
y
);
auto
sum
=
p1
.
add_instruction
(
migraphx
::
op
::
add
{},
xb
,
yb
);
p1
.
add_instruction
(
pass_op
{},
sum
);
}
p1
.
compile
(
simplify_algebra_target
{});
migraphx
::
program
p2
;
{
auto
x
=
p2
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
int32_type
,
{
1
}});
auto
y
=
p2
.
add_parameter
(
"y"
,
{
migraphx
::
shape
::
int32_type
,
{
1
}});
auto
sum
=
p2
.
add_instruction
(
migraphx
::
op
::
add
{},
x
,
y
);
auto
sumb
=
p2
.
add_instruction
(
b
,
sum
);
p2
.
add_instruction
(
pass_op
{},
sumb
);
}
EXPECT
(
p1
==
p2
);
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
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