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

Commit dcc546c

Browse files
author
Sven Verdoolaege
committed
TensorReferenceGroup::promotion: use templated isl types
1 parent 6db2f43 commit dcc546c

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

tc/core/polyhedral/cuda/codegen.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,9 @@ void emitMappedTensorAccess(
723723
// MA = multi_aff, PMA = pw_multi_aff
724724
auto access =
725725
makeMultiAffAccess(tensorId, subscripts, context); // MA :: D -> O
726-
auto promotion = promotionInfo.group->promotion(); // MA :: [S -> O] -> P
727-
promotion = promotion.set_range_tuple_id(promotionInfo.groupId);
726+
auto prePromotion = promotionInfo.group->promotion(); // MA :: [S -> O] -> P
727+
auto promotion =
728+
prePromotion.set_range_tuple_id<Promoted>(promotionInfo.groupId);
728729
auto iteratorMap = context.iteratorMap(); // PMA :: A -> D
729730
auto schedule = isl::map::from(promotionInfo.outerSchedule.intersect_domain(
730731
context.domain())); // map :: D -> S

tc/core/polyhedral/memory_promotion.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ TensorGroups TensorReferenceGroup::accessedWithin(
373373
// elements of the promoted array get assigned different values of the original
374374
// array in different outer loop iterations; it's impossible to project out the
375375
// outer schedule dimensions.
376-
isl::multi_aff TensorReferenceGroup::promotion() const {
376+
isl::MultiAff<isl::Pair<Scope, Tensor>, Tensor>
377+
TensorReferenceGroup::promotion() const {
377378
// access space is S -> O
378379
auto map = scopedAccesses();
379380
auto accessSpace = map.get_space();
@@ -384,13 +385,13 @@ isl::multi_aff TensorReferenceGroup::promotion() const {
384385
isl::MultiAff<isl::Pair<Scope, Tensor>, Scope>::domain_map(accessSpace);
385386

386387
// Lower bounds and offsets space is S -> O; transform into [S -> O] -> O.
387-
isl::multi_aff lowerBounds =
388+
auto lowerBounds =
388389
approximation.lowerBounds().pullback(originalSpaceInserter);
389-
isl::multi_aff offsets =
390-
approximation.strideOffsets.pullback(originalSpaceInserter);
390+
auto offsets = approximation.strideOffsets.pullback(originalSpaceInserter);
391391

392392
// Create promotion starting by identity in [S -> O] -> O.
393-
auto original = isl::multi_aff::range_map(accessSpace);
393+
auto original =
394+
isl::MultiAff<isl::Pair<Scope, Tensor>, Tensor>::range_map(accessSpace);
394395
auto promotion =
395396
(original - offsets) / approximation.strideValues - lowerBounds;
396397

tc/core/polyhedral/memory_promotion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class TensorReferenceGroup {
145145
// and relative to the scoping point.
146146
isl::map approximateScopedAccesses() const;
147147

148-
isl::multi_aff promotion() const;
148+
isl::MultiAff<isl::Pair<Scope, Tensor>, Tensor> promotion() const;
149149
isl::Set<Tensor> promotedFootprint() const;
150150

151151
std::vector<size_t> approximationSizes() const;

0 commit comments

Comments
 (0)