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

Commit 1a63a2d

Browse files
author
Sven Verdoolaege
committed
isPromotableToRegistersBelow: use templated isl types
1 parent 62235c1 commit 1a63a2d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tc/core/polyhedral/cuda/memory_promotion_heuristic.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,23 +368,24 @@ bool accessSubscriptsAreUnrolledLoops(
368368
* thread associated to a given pair of tensor element and outer schedule
369369
* iteration.
370370
*/
371+
template <typename Outer>
371372
bool isPromotableToRegistersBelow(
372373
const TensorReferenceGroup& group,
373374
const detail::ScheduleTree* root,
374375
const detail::ScheduleTree* scope,
375-
isl::multi_union_pw_aff outer,
376-
isl::multi_union_pw_aff thread) {
376+
isl::MultiUnionPwAff<Statement, Outer> outer,
377+
isl::MultiUnionPwAff<Statement, Thread> thread) {
377378
if (!accessSubscriptsAreUnrolledLoops(
378-
group, root, scope, outer.flat_range_product(thread))) {
379+
group, root, scope, outer.range_product(thread))) {
379380
return false;
380381
}
381382

382383
auto originalAccesses = group.originalAccesses();
383-
auto map = isl::union_map::from(outer);
384-
map = map.range_product(originalAccesses);
385-
map = map.apply_domain(isl::union_map::from(thread));
384+
auto outerMap = outer.toUnionMap();
385+
auto pair = outerMap.range_product(originalAccesses);
386+
auto threadToPair = pair.apply_domain(thread.toUnionMap());
386387

387-
return map.is_injective();
388+
return threadToPair.is_injective();
388389
}
389390

390391
/*

0 commit comments

Comments
 (0)