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
b2b3f07e
Commit
b2b3f07e
authored
Mar 05, 2019
by
Paul
Browse files
Formatting
parent
eb507459
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
test/schedule_test.cpp
test/schedule_test.cpp
+12
-5
No files found.
test/schedule_test.cpp
View file @
b2b3f07e
...
...
@@ -133,14 +133,14 @@ void check_conflicts(migraphx::program& p,
});
}
template
<
class
T
>
template
<
class
T
>
std
::
vector
<
T
>
sorted
(
std
::
vector
<
T
>
x
)
{
std
::
sort
(
x
.
begin
(),
x
.
end
());
return
x
;
}
template
<
class
T
>
template
<
class
T
>
std
::
vector
<
T
>
unique
(
std
::
vector
<
T
>
x
)
{
std
::
sort
(
x
.
begin
(),
x
.
end
());
...
...
@@ -225,7 +225,9 @@ TEST_CASE(zero_merge2)
auto
one
=
p
.
add_literal
(
1
);
auto
onep1
=
p
.
add_instruction
(
unary_op
{},
one
);
auto
onep2
=
p
.
add_instruction
(
unary_op
{},
one
);
auto
binary
=
p
.
add_instruction
(
migraphx
::
op
::
identity
{},
p
.
add_instruction
(
migraphx
::
op
::
identity
{},
onep1
),
p
.
add_instruction
(
migraphx
::
op
::
identity
{},
onep2
));
auto
binary
=
p
.
add_instruction
(
migraphx
::
op
::
identity
{},
p
.
add_instruction
(
migraphx
::
op
::
identity
{},
onep1
),
p
.
add_instruction
(
migraphx
::
op
::
identity
{},
onep2
));
p
.
compile
(
schedule_target
{
&
stream
});
EXPECT
(
stream
.
count
(
one
)
==
0
);
EXPECT
(
stream
.
at
(
onep1
)
!=
stream
.
at
(
onep2
));
...
...
@@ -340,9 +342,14 @@ TEST_CASE(four_branches_eq)
auto
binary
=
p
.
add_instruction
(
nary_op
{},
onep1
,
onep2
,
onep3
,
onep4
);
p
.
compile
(
schedule_target
{
&
stream
});
EXPECT
(
stream
.
count
(
one
)
==
0
);
EXPECT
(
sorted
<
std
::
size_t
>
({
stream
.
at
(
onep1
),
stream
.
at
(
onep2
),
stream
.
at
(
onep3
),
stream
.
at
(
onep4
)})
==
unique
<
std
::
size_t
>
({
stream
.
at
(
onep1
),
stream
.
at
(
onep2
),
stream
.
at
(
onep3
),
stream
.
at
(
onep4
)}));
EXPECT
(
sorted
<
std
::
size_t
>
(
{
stream
.
at
(
onep1
),
stream
.
at
(
onep2
),
stream
.
at
(
onep3
),
stream
.
at
(
onep4
)})
==
unique
<
std
::
size_t
>
(
{
stream
.
at
(
onep1
),
stream
.
at
(
onep2
),
stream
.
at
(
onep3
),
stream
.
at
(
onep4
)}));
EXPECT
(
stream
.
at
(
binary
)
==
0
);
EXPECT
(
get_wait_for
(
binary
)
==
get_wait_for
(
stream
[
binary
],
{
stream
[
onep1
],
stream
[
onep2
],
stream
[
onep3
],
stream
[
onep4
]}));
EXPECT
(
get_wait_for
(
binary
)
==
get_wait_for
(
stream
[
binary
],
{
stream
[
onep1
],
stream
[
onep2
],
stream
[
onep3
],
stream
[
onep4
]}));
check_conflicts
(
p
,
{{
onep1
},
{
onep2
},
{
onep3
},
{
onep4
}});
}
...
...
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