On Tue, Jun 06, 2023 at 09:58:08PM +0900, Emil Vatai wrote:
> I have the dependency as an `isl_union_map` and so is the schedule (after
> `isl_schedule_get_map`), and now how do I "apply that to both sides"? I
> tried getting the domain/range, but that just returned different sets. I'm
> now trying to convert them into `isl_union_pw_multi_aff` and/or
> `isl_multi_union_pw_aff` but without much success... Or to be more precise,
> the conversion works (I would say it is easy), but the part when I have to
> get two objects, and then apply the schedule to them and take the
> difference is where I'm failing. ISL is quite intuitive, when I know what
> I'm doing, but currently that is not the case. So my question is, how do I
> get both sides? What type should a "side" be? (from there I hope I'll be
> able to figure out how to apply the schedule (map), take the difference and
> check lexicographical positivity).
>
> Assume a very simple case, e.g.:
> dependency: [N] -> { S_0[i, j] -> S_0[i' = 1 + i, j' = j] : 0 < i <=
> -2 + N and 0 <= j < N }
> schedule: [N] -> { S_0[i, j] -> [i, j] }
>
> (although I'm a bit confused why I got i' = 1 + i and not i' = i - 1, but
> maybe I'm mixing up the role of i and i', the code is this:
These dependences map dependees to dependers, perhaps you're expecting
them to go the other way.
>>> import isl
>>> s = isl.union_map("[N] -> { S_0[i, j] -> [i, j] }")
>>> d = isl.union_map("[N] -> { S_0[i, j] -> S_0[i' = 1 + i, j' = j] : 0 < i <= -2 + N and 0 <= j < N }")
>>> d.apply_domain(s).apply_range(s)
isl.union_map("[N] -> { [i0, i1] -> [1 + i0, i1] : 0 < i0 <= -2 + N and 0 <= i1 < N }")
>>> d.apply_domain(s).apply_range(s).deltas()
isl.union_set("[N] -> { [1, 0] : N >= 3 }")
skimo