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

Commit c69cf78

Browse files
author
Sven Verdoolaege
committed
make obtainOuterBand available as method in Scop
This method will be reused in the next commit.
1 parent 45ca22e commit c69cf78

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tc/core/polyhedral/scop.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,8 @@ detail::ScheduleTree* setPermutable(detail::ScheduleTree* tree) {
423423
return tree;
424424
}
425425

426+
} // namespace
427+
426428
/*
427429
* Return the outermost band in the schedule tree with the given root.
428430
* If there is no single outermost band, then insert a (permutable)
@@ -431,7 +433,8 @@ detail::ScheduleTree* setPermutable(detail::ScheduleTree* tree) {
431433
* insert the band in the leaf. If branching is encountered, then
432434
* insert the band above the branching.
433435
*/
434-
detail::ScheduleTree* obtainOuterBand(detail::ScheduleTree* root) {
436+
detail::ScheduleTree* Scop::obtainOuterBand() {
437+
auto root = scheduleRoot();
435438
auto tree = root;
436439
while (!tree->elemAs<ScheduleTreeElemBand>()) {
437440
auto n = tree->numChildren();
@@ -449,11 +452,10 @@ detail::ScheduleTree* obtainOuterBand(detail::ScheduleTree* root) {
449452
}
450453
return tree;
451454
}
452-
} // namespace
453455

454456
detail::ScheduleTree* Scop::tileOuterBand(const TilingView& tileSizes) {
455457
using namespace tc::polyhedral::detail;
456-
auto band = obtainOuterBand(scheduleRoot());
458+
auto band = obtainOuterBand();
457459
auto bandNode = band->elemAs<ScheduleTreeElemBand>();
458460
std::vector<size_t> sizes = tileSizes.extractVector();
459461
if (bandNode->nMember() < sizes.size()) {

tc/core/polyhedral/scop.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,10 @@ struct Scop {
394394
static std::unique_ptr<Scop> makeScheduled(
395395
const Scop& scop,
396396
const SchedulerOptionsView& schedulerOptions);
397+
// Return the outermost band in the schedule tree with the given root.
398+
// If there is no single outermost band, then insert a (permutable)
399+
// zero-dimensional band and return that.
400+
detail::ScheduleTree* obtainOuterBand();
397401
// Tile the outermost band.
398402
// Splits the band into tile loop band and point loop band where point loops
399403
// have fixed trip counts specified in "tiling", and returns a pointer to the

0 commit comments

Comments
 (0)