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

Commit d9aef27

Browse files
committed
promoteToSharedBelow: rename argument from bandNode to node
The function no longer requires the node to be a band.
1 parent 7c89338 commit d9aef27

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tc/core/polyhedral/cuda/memory_promotion_heuristic.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -430,22 +430,22 @@ std::vector<detail::ScheduleTree*> bandsSplitAfterDepth(
430430
}
431431

432432
/*
433-
* Promote to shared memory in "scop" below the node "bandNode". Use at most
433+
* Promote to shared memory in "scop" below "node". Use at most
434434
* "remainingMemory" bytes, and update the variable to reflect the amount of
435435
* available shared memory remaining after promotion.
436436
*/
437437
void promoteToSharedBelow(
438438
Scop& scop,
439-
detail::ScheduleTree* bandNode,
439+
detail::ScheduleTree* node,
440440
size_t& remainingMemory) {
441441
auto root = scop.scheduleRoot();
442-
auto partialSched = partialSchedule(root, bandNode);
442+
auto partialSched = partialSchedule(root, node);
443443
auto mapping = collectMappingsTo<mapping::BlockId>(scop);
444444

445445
auto groupMap = TensorReferenceGroup::accessedWithin(
446-
partialSched.intersect_domain(mapping), scop.reads, scop.writes);
446+
partialSched.intersect_domain(mapping), scop.body);
447447
// Pure affine schedule without (mapping) filters.
448-
auto partialSchedMupa = partialScheduleMupa(root, bandNode);
448+
auto partialSchedMupa = partialScheduleMupa(root, node);
449449

450450
// Prepare groups for sorting, to have specified order necessary for
451451
// reproducibility and tests.
@@ -504,21 +504,21 @@ void promoteToSharedBelow(
504504
// Do not promote if the group features no reuse and is accessed in a
505505
// coalesced way.
506506
if (!hasReuseWithin(*group, partialSchedMupa) &&
507-
!promotionImprovesCoalescing(root, bandNode, *group)) {
507+
!promotionImprovesCoalescing(root, node, *group)) {
508508
continue;
509509
}
510510

511511
scop.promoteGroup(
512512
Scop::PromotedDecl::Kind::SharedMem,
513513
tensorId,
514514
std::move(group),
515-
bandNode,
515+
node,
516516
partialSched,
517517
true);
518518
remainingMemory -= memoryRequirement;
519519
}
520520
}
521-
scop.insertSyncsAroundCopies(bandNode);
521+
scop.insertSyncsAroundCopies(node);
522522
}
523523

524524
/*

0 commit comments

Comments
 (0)