// Build backend contexts
auto &backend_manager = BackendManager::get();
// Create contexts for other backends
- for (auto backend_str : options.backend_list)
+ for (auto &&backend_str : options.backend_list)
{
backend_manager.loadBackend(backend_str);
auto backend = backend_manager.get(backend_str);
pass::PassRunner{}.append(std::make_unique<pass::PermutationEliminationPass>(*this)).run();
VERBOSE(LoweredGraph) << "Dump after all the passes" << std::endl;
- for (auto operand : _graph.getInputs())
+ for (auto &&operand : _graph.getInputs())
VERBOSE(LoweredGraph) << "Graph Input : " << operand << std::endl;
- for (auto operand : _graph.getOutputs())
+ for (auto &&operand : _graph.getOutputs())
VERBOSE(LoweredGraph) << "Graph Output : " << operand << std::endl;
dumper::text::dumpLoweredGraph(*this);
});
// Set operand lower info using assigned backends to operations
- _graph.operations().iterate([&](const ir::OperationIndex &op_ind, const ir::Operation &) {
- const ir::Operation &op = _graph.operations().at(op_ind);
+ _graph.operations().iterate([&](const ir::OperationIndex &op_ind, const ir::IOperation &) {
+ const ir::IOperation &op = _graph.operations().at(op_ind);
auto backend = backend_resolver.getBackend(op_ind);
if (!backend)
{
// TODO Change setting layout of each backend at another place
auto backend_layout = backend->config()->supportLayout(op, frontend_layout);
- for (auto ind : op.getInputs() | ir::Remove::UNDEFINED)
+ for (auto &&ind : op.getInputs() | ir::Remove::UNDEFINED)
{
auto &operand_li = lower_info().operand.at(ind);
operand_li.addUsePermuteFactor(PermuteFactor{backend, backend_layout});
}
- for (auto ind : op.getOutputs() | ir::Remove::UNDEFINED)
+ for (auto &&ind : op.getOutputs() | ir::Remove::UNDEFINED)
{
auto &operand_li = lower_info().operand.at(ind);
operand_li.addDefPermuteFactor(PermuteFactor{backend, backend_layout});
// Handle graph inputs and outputs
const auto builtin_backend = BackendManager::get().getBuiltin();
auto factor = PermuteFactor{builtin_backend, _graph.layout()};
- for (auto index : _graph.getInputs() | ir::Remove::UNDEFINED)
+ for (auto &&index : _graph.getInputs() | ir::Remove::UNDEFINED)
{
auto &operand_li = lower_info().operand.at(index);
assert(operand_li.def_factors().empty());
operand_li.addDefPermuteFactor(factor);
}
- for (auto index : _graph.getOutputs() | ir::Remove::UNDEFINED)
+ for (auto &&index : _graph.getOutputs() | ir::Remove::UNDEFINED)
{
auto &operand_li = lower_info().operand.at(index);
operand_li.addUsePermuteFactor(factor);
auto factors_to_string = [](const PermuteFactorSet &factors) {
std::string str;
- for (auto factor : factors)
+ for (auto &&factor : factors)
{
str += factor.backend()->config()->id();
str += "(" + to_string(factor.layout()) + ")";
auto operation_index_set_to_string = [](const ir::OperationIndexSet &operations) {
std::stringstream sstream;
sstream << "{ ";
- for (auto op : operations)
+ for (auto &&op : operations)
sstream << op << " ";
sstream << "}";
return sstream.str();