Commit 189c3793 authored by Paul's avatar Paul
Browse files

Formatting

parent fbaec470
...@@ -390,11 +390,11 @@ void schedule::apply(program& p) const ...@@ -390,11 +390,11 @@ void schedule::apply(program& p) const
auto p1 = std::distance(ins1, merge.first); auto p1 = std::distance(ins1, merge.first);
for(auto ins2 : merge.second[j]) for(auto ins2 : merge.second[j])
{ {
if (ins1 == ins2) if(ins1 == ins2)
continue; continue;
auto p2 = std::distance(ins2, merge.first); auto p2 = std::distance(ins2, merge.first);
// The smaller distance means the instruction occurs later // The smaller distance means the instruction occurs later
if (p1 > p2) if(p1 > p2)
conflict_table[ins2].insert(ins1); conflict_table[ins2].insert(ins1);
else else
conflict_table[ins1].insert(ins2); conflict_table[ins1].insert(ins2);
...@@ -403,16 +403,16 @@ void schedule::apply(program& p) const ...@@ -403,16 +403,16 @@ void schedule::apply(program& p) const
}); });
} }
// Remove duplicates // Remove duplicates
for(auto&& ip:conflict_table) for(auto&& ip : conflict_table)
{ {
auto ins1 = ip.first; auto ins1 = ip.first;
for(auto ins2:ip.second) for(auto ins2 : ip.second)
if (contains(conflict_table[ins2], ins1)) if(contains(conflict_table[ins2], ins1))
conflict_table[ins2].erase(ins1); conflict_table[ins2].erase(ins1);
} }
for(auto&& ip:conflict_table) for(auto&& ip : conflict_table)
{ {
if (ip.second.empty()) if(ip.second.empty())
continue; continue;
std::vector<instruction_ref> args; std::vector<instruction_ref> args;
args.push_back(ip.first); args.push_back(ip.first);
......
...@@ -190,7 +190,8 @@ struct schedule_target ...@@ -190,7 +190,8 @@ struct schedule_target
for(auto ins2 : conflicts[j]) for(auto ins2 : conflicts[j])
{ {
// If both instructions are on the same stream then dont check for a conflict // If both instructions are on the same stream then dont check for a conflict
if (has_stream(ins1) and has_stream(ins2) and get_stream(ins1) == get_stream(ins2)) if(has_stream(ins1) and has_stream(ins2) and
get_stream(ins1) == get_stream(ins2))
continue; continue;
CHECK(::check_conflicts(p, ins1, ins2) == result); CHECK(::check_conflicts(p, ins1, ins2) == result);
} }
...@@ -199,8 +200,6 @@ struct schedule_target ...@@ -199,8 +200,6 @@ struct schedule_target
} }
}; };
template <class T> template <class T>
std::vector<T> sorted(std::vector<T> x) std::vector<T> sorted(std::vector<T> x)
{ {
......
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