// Plan building
linear->iterate([&](const linear::Element &element) {
- // Assume that the backend of all nodes on a subgraph are identified on the subgraph
- const auto &first_ind = element.subgraph->operations()[0].index;
- auto backend = _model->getLowerInfo(first_ind)->backend();
+ auto backend = element.lower_info->backend();
// Generate Stage
auto stage_gen = backend->stage_gen();
// Now ordered subgraphs are ready
for (auto &subgraph : *subgraph_set)
- _elements.emplace_back(std::move(subgraph));
+ {
+ // Assume that the backend of all nodes on a subgraph are identified on the subgraph
+ const auto &first_ind = subgraph->operations()[0].index;
+ auto lower_info = _graph.getLowerInfo(first_ind);
+ _elements.emplace_back(std::move(subgraph), lower_info);
+ }
VERBOSE(LINEAR) << "Subgraphs" << std::endl;
for (const auto &element : _elements)
// TODO: Change unique_ptr to ptr after Graph has Subgraphs
std::unique_ptr<model::operation::Subgraph> subgraph;
- // TODO
- // graph::operation::LowerInfo *lower_info;
+ const graph::operation::LowerInfo *lower_info;
- Element(std::unique_ptr<model::operation::Subgraph> subgraph) : subgraph{std::move(subgraph)}
+ Element(std::unique_ptr<model::operation::Subgraph> subgraph,
+ const graph::operation::LowerInfo *lower_info)
+ : subgraph{std::move(subgraph)}, lower_info{lower_info}
{
// DO NOTHING
}