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
282fd136
Commit
282fd136
authored
Dec 12, 2023
by
Paul
Browse files
Fix simplify_algebra tests
parent
455e6535
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
test/simplify_algebra_test.cpp
test/simplify_algebra_test.cpp
+17
-4
No files found.
test/simplify_algebra_test.cpp
View file @
282fd136
...
@@ -1055,22 +1055,35 @@ TEST_CASE(simplify_div_const)
...
@@ -1055,22 +1055,35 @@ TEST_CASE(simplify_div_const)
{
{
migraphx
::
module
m1
;
migraphx
::
module
m1
;
{
{
auto
x
=
m1
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
int32
_type
,
{
1
}});
auto
x
=
m1
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float
_type
,
{
1
}});
auto
two
=
m1
.
add_literal
(
2
);
auto
two
=
m1
.
add_literal
(
2
.0
f
);
m1
.
add_instruction
(
migraphx
::
make_op
(
"div"
),
x
,
two
);
m1
.
add_instruction
(
migraphx
::
make_op
(
"div"
),
x
,
two
);
}
}
run_pass
(
m1
);
run_pass
(
m1
);
migraphx
::
module
m2
;
migraphx
::
module
m2
;
{
{
auto
x
=
m2
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
int32
_type
,
{
1
}});
auto
x
=
m2
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float
_type
,
{
1
}});
auto
two
=
m2
.
add_literal
(
2
);
auto
two
=
m2
.
add_literal
(
2
.0
f
);
auto
recip
=
m2
.
insert_instruction
(
std
::
next
(
two
),
migraphx
::
make_op
(
"recip"
),
two
);
auto
recip
=
m2
.
insert_instruction
(
std
::
next
(
two
),
migraphx
::
make_op
(
"recip"
),
two
);
m2
.
add_instruction
(
migraphx
::
make_op
(
"mul"
),
x
,
recip
);
m2
.
add_instruction
(
migraphx
::
make_op
(
"mul"
),
x
,
recip
);
}
}
EXPECT
(
m1
==
m2
);
EXPECT
(
m1
==
m2
);
}
}
TEST_CASE
(
simplify_div_integral_const
)
{
migraphx
::
module
m1
;
{
auto
x
=
m1
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
int32_type
,
{
1
}});
auto
two
=
m1
.
add_literal
(
2
);
m1
.
add_instruction
(
migraphx
::
make_op
(
"div"
),
x
,
two
);
}
migraphx
::
module
m2
=
m1
;
run_pass
(
m1
);
EXPECT
(
m1
==
m2
);
}
TEST_CASE
(
simplify_unit_mult_const
)
TEST_CASE
(
simplify_unit_mult_const
)
{
{
migraphx
::
module
m1
;
migraphx
::
module
m1
;
...
...
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