|
25 | 25 | #include "tc/core/polyhedral/exceptions.h"
|
26 | 26 | #include "tc/core/polyhedral/schedule_tree.h"
|
27 | 27 | #include "tc/core/polyhedral/scop.h"
|
| 28 | +#include "tc/core/polyhedral/utils.h" |
28 | 29 | #include "tc/external/isl.h"
|
29 | 30 |
|
30 | 31 | namespace tc {
|
@@ -411,15 +412,18 @@ isl::set tensorElementsSet(const Scop& scop, isl::id tensorId) {
|
411 | 412 | auto halideParameter = scop.findArgument(tensorId).parameter();
|
412 | 413 | auto space = scop.domain().get_space();
|
413 | 414 | 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(); |
415 | 417 |
|
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()); |
418 | 420 | for (int i = 0; i < nDim; ++i) {
|
419 | 421 | auto minAff = halide2isl::makeIslAffFromExpr(
|
420 | 422 | space, halideParameter.min_constraint(i));
|
421 | 423 | auto extentAff = halide2isl::makeIslAffFromExpr(
|
422 | 424 | space, halideParameter.extent_constraint(i));
|
| 425 | + minAff = minAff.unbind_params_insert_domain(tensorTuple); |
| 426 | + extentAff = extentAff.unbind_params_insert_domain(tensorTuple); |
423 | 427 | auto aff = identity.get_aff(i);
|
424 | 428 | tensorElements = tensorElements & (minAff <= isl::aff_set(aff)) &
|
425 | 429 | (isl::aff_set(aff) < (minAff + extentAff));
|
|
0 commit comments