@@ -146,20 +146,20 @@ bool TensorReferenceGroup::isReadOnly() const {
146
146
return result;
147
147
}
148
148
149
- isl::set TensorReferenceGroup::promotedFootprint () const {
149
+ isl::Set<Tensor> TensorReferenceGroup::promotedFootprint () const {
150
150
auto space = scopedAccesses ().get_space ().range ();
151
151
auto sizes = approximation.box .get_size ();
152
152
if (!sizes.get_space ().has_equal_tuples (space)) {
153
153
throw promotion::GroupingError (" unexpected dimensionality mismatch" );
154
154
}
155
155
156
- isl::set footprint = isl::set ::universe (space);
157
- auto identity = isl::multi_aff ::identity (space.map_from_set ());
156
+ isl::Set<Tensor> footprint = isl::Set<Tensor> ::universe (space);
157
+ auto identity = isl::MultiAff<Tensor, Tensor> ::identity (space.map_from_set ());
158
158
for (size_t i = 0 , e = sizes.size (); i < e; ++i) {
159
159
auto aff = identity.get_aff (i);
160
160
auto size = sizes.get_val (i);
161
161
footprint =
162
- footprint & ( isl::aff_set (aff) >= 0 ) & (isl::aff_set (aff) < size );
162
+ footprint & aff. asPwAff (). nonneg_set () & (size - aff). asPwAff (). pos_set ( );
163
163
}
164
164
return footprint;
165
165
}
@@ -174,14 +174,14 @@ std::vector<size_t> TensorReferenceGroup::approximationSizes() const {
174
174
}
175
175
176
176
namespace {
177
- isl::map referenceScopedAccessesImpl (
177
+ isl::Map<Scope, Tensor> referenceScopedAccessesImpl (
178
178
const TensorReferenceGroup& group,
179
179
AccessType type) {
180
180
if (group.references .size () == 0 ) {
181
181
throw promotion::GroupingError (" no references in the group" );
182
182
}
183
183
auto accesses =
184
- isl::map ::empty (group.references .front ()->scopedAccess .get_space ());
184
+ isl::Map<Scope, Tensor> ::empty (group.references .front ()->scopedAccess .get_space ());
185
185
186
186
for (const auto & ref : group.references ) {
187
187
if (ref->type != type) {
@@ -202,11 +202,11 @@ isl::set TensorReferenceGroup::readFootprint() const {
202
202
return referenceScopedAccessesImpl (*this , AccessType::Read).range ();
203
203
}
204
204
205
- isl::map TensorReferenceGroup::scopedWrites () const {
205
+ isl::Map<Scope, Tensor> TensorReferenceGroup::scopedWrites () const {
206
206
return referenceScopedAccessesImpl (*this , AccessType::Write);
207
207
}
208
208
209
- isl::map TensorReferenceGroup::scopedReads () const {
209
+ isl::Map<Scope, Tensor> TensorReferenceGroup::scopedReads () const {
210
210
return referenceScopedAccessesImpl (*this , AccessType::Read);
211
211
}
212
212
@@ -507,7 +507,7 @@ ScheduleTree* insertCopiesUnder(
507
507
// control flow, but we should only write back elements that are actually
508
508
// written to. In any case, intersect the footprint with the set of existing
509
509
// tensor elements.
510
- auto promotedFootprint = group.promotedFootprint ().set_tuple_id (groupId);
510
+ auto promotedFootprint = group.promotedFootprint ().set_tuple_id <Promoted> (groupId);
511
511
auto scheduleUniverse =
512
512
isl::set::universe (promotionSpace.domain ().unwrap ().domain ());
513
513
auto arrayId = promotionSpace.domain ().unwrap ().get_map_range_tuple_id ();
@@ -517,8 +517,8 @@ ScheduleTree* insertCopiesUnder(
517
517
auto readExtension =
518
518
extension.intersect_range (approximatedRead).set_range_tuple_id (readId);
519
519
auto writtenElements =
520
- group.scopedWrites ().intersect_range (tensorElements).wrap ();
521
- writtenElements = writtenElements .product (promotedFootprint);
520
+ group.scopedWrites ().intersect_range (tensorElements).wrap ()
521
+ .product (promotedFootprint);
522
522
auto writeExtension =
523
523
extension.intersect_range (writtenElements).set_range_tuple_id (writeId);
524
524
0 commit comments