tc/core/polyhedral/cuda/memory_promotion_heuristic.cc
/*
 * Check if a reference group features reuse at "depth" after applying
 * "schedule". In particular, consider first depth schedule dimensions as fixed
 * by equating them to parameters and check if the resulting relation is not
 * injective.
 */
Check if a reference group features reuse at "depth" after applying
"schedule". In particular, consider first depth schedule dimensions as fixed
by equating them to parameters and check if the resulting relation is not
injective.
Check if a reference group features reuse at " depth " after applying " schedule " . In particular consider first depth schedule dimensions as fixed by equating them to parameters and check if the resulting relation is not injective .
bool hasReuse(
    const TensorReferenceGroup& group,
    isl::union_map schedule,
    size_t depth) {
  auto scheduledAccessesUMap = group.originalAccesses().apply_domain(schedule);
  auto scheduledAccessMaps =
      isl::UnionAsVector<isl::union_map>(scheduledAccessesUMap);
  return std::any_of(
      scheduledAccessMaps.begin(),
      scheduledAccessMaps.end(),
      [schedule, depth](isl::map access) {
        access = fixOuterInputDimsAsParameters(access, static_cast<int>(depth));
        return !access.is_injective();
      });
}
bool hasReuse ( const TensorReferenceGroup & group , isl :: union_map schedule , size_t depth ) { auto scheduledAccessesUMap = group . originalAccesses ( ) . apply_domain ( schedule ) ; auto scheduledAccessMaps = isl :: UnionAsVector < isl :: union_map > ( scheduledAccessesUMap ) ; return std :: any_of ( scheduledAccessMaps . begin ( ) , scheduledAccessMaps . end ( ) , [ schedule , depth ] ( isl :: map access ) { access = fixOuterInputDimsAsParameters ( access , static_cast < int > ( depth ) ) ; return ! access . is_injective ( ) ; } ) ; }
Check if a reference group features reuse at "depth" after applying
 "schedule".
Check if a reference group features reuse at " depth " after applying " schedule " .