Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 98a402a

Browse files
author
Sven Verdoolaege
committed
infixScheduleMupa
1 parent aa66ebf commit 98a402a

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

tc/core/polyhedral/schedule_utils-inl.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ foldl(const std::vector<const ScheduleTree*> vec, Func op, T init = T()) {
9292

9393
} // namespace detail
9494

95-
inline isl::multi_union_pw_aff infixScheduleMupa(
95+
template <typename Schedule>
96+
inline isl::MultiUnionPwAff<Statement, Schedule> infixScheduleMupa(
9697
const detail::ScheduleTree* root,
9798
const detail::ScheduleTree* relativeRoot,
9899
const detail::ScheduleTree* tree) {
@@ -101,13 +102,15 @@ inline isl::multi_union_pw_aff infixScheduleMupa(
101102
auto domainElem = root->as<ScheduleTreeDomain>();
102103
TC_CHECK(domainElem);
103104
auto domain = domainElem->domain_.universe();
104-
auto zero = isl::multi_val::zero(domain.get_space().set_from_params());
105-
auto prefix = isl::multi_union_pw_aff(domain, zero);
105+
auto zero = isl::MultiVal<Schedule>::zero(
106+
domain.get_space().add_unnamed_tuple_ui<Schedule>(0));
107+
auto prefix = isl::MultiUnionPwAff<Statement, Schedule>(domain, zero);
106108
prefix = foldl(
107109
filterType<ScheduleTreeBand>(tree->ancestors(relativeRoot)),
108-
[](const ScheduleTree* st, isl::multi_union_pw_aff pref) {
110+
[](const ScheduleTree* st,
111+
isl::MultiUnionPwAff<Statement, Schedule> pref) {
109112
auto mupa = st->as<ScheduleTreeBand>()->mupa_;
110-
return pref.flat_range_product(mupa);
113+
return pref.template flat_range_product<Schedule>(mupa);
111114
},
112115
prefix);
113116
return prefix;
@@ -117,8 +120,7 @@ template <typename Schedule>
117120
inline isl::MultiUnionPwAff<Statement, Schedule> prefixScheduleMupa(
118121
const detail::ScheduleTree* root,
119122
const detail::ScheduleTree* tree) {
120-
auto prefix = infixScheduleMupa(root, root, tree);
121-
return isl::MultiUnionPwAff<Statement, Schedule>(prefix);
123+
return infixScheduleMupa<Schedule>(root, root, tree);
122124
}
123125

124126
template <typename Schedule>

tc/core/polyhedral/schedule_utils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ isl::UnionMap<Statement, Schedule> prefixSchedule(
9191
// function on the universe domain of the schedule tree.
9292
// Note that this function does not take into account
9393
// any intermediate filter nodes.
94-
isl::multi_union_pw_aff infixScheduleMupa(
94+
template <typename Schedule>
95+
isl::MultiUnionPwAff<Statement, Schedule> infixScheduleMupa(
9596
const detail::ScheduleTree* root,
9697
const detail::ScheduleTree* relativeRoot,
9798
const detail::ScheduleTree* tree);

0 commit comments

Comments
 (0)