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

Commit b6a8818

Browse files
author
Sven Verdoolaege
committed
prefixScheduleMupa: extract out infixScheduleMupa
This function will be used to obtain the schedule between the mapping filter and the corresponding thread specific marker in the next commit.
1 parent 49488e6 commit b6a8818

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

tc/core/polyhedral/schedule_transforms.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,9 @@ ostream& operator<<(ostream& os, const vector<Args...>& v) {
450450
}
451451
} // namespace
452452

453-
isl::multi_union_pw_aff prefixScheduleMupa(
453+
isl::multi_union_pw_aff infixScheduleMupa(
454454
const ScheduleTree* root,
455+
const ScheduleTree* relativeRoot,
455456
const ScheduleTree* tree) {
456457
auto domainElem = root->elemAs<ScheduleTreeElemDomain>();
457458
CHECK(domainElem);
@@ -461,7 +462,7 @@ isl::multi_union_pw_aff prefixScheduleMupa(
461462
// Work around bug in isl.
462463
prefix = prefix.intersect_domain(domain);
463464
prefix = foldl(
464-
filterType<ScheduleTreeElemBand>(tree->ancestors(root)),
465+
filterType<ScheduleTreeElemBand>(tree->ancestors(relativeRoot)),
465466
[](const ScheduleTree* st, isl::multi_union_pw_aff prefix) {
466467
auto mupa = st->elemAs<ScheduleTreeElemBand>()->mupa_;
467468
return prefix.flat_range_product(mupa);
@@ -470,6 +471,12 @@ isl::multi_union_pw_aff prefixScheduleMupa(
470471
return prefix;
471472
}
472473

474+
isl::multi_union_pw_aff prefixScheduleMupa(
475+
const ScheduleTree* root,
476+
const ScheduleTree* tree) {
477+
return infixScheduleMupa(root, root, tree);
478+
}
479+
473480
isl::multi_union_pw_aff partialScheduleMupa(
474481
const detail::ScheduleTree* root,
475482
const detail::ScheduleTree* tree) {

tc/core/polyhedral/schedule_transforms.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,18 @@ isl::union_map prefixSchedule(
264264
const detail::ScheduleTree* root,
265265
const detail::ScheduleTree* node);
266266

267+
// Return the concatenation of all band node partial schedules
268+
// from "relativeRoot" (inclusive) to "tree" (exclusive)
269+
// within a tree rooted at "root".
270+
// If there are no intermediate band nodes, then return a zero-dimensional
271+
// function on the universe domain of the schedule tree.
272+
// Note that this function does not take into account
273+
// any intermediate filter nodes.
274+
isl::multi_union_pw_aff infixScheduleMupa(
275+
const detail::ScheduleTree* root,
276+
const detail::ScheduleTree* relativeRoot,
277+
const detail::ScheduleTree* tree);
278+
267279
// Return the concatenation of all outer band node partial schedules.
268280
// If there are no outer band nodes, then return a zero-dimensional
269281
// function on the universe domain of the schedule tree.

0 commit comments

Comments
 (0)