tc/core/polyhedral/schedule_isl_conversion.cc
/*
 * Create a ScheduleTree of the isl schedule subtree at "node".
 *
 * Leaves are not explicitly represented in a ScheduleTree,
 * so do not visit the children of "node" if there is only one and
 * if this single child node is a leaf.
 */
Create a ScheduleTree of the isl schedule subtree at "node".
Leaves are not explicitly represented in a ScheduleTree,
so do not visit the children of "node" if there is only one and
if this single child node is a leaf.
Create a ScheduleTree of the isl schedule subtree at " node " . Leaves are not explicitly represented in a ScheduleTree so do not visit the children of " node " if there is only one and if this single child node is a leaf .
std::unique_ptr<ScheduleTree> fromIslScheduleNode(isl::schedule_node node) {
  unique_ptr<ScheduleTree> res(new ScheduleTree(node.get_ctx()));
  res->elem_ = ScheduleTreeElemBase::make(node);
  res->type_ = res->elem_->type();
  auto n = node.n_children();
  if (n == 1 && node.child(0).isa<isl::schedule_node_leaf>()) {
    return res;
  }
  for (size_t i = 0; i < n; ++i) {
    res->appendChild(fromIslScheduleNode(node.child(i)));
  }
  return res;
}
std :: unique_ptr < ScheduleTree > fromIslScheduleNode ( isl :: schedule_node node ) { unique_ptr < ScheduleTree > res ( new ScheduleTree ( node . get_ctx ( ) ) ) ; res -> elem_ = ScheduleTreeElemBase :: make ( node ) ; res -> type_ = res -> elem_ -> type ( ) ; auto n = node . n_children ( ) ; if ( n == 1 && node . child ( 0 ) . isa < isl :: schedule_node_leaf > ( ) ) { return res ; } for ( size_t i = 0 ; i < n ; ++ i ) { res -> appendChild ( fromIslScheduleNode ( node . child ( i ) ) ) ; } return res ; }
Create a ScheduleTree of the isl schedule subtree at "node".
Create a ScheduleTree of the isl schedule subtree at " node " .