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

Commit b6fae4d

Browse files
author
Sven Verdoolaege
committed
tensorElementsSet: use templated isl types
1 parent 6ca1fa6 commit b6fae4d

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tc/core/polyhedral/memory_promotion.cc

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -408,25 +408,26 @@ namespace {
408408
// each dimension of the tensor is contrained by the min_aff on the left and
409409
// by the min_aff + extent_aff on the right. Intersect this set with the
410410
// context of the scop.
411-
isl::set tensorElementsSet(const Scop& scop, isl::id tensorId) {
411+
isl::Set<Tensor> tensorElementsSet(const Scop& scop, isl::id tensorId) {
412412
auto halideParameter = scop.findArgument(tensorId).parameter();
413413
auto space = scop.domain().get_space();
414414
auto nDim = halideParameter.dimensions();
415415
auto tensorTuple = constructTensorTuple(space, tensorId, nDim);
416416
auto tensorSpace = tensorTuple.get_space();
417417

418-
auto tensorElements = isl::set::universe(tensorSpace);
419-
auto identity = isl::multi_aff::identity(tensorSpace.map_from_set());
418+
auto tensorElements = isl::Set<Tensor>::universe(tensorSpace);
419+
auto identity =
420+
isl::MultiAff<Tensor, Tensor>::identity(tensorSpace.map_from_set());
420421
for (int i = 0; i < nDim; ++i) {
421-
isl::aff minAff = halide2isl::makeIslAffFromExpr(
422+
auto minAff = halide2isl::makeIslAffFromExpr(
422423
space, halideParameter.min_constraint(i));
423-
isl::aff extentAff = halide2isl::makeIslAffFromExpr(
424+
auto extentAff = halide2isl::makeIslAffFromExpr(
424425
space, halideParameter.extent_constraint(i));
425-
minAff = minAff.unbind_params_insert_domain(tensorTuple);
426-
extentAff = extentAff.unbind_params_insert_domain(tensorTuple);
426+
auto minAff2 = minAff.unbind_params_insert_domain(tensorTuple);
427+
auto extentAff2 = extentAff.unbind_params_insert_domain(tensorTuple);
427428
auto aff = identity.get_aff(i);
428-
tensorElements = tensorElements & (minAff <= isl::aff_set(aff)) &
429-
(isl::aff_set(aff) < (minAff + extentAff));
429+
tensorElements = tensorElements & (minAff2.le_set(aff)) &
430+
(aff.lt_set(minAff2 + extentAff2));
430431
}
431432

432433
tensorElements = tensorElements.intersect_params(scop.context());

0 commit comments

Comments
 (0)