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

Commit 8f5a191

Browse files
author
Sven Verdoolaege
committed
outputRanges: use templated isl types
Since removeRangeStrides has not been converted yet, a separate variable is introduced to store its result. Since ScopedFootprint::strideOffsets is modified, TensorReferenceGroup::promotion needs some modifications too.
1 parent 4f99b71 commit 8f5a191

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

tc/core/polyhedral/memory_promotion.cc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ isl::map removeRangeStrides(
6161
// Compute a box approximation of the range of the given relation,
6262
// including the lower bounds, the box sizes, and the strides.
6363
// If the range has strides, remove them first.
64-
ScopedFootprint outputRanges(isl::map access) {
64+
ScopedFootprint outputRanges(isl::Map<Scope, Tensor> access) {
6565
ScopedFootprint footprint;
66-
footprint.strideValues = isl::multi_val::zero(access.get_space().range());
67-
footprint.strideOffsets = isl::multi_aff::zero(access.get_space());
66+
footprint.strideValues =
67+
isl::MultiVal<Tensor>::zero(access.get_space().range());
68+
footprint.strideOffsets =
69+
isl::MultiAff<Scope, Tensor>::zero(access.get_space());
6870

6971
int nSubscripts = footprint.strideValues.size();
7072
for (int i = 0; i < nSubscripts; ++i) {
@@ -74,10 +76,10 @@ ScopedFootprint outputRanges(isl::map access) {
7476
footprint.strideOffsets.set_aff(i, si.get_offset());
7577
}
7678

77-
access = removeRangeStrides(
79+
auto accessNoStrides = removeRangeStrides(
7880
access, footprint.strideValues, footprint.strideOffsets);
7981

80-
footprint.box = access.get_range_simple_fixed_box_hull();
82+
footprint.box = accessNoStrides.get_range_simple_fixed_box_hull();
8183
return footprint;
8284
}
8385
} // namespace
@@ -371,12 +373,13 @@ TensorGroups TensorReferenceGroup::accessedWithin(
371373
// outer schedule dimensions.
372374
isl::multi_aff TensorReferenceGroup::promotion() const {
373375
// access space is S -> O
374-
isl::map map = scopedAccesses();
376+
auto map = scopedAccesses();
375377
auto accessSpace = map.get_space();
376378

377379
// Construct a projection multi-aff in [S -> O] -> S
378380
// for further precomposition.
379-
auto originalSpaceInserter = isl::multi_aff::domain_map(accessSpace);
381+
auto originalSpaceInserter =
382+
isl::MultiAff<isl::Pair<Scope, Tensor>, Scope>::domain_map(accessSpace);
380383

381384
// Lower bounds and offsets space is S -> O; transform into [S -> O] -> O.
382385
isl::multi_aff lowerBounds =

tc/core/polyhedral/memory_promotion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ struct ScopedFootprint {
5959
}
6060

6161
isl::fixed_box box;
62-
isl::multi_val strideValues;
63-
isl::multi_aff strideOffsets;
62+
isl::MultiVal<Tensor> strideValues;
63+
isl::MultiAff<Scope, Tensor> strideOffsets;
6464

6565
isl::multi_aff lowerBounds() const;
6666
};

0 commit comments

Comments
 (0)