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

Commit 95a95b1

Browse files
author
Sven Verdoolaege
committed
promotionImprovesCoalescing: extract tensor dimension from TensorReferenceGroup
The function isl_space_dim will not be exposed in the mainline C++ interface. A similar function that takes a tuple sequence number as argument may get added later and this function could then be used here. For now, get this information from somewhere else.
1 parent db5b21a commit 95a95b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tc/core/polyhedral/cuda/memory_promotion_heuristic.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ bool promotionImprovesCoalescing(
266266
isl::union_map schedule) {
267267
auto originalAccesses = group.originalAccesses();
268268

269+
auto tensorDim = group.approximation.dim();
269270
auto markers = collectBranchMarkers(root, node);
270271
for (auto marker : markers) {
271272
auto mapping = findThreadMappingAncestor(root, marker);
@@ -280,8 +281,7 @@ bool promotionImprovesCoalescing(
280281
for (auto access : isl::UnionAsVector<isl::union_map>(scheduledAccesses)) {
281282
auto scheduleSpace = access.get_space().domain();
282283
auto tensorSpace = access.get_space().range();
283-
auto elementToNext = makeNextElementMap(
284-
tensorSpace, tensorSpace.dim(isl::dim_type::set) - 1);
284+
auto elementToNext = makeNextElementMap(tensorSpace, tensorDim - 1);
285285
auto scheduleToNextX = makeNextElementMap(scheduleSpace, depth - 1);
286286
auto accessedByAdjacentX =
287287
scheduleToNextX.apply_domain(access).apply_range(access);

0 commit comments

Comments
 (0)