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
8a081fcf
"vscode:/vscode.git/clone" did not exist on "6f0b21a7811d6250ee382bdfc62e8ed34d97bf22"
Commit
8a081fcf
authored
Mar 09, 2019
by
Paul
Browse files
Use contains function
parent
9b8739f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/schedule.cpp
src/schedule.cpp
+5
-5
No files found.
src/schedule.cpp
View file @
8a081fcf
...
...
@@ -33,7 +33,7 @@ struct stream_info
void
accumulate_weights
(
instruction_ref
last
,
const
schedule_model
&
model
)
{
fix
<
std
::
size_t
>
([
&
](
auto
self
,
auto
ins
)
->
std
::
size_t
{
if
(
weights
.
count
(
ins
)
==
0
)
if
(
not
contains
(
weights
,
ins
)
)
{
std
::
size_t
weight
=
0
;
auto
&&
op
=
ins
->
get_operator
();
...
...
@@ -125,7 +125,7 @@ struct stream_info
std
::
size_t
get_stream
(
instruction_ref
ins
)
const
{
return
ins2stream
.
at
(
ins
);
}
bool
has_stream
(
instruction_ref
ins
)
const
{
return
ins2stream
.
count
(
ins
)
>
0
;
}
bool
has_stream
(
instruction_ref
ins
)
const
{
return
contains
(
ins2stream
,
ins
)
;
}
bool
different
(
const
std
::
vector
<
std
::
size_t
>&
v
)
const
{
...
...
@@ -221,7 +221,7 @@ struct stream_info
continue
;
}
auto
stream
=
get_stream
(
i
);
if
(
m
.
co
u
nt
(
stream
)
==
0
)
if
(
not
cont
ains
(
m
,
stream
))
m
[
stream
]
=
i
;
else
m
[
stream
]
=
std
::
min
(
m
[
stream
],
i
,
by
(
std
::
less
<>
{},
[
&
](
auto
x
)
{
...
...
@@ -345,7 +345,7 @@ void schedule::apply(program& p) const
if
(
stream
==
istream
)
continue
;
// Create a new event if it hasn't been recorded
if
(
ins2wait
.
count
(
i
)
==
0
)
if
(
not
contains
(
ins2wait
,
i
)
)
{
ins2wait
[
i
]
=
wait_id
;
model
.
record
(
p
,
i
,
wait_id
);
...
...
@@ -354,7 +354,7 @@ void schedule::apply(program& p) const
auto
w
=
ins2wait
.
at
(
i
);
// If we already waited for the event on this stream then dont
// insert another wait event
if
(
waited_for
[
stream
]
.
count
(
w
)
==
0
)
if
(
not
contains
(
waited_for
[
stream
]
,
w
)
)
model
.
wait
(
p
,
ins
,
w
);
// Store the event as waited
waited_for
[
stream
].
insert
(
w
);
...
...
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