@@ -44,26 +44,27 @@ namespace {
44
44
// D -> O: o_i = f(D)
45
45
//
46
46
// by subtracting "offsets" and by dividing the result by "strides".
47
- isl::map removeRangeStrides (
48
- isl::map relation,
49
- isl::multi_val strides,
50
- isl::multi_aff offsets) {
47
+ template <typename Domain, typename Range>
48
+ isl::Map<Domain, Range> removeRangeStrides (
49
+ isl::Map<Domain, Range> relation,
50
+ isl::MultiVal<Range> strides,
51
+ isl::MultiAff<Domain, Range> offsets) {
51
52
TC_CHECK_EQ (strides.size (), offsets.size ());
52
53
53
54
auto space = relation.get_space ();
54
- auto stridesMA = isl::multi_aff ::identity (space.range ().map_from_set ());
55
+ auto stridesMA = isl::MultiAff<Range, Range> ::identity (space.range ().map_from_set ());
55
56
stridesMA = stridesMA / strides;
56
57
57
- return relation.sum (isl::map ( offsets.neg ())).apply_range (isl::map ( stridesMA));
58
+ return relation.sum (offsets.neg (). asMap ( )).apply_range (stridesMA. asMap ( ));
58
59
}
59
60
60
61
// Compute a box approximation of the range of the given relation,
61
62
// including the lower bounds, the box sizes, and the strides.
62
63
// If the range has strides, remove them first.
63
- ScopedFootprint outputRanges (isl::map access) {
64
+ ScopedFootprint outputRanges (isl::Map<Scope, Tensor> access) {
64
65
ScopedFootprint footprint;
65
- footprint.strideValues = isl::multi_val ::zero (access.get_space ().range ());
66
- footprint.strideOffsets = isl::multi_aff ::zero (access.get_space ());
66
+ footprint.strideValues = isl::MultiVal<Tensor> ::zero (access.get_space ().range ());
67
+ footprint.strideOffsets = isl::MultiAff<Scope, Tensor> ::zero (access.get_space ());
67
68
68
69
int nSubscripts = footprint.strideValues .size ();
69
70
for (int i = 0 ; i < nSubscripts; ++i) {
@@ -370,17 +371,17 @@ TensorGroups TensorReferenceGroup::accessedWithin(
370
371
// outer schedule dimensions.
371
372
isl::multi_aff TensorReferenceGroup::promotion () const {
372
373
// access space is S -> O
373
- isl::map map = scopedAccesses ();
374
+ auto map = scopedAccesses ();
374
375
auto accessSpace = map.get_space ();
375
376
376
377
// Construct a projection multi-aff in [S -> O] -> S
377
378
// for further precomposition.
378
- auto originalSpaceInserter = isl::multi_aff ::domain_map (accessSpace);
379
+ auto originalSpaceInserter = isl::MultiAff<isl::Pair<Scope, Tensor>, Scope> ::domain_map (accessSpace);
379
380
380
381
// Lower bounds and offsets space is S -> O; transform into [S -> O] -> O.
381
- auto lowerBounds =
382
+ isl::multi_aff lowerBounds =
382
383
approximation.lowerBounds ().pullback (originalSpaceInserter);
383
- auto offsets = approximation.strideOffsets .pullback (originalSpaceInserter);
384
+ isl::multi_aff offsets = approximation.strideOffsets .pullback (originalSpaceInserter);
384
385
385
386
// Create promotion starting by identity in [S -> O] -> O.
386
387
auto original = isl::multi_aff::range_map (accessSpace);
0 commit comments