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

Formatting

parent fbaec470
......@@ -390,11 +390,11 @@ void schedule::apply(program& p) const
auto p1 = std::distance(ins1, merge.first);
for(auto ins2 : merge.second[j])
{
if (ins1 == ins2)
if(ins1 == ins2)
continue;
auto p2 = std::distance(ins2, merge.first);
// The smaller distance means the instruction occurs later
if (p1 > p2)
if(p1 > p2)
conflict_table[ins2].insert(ins1);
else
conflict_table[ins1].insert(ins2);
......@@ -403,16 +403,16 @@ void schedule::apply(program& p) const
});
}
// Remove duplicates
for(auto&& ip:conflict_table)
for(auto&& ip : conflict_table)
{
auto ins1 = ip.first;
for(auto ins2:ip.second)
if (contains(conflict_table[ins2], ins1))
for(auto ins2 : ip.second)
if(contains(conflict_table[ins2], 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;
std::vector<instruction_ref> args;
args.push_back(ip.first);
......
......@@ -177,7 +177,7 @@ struct schedule_target
}
bool has_stream(migraphx::instruction_ref ins) { return model.ins2stream->count(ins) > 0; }
void check_conflicts(migraphx::program& p,
std::vector<std::vector<migraphx::instruction_ref>> conflicts,
bool result = true)
......@@ -190,7 +190,8 @@ struct schedule_target
for(auto ins2 : conflicts[j])
{
// 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;
CHECK(::check_conflicts(p, ins1, ins2) == result);
}
......@@ -199,8 +200,6 @@ struct schedule_target
}
};
template <class T>
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