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

Commit 8f8a3c2

Browse files
author
Sven Verdoolaege
committed
makeNextElementMap: use size of isl::multi_aff
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 95a95b1 commit 8f8a3c2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tc/core/polyhedral/cuda/memory_promotion_heuristic.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,16 @@ bool hasReuseWithin(
206206
* dimensions unchanged.
207207
*/
208208
isl::map makeNextElementMap(isl::space setSpace, unsigned dim) {
209-
if (dim < 0 || dim >= setSpace.dim(isl::dim_type::set)) {
209+
auto mapSpace = setSpace.map_from_set();
210+
auto identityMA = isl::multi_aff::identity(mapSpace);
211+
212+
size_t size = identityMA.size();
213+
if (dim < 0 || dim >= size) {
210214
std::stringstream ss;
211-
ss << dim << " is out of [0, " << setSpace.dim(isl::dim_type::set)
212-
<< ") range";
215+
ss << dim << " is out of [0, " << size << ") range";
213216
throw promotion::OutOfRangeException(ss.str());
214217
}
215218

216-
auto mapSpace = setSpace.map_from_set();
217-
auto identityMA = isl::multi_aff::identity(mapSpace);
218219
auto aff = identityMA.get_aff(dim);
219220
identityMA = identityMA.set_aff(dim, aff + 1);
220221
return isl::map(identityMA);

0 commit comments

Comments
 (0)