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

Commit cf358bc

Browse files
author
Sven Verdoolaege
committed
MappedScop::mapToThreads: immediately map remaining thread identifiers
This ensures that all thread mapping filters are adjacent such that the outer thread mapping filter can be use both to derive the depth of the mapping and to obtain the active domains points prior to the mapping.
1 parent b6ac9cc commit cf358bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tc/core/polyhedral/cuda/mapped_scop.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,13 @@ size_t MappedScop::mapToThreads(detail::ScheduleTree* band) {
381381
}
382382
band = map(band, dim, id);
383383
}
384+
mapRemaining<mapping::ThreadId>(band, nMappedThreads);
384385

385386
if (isReduction) {
386387
splitOutReductionAndInsertSyncs(band, nMappedThreads - 1);
387388
}
388389

389-
return nMappedThreads;
390+
return numThreads.view.size();
390391
}
391392

392393
namespace {
@@ -475,9 +476,8 @@ size_t MappedScop::mapInnermostBandsToThreads(detail::ScheduleTree* st) {
475476
// because we cannot map parent bands anyway.
476477
auto nMapped = mapToThreads(st);
477478
if (nMapped > 0) {
478-
mapRemaining<mapping::ThreadId>(st, nMapped);
479479
markUnroll(scop_->scheduleRoot(), st, unroll);
480-
return numThreads.view.size();
480+
return nMapped;
481481
}
482482
} else if (anyNonCoincidentMember(band)) {
483483
// If children were mapped to threads, and this band has a non-coincident

0 commit comments

Comments
 (0)