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
b11bc73d
Commit
b11bc73d
authored
Aug 26, 2019
by
Shucai Xiao
Browse files
resolve merge conflict
parents
b3cb2028
84ba492c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
test/cpu_ops_test.cpp
test/cpu_ops_test.cpp
+19
-19
No files found.
test/cpu_ops_test.cpp
View file @
b11bc73d
...
...
@@ -2029,6 +2029,25 @@ TEST_CASE(sqdiff_test)
EXPECT
(
migraphx
::
verify_range
(
results_vector
,
gold
));
}
TEST_CASE
(
round_test
)
{
migraphx
::
program
p
;
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
9
}};
auto
l
=
p
.
add_literal
(
migraphx
::
literal
{
s
,
{
1.1
,
1.5
,
1.6
,
-
1.1
,
-
1.5
,
-
1.6
,
0.0
,
2.0
,
-
2.0
}});
p
.
add_instruction
(
migraphx
::
op
::
round
{},
l
);
p
.
compile
(
migraphx
::
cpu
::
target
{});
auto
result
=
p
.
eval
({});
std
::
vector
<
float
>
results_vector
;
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
for
(
auto
v
:
results_vector
)
{
std
::
cout
<<
v
<<
"
\t
"
;
}
std
::
cout
<<
std
::
endl
;
std
::
vector
<
float
>
gold
=
{
1.0
,
2.0
,
2.0
,
-
1.0
,
-
2.0
,
-
2.0
,
0.0
,
2.0
,
-
2.0
};
EXPECT
(
migraphx
::
verify_range
(
results_vector
,
gold
));
}
TEST_CASE
(
op_capture
)
{
migraphx
::
program
p
;
...
...
@@ -2064,23 +2083,4 @@ TEST_CASE(op_capture)
EXPECT
(
migraphx
::
verify_range
(
vec
,
cap_vec
));
}
TEST_CASE
(
round_test
)
{
migraphx
::
program
p
;
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
9
}};
auto
l
=
p
.
add_literal
(
migraphx
::
literal
{
s
,
{
1.1
,
1.5
,
1.6
,
-
1.1
,
-
1.5
,
-
1.6
,
0.0
,
2.0
,
-
2.0
}});
p
.
add_instruction
(
migraphx
::
op
::
round
{},
l
);
p
.
compile
(
migraphx
::
cpu
::
target
{});
auto
result
=
p
.
eval
({});
std
::
vector
<
float
>
results_vector
;
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
for
(
auto
v
:
results_vector
)
{
std
::
cout
<<
v
<<
"
\t
"
;
}
std
::
cout
<<
std
::
endl
;
std
::
vector
<
float
>
gold
=
{
1.0
,
2.0
,
2.0
,
-
1.0
,
-
2.0
,
-
2.0
,
0.0
,
2.0
,
-
2.0
};
EXPECT
(
migraphx
::
verify_range
(
results_vector
,
gold
));
}
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