Skip to content

Loop priorities minilanguage

We're looking to deprecate the ilp iname tag and break it into its constituent pieces:

  1. force loop "innermost" (but: still allowing multiple such "innermost" loops)
  2. privatize temporaries
  3. (Optionally) unroll

This issue is about generalizing what goes into LoopKernel.loop_priorities to allow it to handle point 1 above.

Current broken suggestions:

Matt
("h", "i", "{j,k}$")
("h", "i", "{j,k}", "$")
12:24
("{j,k}", "$")
[("{j,k}", "$")], [("j", "$"), ("k", "$)]
("{j,k}","{j,k}", "$")

Other options:

  • Sets with negations, e.g.,
    >>> knl = lp.prioritize_loops(ref_knl, ("k", "~{g,h,k}", "{g,h}"))
    >>> print(knl.loop_priority)
    frozenset({('k', 'i', 'g'), ('k', 'i', 'h'), ('k', 'j', 'g'), ('k', 'j', 'h')})
  • Code, i.e., describe the rules for nesting with an expression that can be evaluated
  • Don't encode "innermost"
  • Hack an immediate "innermost" predicate (don't try to be fancy and thorough, just make an easy way to specify that a particular iname or set of inames should not be nested outside anyone else)

cc @jdsteve2 @mattwala

x-ref: !341 #156

Edited by Andreas Klöckner