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