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

Commit 56d2c6a

Browse files
author
Sven Verdoolaege
committed
use templated isl types makeNextElementMap
1 parent 4c727cc commit 56d2c6a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tc/core/polyhedral/cuda/memory_promotion_heuristic.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,12 @@ bool hasReuseWithin(
154154
* Create a map that increments the "dim"-th dimension and keeps all other
155155
* dimensions unchanged.
156156
*/
157-
isl::map makeNextElementMap(isl::space setSpace, unsigned dim) {
157+
template <typename Domain>
158+
isl::Map<Domain, Domain> makeNextElementMap(
159+
isl::Space<Domain> setSpace,
160+
unsigned dim) {
158161
auto mapSpace = setSpace.map_from_set();
159-
auto identityMA = isl::multi_aff::identity(mapSpace);
162+
auto identityMA = isl::MultiAff<Domain, Domain>::identity(mapSpace);
160163

161164
size_t size = identityMA.size();
162165
if (dim < 0 || dim >= size) {
@@ -167,7 +170,7 @@ isl::map makeNextElementMap(isl::space setSpace, unsigned dim) {
167170

168171
auto aff = identityMA.get_aff(dim);
169172
identityMA = identityMA.set_aff(dim, aff + 1);
170-
return isl::map(identityMA);
173+
return identityMA.asMap();
171174
}
172175

173176
/*
@@ -333,8 +336,8 @@ bool accessSubscriptsAreUnrolledLoops(
333336
}
334337
}
335338

336-
auto space =
337-
subdomain.get_space().add_unnamed_tuple_ui<Unrolled>(unrolledDims.size());
339+
auto space = subdomain.get_space().add_unnamed_tuple_ui<Unrolled>(
340+
unrolledDims.size());
338341
auto unrolledDimsMupa = isl::multi_union_pw_aff(space, unrolledDims);
339342

340343
// It is possible that no loops are unrolled, in which case

0 commit comments

Comments
 (0)