Commit 848a476d authored by umang yadav's avatar umang yadav
Browse files

fix tidy

parent 8e980f33
......@@ -141,17 +141,15 @@ struct auto_gen_root_modules
std::cout << "\n";
}
if(ins->name() == "@return")
{
generate_run_on_target_modules(mm, p, ins, current_tid);
}
// skip all params, literal and builtins other than return, skip "run_on_target_mod"
// ins
else if(starts_with(ins->name(), "@") or skip_ins.count(ins) != 0)
if((starts_with(ins->name(), "@") and ins->name() != "@return") or
skip_ins.count(ins) != 0)
{
continue;
}
else if(tass.find(ins) == tass.end())
else if(ins->name() == "@return" or tass.find(ins) == tass.end() or
tass.at(ins) != current_tid)
{
generate_run_on_target_modules(mm, p, ins, current_tid);
}
......@@ -167,10 +165,6 @@ struct auto_gen_root_modules
same_tid_ins_vec.push_back(ins);
same_tid_ins_set.insert(ins);
}
else if(tass.at(ins) != current_tid)
{
generate_run_on_target_modules(mm, p, ins, current_tid);
}
else
{
MIGRAPHX_THROW("Partition: this case shouldn't occur");
......
......@@ -187,7 +187,7 @@ target_assignments program::get_target_assignments(const std::vector<target>& ta
{
const auto metric = options.metric;
target_assignments p;
target_assignments tass;
const auto* mm = get_main_module();
std::vector<std::pair<std::size_t, supported_segments>> target_subgraphs;
......@@ -196,12 +196,11 @@ target_assignments program::get_target_assignments(const std::vector<target>& ta
std::transform(tr.begin(), tr.end(), std::back_inserter(target_subgraphs), [&](auto tid) {
return std::make_pair(tid, targets[tid].find_supported(mm, metric));
});
for(const auto ins : iterator_for(*mm))
{
if(contains(p, ins))
{
if(contains(tass, ins))
continue;
}
for(const auto& [tid, subgraph] : target_subgraphs)
{
......@@ -211,17 +210,15 @@ target_assignments program::get_target_assignments(const std::vector<target>& ta
{
const auto& instructions = segment.instructions;
if(contains(instructions, ins))
{
std::transform(instructions.begin(),
instructions.end(),
std::inserter(p, p.end()),
std::inserter(tass, tass.end()),
[&](auto instr) { return std::make_pair(instr, t); });
}
}
}
}
return p;
return tass;
}
bool program::is_compiled() const { return not this->impl->contexts.empty(); }
......
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