@@ -72,7 +72,7 @@ void validate(const detail::ScheduleTree* root) {
72
72
root);
73
73
}
74
74
75
- bool anyNonCoincidentMember (const detail::ScheduleTreeElemBand * band) {
75
+ bool anyNonCoincidentMember (const detail::ScheduleTreeBand * band) {
76
76
return band->nOuterCoincident () < band->nMember ();
77
77
}
78
78
@@ -140,7 +140,7 @@ detail::ScheduleTree* MappedScop::map(
140
140
detail::ScheduleTree* MappedScop::mapBlocksForward (
141
141
detail::ScheduleTree* band,
142
142
size_t nToMap) {
143
- auto bandNode = band->elemAs <detail::ScheduleTreeElemBand >();
143
+ auto bandNode = band->as <detail::ScheduleTreeBand >();
144
144
TC_CHECK (bandNode) << " expected a band, got " << *band;
145
145
146
146
auto list = bandNode->mupa_ .get_union_pw_aff_list ();
@@ -155,7 +155,7 @@ void MappedScop::mapToBlocksAndScaleBand(
155
155
std::vector<size_t > tileSizes) {
156
156
using namespace tc ::polyhedral::detail;
157
157
158
- auto bandNode = band->elemAs <ScheduleTreeElemBand >();
158
+ auto bandNode = band->as <ScheduleTreeBand >();
159
159
TC_CHECK (bandNode->permutable_ ) << " cannot map non-permutable band to blocks" ;
160
160
161
161
auto nBlocksToMap = bandNode->nOuterCoincident ();
@@ -235,7 +235,7 @@ bool MappedScop::detectReductions(detail::ScheduleTree* tree) {
235
235
for (auto c : tree->children ()) {
236
236
found |= detectReductions (c);
237
237
}
238
- auto band = tree->elemAs <detail::ScheduleTreeElemBand >();
238
+ auto band = tree->as <detail::ScheduleTreeBand >();
239
239
// Nested reductions are not currently supported.
240
240
if (!band || found) {
241
241
return found;
@@ -296,7 +296,7 @@ bool MappedScop::needReductionSeparation(const detail::ScheduleTree* st) {
296
296
isl::multi_union_pw_aff MappedScop::reductionMapSchedule (
297
297
const detail::ScheduleTree* st) {
298
298
TC_CHECK (reductionBandUpdates_.count (st) == 1 );
299
- auto reductionBand = st->elemAs <detail::ScheduleTreeElemBand >();
299
+ auto reductionBand = st->as <detail::ScheduleTreeBand >();
300
300
TC_CHECK (reductionBand);
301
301
302
302
auto nMember = reductionBand->nMember ();
@@ -359,7 +359,7 @@ detail::ScheduleTree* MappedScop::separateReduction(detail::ScheduleTree* st) {
359
359
360
360
detail::ScheduleTree* MappedScop::mapThreadsBackward (
361
361
detail::ScheduleTree* band) {
362
- auto bandNode = band->elemAs <detail::ScheduleTreeElemBand >();
362
+ auto bandNode = band->as <detail::ScheduleTreeBand >();
363
363
TC_CHECK (bandNode);
364
364
auto nMember = bandNode->nMember ();
365
365
auto nToMap = std::min (nMember, numThreads.view .size ());
@@ -376,7 +376,7 @@ detail::ScheduleTree* MappedScop::mapThreadsBackward(
376
376
size_t MappedScop::mapToThreads (detail::ScheduleTree* band) {
377
377
using namespace tc ::polyhedral::detail;
378
378
379
- auto bandNode = band->elemAs <ScheduleTreeElemBand >();
379
+ auto bandNode = band->as <ScheduleTreeBand >();
380
380
// Cannot map non-permutable bands.
381
381
if (!bandNode->permutable_ ) {
382
382
return 0 ;
@@ -417,7 +417,7 @@ size_t MappedScop::mapToThreads(detail::ScheduleTree* band) {
417
417
reductionBandUpdates_.erase (band);
418
418
}
419
419
band = child;
420
- bandNode = band->elemAs <ScheduleTreeElemBand >();
420
+ bandNode = band->as <ScheduleTreeBand >();
421
421
}
422
422
423
423
if (nMappedThreads < bandNode->nMember ()) {
@@ -450,11 +450,11 @@ bool hasOuterSequentialMember(
450
450
auto ancestors = st->ancestors (root);
451
451
std::reverse (ancestors.begin (), ancestors.end ());
452
452
for (auto a : ancestors) {
453
- auto band = a->elemAs <detail::ScheduleTreeElemBand >();
453
+ auto band = a->as <detail::ScheduleTreeBand >();
454
454
if (band && band->nMember () > band->nOuterCoincident ()) {
455
455
return true ;
456
456
}
457
- if (a->elemAs <detail::ScheduleTreeElemSequence >()) {
457
+ if (a->as <detail::ScheduleTreeSequence >()) {
458
458
return false ;
459
459
}
460
460
}
@@ -542,7 +542,7 @@ Scop::SyncLevel MappedScop::findBestSync(
542
542
543
543
TC_CHECK_LE (1u , scop_->scheduleRoot ()->children ().size ());
544
544
auto contextSt = scop_->scheduleRoot ()->children ()[0 ];
545
- auto contextElem = contextSt->elemAs <detail::ScheduleTreeElemContext >();
545
+ auto contextElem = contextSt->as <detail::ScheduleTreeContext >();
546
546
TC_CHECK (nullptr != contextElem);
547
547
dependences = dependences.intersect_params (contextElem->context_ );
548
548
@@ -705,7 +705,7 @@ std::vector<std::pair<int, int>> MappedScop::findBestSyncConfigInSeq(
705
705
}
706
706
707
707
void MappedScop::insertBestSyncInSeq (detail::ScheduleTree* seq) {
708
- TC_CHECK (seq->elemAs <detail::ScheduleTreeElemSequence >());
708
+ TC_CHECK (seq->as <detail::ScheduleTreeSequence >());
709
709
710
710
auto children = seq->children ();
711
711
auto nChildren = children.size ();
@@ -779,7 +779,7 @@ size_t MappedScop::mapInnermostBandsToThreads(detail::ScheduleTree* st) {
779
779
}
780
780
auto n = nChildren > 0 ? *std::max_element (nInner.begin (), nInner.end ()) : 0 ;
781
781
if (nChildren > 1 ) {
782
- auto needSync = st->elemAs <detail::ScheduleTreeElemSequence >() && n > 0 ;
782
+ auto needSync = st->as <detail::ScheduleTreeSequence >() && n > 0 ;
783
783
if (n > 0 ) {
784
784
for (size_t i = 0 ; i < nChildren; ++i) {
785
785
fixThreadsBelow (*this , children[i], nInner[i]);
@@ -790,7 +790,7 @@ size_t MappedScop::mapInnermostBandsToThreads(detail::ScheduleTree* st) {
790
790
}
791
791
}
792
792
793
- if (auto band = st->elemAs <detail::ScheduleTreeElemBand >()) {
793
+ if (auto band = st->as <detail::ScheduleTreeBand >()) {
794
794
if (n == 0 ) {
795
795
// If children were not mapped to threads, the current band can be mapped.
796
796
// First, map the coincidence and reduction dimension to threads.
@@ -1040,7 +1040,7 @@ std::unique_ptr<MappedScop> MappedScop::makeWithOuterBlockInnerThreadStrategy(
1040
1040
sharedMemorySize -= reductionMemoryRequirement;
1041
1041
}
1042
1042
1043
- auto band = outerBand->elemAs <ScheduleTreeElemBand >();
1043
+ auto band = outerBand->as <ScheduleTreeBand >();
1044
1044
LOG_IF (WARNING, FLAGS_debug_tc_mapper && band->nMember () == 0 )
1045
1045
<< " Aborting memory promotion because outer band has 0 members (NYI)" ;
1046
1046
if (band->nMember () > 0 && sharedMemorySize > 0 ) {
0 commit comments