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

Commit f9ffa2b

Browse files
author
Sven Verdoolaege
committed
infixScheduleMupa: use templated isl types
1 parent 23a82a7 commit f9ffa2b

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
@@ -118,7 +118,8 @@ foldl(const std::vector<const ScheduleTree*> vec, Func op, T init = T()) {
118118

119119
} // namespace detail
120120

121-
inline isl::multi_union_pw_aff infixScheduleMupa(
121+
template <typename Schedule>
122+
inline isl::MultiUnionPwAff<Statement, Schedule> infixScheduleMupa(
122123
const detail::ScheduleTree* root,
123124
const detail::ScheduleTree* relativeRoot,
124125
const detail::ScheduleTree* tree) {
@@ -127,13 +128,15 @@ inline isl::multi_union_pw_aff infixScheduleMupa(
127128
auto domainElem = root->as<ScheduleTreeDomain>();
128129
TC_CHECK(domainElem);
129130
auto domain = domainElem->domain_.universe();
130-
auto zero = isl::multi_val::zero(domain.get_space().set_from_params());
131-
auto prefix = isl::multi_union_pw_aff(domain, zero);
131+
auto zero = isl::MultiVal<Schedule>::zero(
132+
domain.get_space().add_unnamed_tuple_ui<Schedule>(0));
133+
auto prefix = isl::MultiUnionPwAff<Statement, Schedule>(domain, zero);
132134
prefix = foldl(
133135
filterType<ScheduleTreeBand>(tree->ancestors(relativeRoot)),
134-
[](const ScheduleTree* st, isl::multi_union_pw_aff pref) {
136+
[](const ScheduleTree* st,
137+
isl::MultiUnionPwAff<Statement, Schedule> pref) {
135138
auto mupa = st->as<ScheduleTreeBand>()->mupa_;
136-
return pref.flat_range_product(mupa);
139+
return pref.template flat_range_product<Schedule>(mupa);
137140
},
138141
prefix);
139142
return prefix;
@@ -143,8 +146,7 @@ template <typename Schedule>
143146
inline isl::MultiUnionPwAff<Statement, Schedule> prefixScheduleMupa(
144147
const detail::ScheduleTree* root,
145148
const detail::ScheduleTree* tree) {
146-
auto prefix = infixScheduleMupa(root, root, tree);
147-
return isl::MultiUnionPwAff<Statement, Schedule>(prefix);
149+
return infixScheduleMupa<Schedule>(root, root, tree);
148150
}
149151

150152
template <typename Schedule>

tc/core/polyhedral/schedule_utils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ isl::UnionMap<Statement, Schedule> prefixSchedule(
7272
// function on the universe domain of the schedule tree.
7373
// Note that this function does not take into account
7474
// any intermediate filter nodes.
75-
isl::multi_union_pw_aff infixScheduleMupa(
75+
template <typename Schedule>
76+
isl::MultiUnionPwAff<Statement, Schedule> infixScheduleMupa(
7677
const detail::ScheduleTree* root,
7778
const detail::ScheduleTree* relativeRoot,
7879
const detail::ScheduleTree* tree);

0 commit comments

Comments
 (0)