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

Commit 858c1d8

Browse files
authored
Merge pull request #303 from facebookresearch/pr/fix-unsplit
MappedScop::mapToThreads: fix depth of threadIdxX in case of reduction
2 parents 1371777 + 04a4377 commit 858c1d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tc/core/polyhedral/cuda/mapped_scop.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,10 @@ size_t MappedScop::mapToThreads(detail::ScheduleTree* band) {
334334
if (reductionBandUpdates_.count(band) == 1) {
335335
// A reduction is assumed to get mapped to threadIdx.x
336336
CHECK(reductionBandUpdates_.at(band).separated);
337+
auto reductionDim = reductionBandUpdates_.at(band).reductionDim;
337338
threadIdxXScheduleDepthState.emplace_back(std::make_pair(
338339
activeDomainPoints(schedule(), band),
339-
band->scheduleDepth(schedule()) + 0));
340-
auto reductionDim = reductionBandUpdates_.at(band).reductionDim;
340+
band->scheduleDepth(schedule()) + reductionDim));
341341
band = map(band, reductionDim, mapping::ThreadId::x());
342342
nMappedReductionThreads = 1;
343343
}

0 commit comments

Comments
 (0)