Commit bbe9d22c authored by Paul's avatar Paul
Browse files

Formatting

parent 32970359
......@@ -270,17 +270,18 @@ void schedule::apply(program& p) const
assert(stream < model.concurrency());
model.schedule_instruction(p, ins, stream);
// Clear waits when switching streams
if (stream != waited_on)
if(stream != waited_on)
waited_for.clear();
// Schedule wait instruction
if(si.is_merge_point(ins, stream))
{
auto wait_for = si.wait_for(ins);
// Dont wait for streams that have already been waited for
wait_for.erase(std::remove_if(wait_for.begin(), wait_for.end(), [&](auto x) {
return waited_for.count(x) > 0;
}), wait_for.end());
if (not wait_for.empty())
wait_for.erase(std::remove_if(wait_for.begin(),
wait_for.end(),
[&](auto x) { return waited_for.count(x) > 0; }),
wait_for.end());
if(not wait_for.empty())
model.wait(p, ins, stream, wait_for);
waited_for.insert(wait_for.begin(), wait_for.end());
waited_on = stream;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment