tc/core/polyhedral/cuda/memory_promotion_heuristic.cc
/*
 * Starting from the root, find bands where depth is reached.  Using
 * DFSPreorder to make sure order is specified and consistent for tests.
 */
Starting from the root, find bands where depth is reached.  Using
DFSPreorder to make sure order is specified and consistent for tests.
Starting from the root find bands where depth is reached . Using DFSPreorder to make sure order is specified and consistent for tests .
std::vector<detail::ScheduleTree*> bandsContainingScheduleDepth(
    detail::ScheduleTree* root,
    size_t depth) {
  using namespace tc::polyhedral::detail;
  auto bands =
      ScheduleTree::collectDFSPreorder(root, detail::ScheduleTreeType::Band);
  std::function<bool(ScheduleTree * st)> containsDepth = [&](ScheduleTree* st) {
    auto depthBefore = st->scheduleDepth(root);
    auto band = st->elemAs<ScheduleTreeElemBand>();
    auto depthAfter = depthBefore + band->nMember();
    return depthBefore < depth && depthAfter >= depth;
  };
  return functional::Filter(containsDepth, bands);
}
std :: vector < detail :: ScheduleTree * > bandsContainingScheduleDepth ( detail :: ScheduleTree * root , size_t depth ) { using namespace tc :: polyhedral :: detail ; auto bands = ScheduleTree :: collectDFSPreorder ( root , detail :: ScheduleTreeType :: Band ) ; std :: function < bool ( ScheduleTree * st ) > containsDepth = [ & ] ( ScheduleTree * st ) { auto depthBefore = st -> scheduleDepth ( root ) ; auto band = st -> elemAs < ScheduleTreeElemBand > ( ) ; auto depthAfter = depthBefore + band -> nMember ( ) ; return depthBefore < depth && depthAfter >= depth ; } ; return functional :: Filter ( containsDepth , bands ) ; }
Starting from the root, find bands where depth is reached.
Starting from the root find bands where depth is reached .