Skip to content

WIP: Iname sets in loop priorities

Don't add any NEW discussions here (old discussions will still be continued), this merge request will be split into multiple smaller merge requests that can be discussed individually

REQUIRES linearization checker branch (merged with this branch).

Allow user to describe loop prioritization using (negatively defined) sets of inames. E.g.,

knl = lp.make_kernel(
        "{ [g,h,i,j,k]: 0<=g,h,i,j,k<n }",
        "out[g,h,i,j,k] = 2*a[g,h,i,j,k]",
        assumptions="n >= 1",
        )
knl = lp.prioritize_loops(ref_knl, ("k", "~{g,h,k}", "{g,h}"))
print(knl.loop_priority)

output:

frozenset({('k', 'i', 'g'), ('k', 'i', 'h'), ('k', 'j', 'g'), ('k', 'j', 'h')})

More examples in test/test_loopy.py and examples/python/prioritize_loops.py.

Edited by James Stevens

Merge request reports

Loading