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
089515ea
Commit
089515ea
authored
Apr 24, 2019
by
Shucai Xiao
Browse files
refine code for fp_convert test cases.
parent
70f793b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
test/cpu_ops_test.cpp
test/cpu_ops_test.cpp
+5
-12
No files found.
test/cpu_ops_test.cpp
View file @
089515ea
...
...
@@ -1571,27 +1571,20 @@ TEST_CASE(fp32_fp16_test)
return
p
;
};
auto
test_case
=
[
&
](
std
::
vector
<
std
::
string
>&&
op_names
)
{
std
::
vector
<
float
>
gold_res
=
{
2.0
,
4.0
,
6.0
,
8.0
,
10.0
,
12.0
};
auto
p
=
create_program
();
migraphx
::
quantize
(
p
,
{
"all"
}
);
migraphx
::
quantize
(
p
,
op_names
);
p
.
compile
(
migraphx
::
cpu
::
target
{});
auto
result
=
p
.
eval
({});
std
::
vector
<
float
>
res
;
result
.
visit
([
&
](
auto
output
)
{
res
.
assign
(
output
.
begin
(),
output
.
end
());
});
EXPECT
(
migraphx
::
verify_range
(
res
,
gold_res
));
}
}
;
{
std
::
vector
<
float
>
gold_res
=
{
2.0
,
4.0
,
6.0
,
8.0
,
10.0
,
12.0
};
auto
p
=
create_program
();
migraphx
::
quantize
(
p
,
{
"all"
});
p
.
compile
(
migraphx
::
cpu
::
target
{});
auto
result
=
p
.
eval
({});
std
::
vector
<
float
>
res
;
result
.
visit
([
&
](
auto
output
)
{
res
.
assign
(
output
.
begin
(),
output
.
end
());
});
EXPECT
(
migraphx
::
verify_range
(
res
,
gold_res
));
}
test_case
({
"all"
});
test_case
({
"add"
});
}
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