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

Commit 186365c

Browse files
ftynseSven Verdoolaege
authored andcommitted
MappedScop::detectReductions: add missing permutability check
If the band with a detect reduction has one or more coincident members, then it gets split and MappedScop::mapToThreads gets called on both parts. The call on the outer part would fail to map the coincident members to thread identifiers because it has a permutability check, while the handling of reductions assumes that the entire originally detected reduction band gets mapped to thread identifiers. Add the same check to MappedScop::detectReductions to prevent this from happening. Note that the new check is more strict, because it will also punt on a single-dimensional non-permutable band mapped to a single thread identifier. Also note that this is fairly theoretical because in practice all bands are permutable.
1 parent 3508ad5 commit 186365c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tc/core/polyhedral/cuda/mapped_scop.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ bool MappedScop::detectReductions(detail::ScheduleTree* tree) {
197197
return found;
198198
}
199199

200+
// Only reductions that appear in permutable bands are mapped to threads.
201+
if (!band->permutable_) {
202+
return false;
203+
}
204+
200205
// For now, only support reductions with a sufficient number
201206
// of coincident outer band members for the remaining thread identifiers.
202207
auto nCoincident = band->nOuterCoincident();

0 commit comments

Comments
 (0)