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

Commit 7c89338

Browse files
committed
promoteToSharedBelow: take into account the mapping to blocks
Currenly, promotion to shared memory is only performed below the loops mapped to blocks. Thus, tensor reference groups implictly account for blocks. The scope of mapping in the tree will be changed in upcoming commits. Explicitly include block mapping into the partial schedule within which the tensor reference groups are computed.
1 parent e3c26cb commit 7c89338

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tc/core/polyhedral/cuda/memory_promotion_heuristic.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,10 @@ void promoteToSharedBelow(
440440
size_t& remainingMemory) {
441441
auto root = scop.scheduleRoot();
442442
auto partialSched = partialSchedule(root, bandNode);
443+
auto mapping = collectMappingsTo<mapping::BlockId>(scop);
443444

444445
auto groupMap = TensorReferenceGroup::accessedWithin(
445-
partialSched, scop.reads, scop.writes);
446+
partialSched.intersect_domain(mapping), scop.reads, scop.writes);
446447
// Pure affine schedule without (mapping) filters.
447448
auto partialSchedMupa = partialScheduleMupa(root, bandNode);
448449

0 commit comments

Comments
 (0)