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

Commit 84ec837

Browse files
author
Sven Verdoolaege
committed
tensorElementsSet: construct expressions on parameter space
Since 2ab86bb (makeIslAffFromExpr: only accept parametric expressions, Mon Mar 26 14:50:33 2018 +0200), makeIslAffFromExpr only constructs parametric expressions. However, it would still accept a set space as input and tensorElementsSet continued to do so. Call it on a parameter space instead for consistency. This will make it easier to provide proper typing of makeIslAffFromExpr when switching to templated isl types.
1 parent 9ee4c33 commit 84ec837

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tc/core/polyhedral/memory_promotion.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "tc/core/polyhedral/exceptions.h"
2626
#include "tc/core/polyhedral/schedule_tree.h"
2727
#include "tc/core/polyhedral/scop.h"
28+
#include "tc/core/polyhedral/utils.h"
2829
#include "tc/external/isl.h"
2930

3031
namespace tc {
@@ -411,15 +412,18 @@ isl::set tensorElementsSet(const Scop& scop, isl::id tensorId) {
411412
auto halideParameter = scop.findArgument(tensorId).parameter();
412413
auto space = scop.domain().get_space();
413414
auto nDim = halideParameter.dimensions();
414-
space = space.add_named_tuple_id_ui(tensorId, nDim);
415+
auto tensorTuple = constructTensorTuple(space, tensorId, nDim);
416+
auto tensorSpace = tensorTuple.get_space();
415417

416-
auto tensorElements = isl::set::universe(space);
417-
auto identity = isl::multi_aff::identity(space.map_from_set());
418+
auto tensorElements = isl::set::universe(tensorSpace);
419+
auto identity = isl::multi_aff::identity(tensorSpace.map_from_set());
418420
for (int i = 0; i < nDim; ++i) {
419421
auto minAff = halide2isl::makeIslAffFromExpr(
420422
space, halideParameter.min_constraint(i));
421423
auto extentAff = halide2isl::makeIslAffFromExpr(
422424
space, halideParameter.extent_constraint(i));
425+
minAff = minAff.unbind_params_insert_domain(tensorTuple);
426+
extentAff = extentAff.unbind_params_insert_domain(tensorTuple);
423427
auto aff = identity.get_aff(i);
424428
tensorElements = tensorElements & (minAff <= isl::aff_set(aff)) &
425429
(isl::aff_set(aff) < (minAff + extentAff));

0 commit comments

Comments
 (0)