gt4py.cartesian.gtc.dace.passes package

Submodules

gt4py.cartesian.gtc.dace.passes.push_vertical_map_down module

class gt4py.cartesian.gtc.dace.passes.push_vertical_map_down.PushVerticalMapDown(*, forscope_only: bool = False)[source]

Bases: ScheduleNodeVisitor

Given a schedule tree with K-JI loops, push the K-loop down into the JI-loops to achieve a loop structure suitable for a “K-first” memory layout, or a layout where K is the highest value in the layout_map.

Expected input is something like

// vertical loop outside for k …

// horizontal loop(s) inside for j,i …

// computation here (1)

for j,i …

// computation here (2)

Given such a loop structure, this pass will push down the vertical loop into the horizontal loops. In the above example, the expected output is

// horizontal loop(s) outside for j,i …

for k …

// computation here (1)

for j,i …
for k …

// computation here (2)

_push_K_loop_in_IJ(node: MapScope | ForScope)[source]
visit_ForScope(node: ForScope)[source]
visit_MapScope(node: MapScope)[source]

gt4py.cartesian.gtc.dace.passes.swap_horizontal_maps module

class gt4py.cartesian.gtc.dace.passes.swap_horizontal_maps.SwapHorizontalMaps[source]

Bases: ScheduleNodeVisitor

Given a schedule tree with K-JI loops, swap the IJ for a K-IJ loop.

Expected input is something like

// horizontal loop - potentially nested map __j, __i in [0:J, 0:I]

// computation here

Expected output swaps the indices & range

// horizontal loop - potentially nested map __i, __j in [0:I, 0:J]

// computation here

visit_MapScope(node: MapScope) → None[source]

gt4py.cartesian.gtc.dace.passes.utils module

gt4py.cartesian.gtc.dace.passes.utils.list_index(collection: list[ScheduleTreeNode], node: ScheduleTreeNode) → int[source]

Get the index of node in collection with is operator. Raises StopIteration if not found.

Comparing with the is operator ensures memory comparison. The function list.index() uses value comparison and might thus yield different results.

Module contents

class gt4py.cartesian.gtc.dace.passes.PushVerticalMapDown(*, forscope_only: bool = False)[source]

Bases: ScheduleNodeVisitor

Given a schedule tree with K-JI loops, push the K-loop down into the JI-loops to achieve a loop structure suitable for a “K-first” memory layout, or a layout where K is the highest value in the layout_map.

Expected input is something like

// vertical loop outside for k …

// horizontal loop(s) inside for j,i …

// computation here (1)

for j,i …

// computation here (2)

Given such a loop structure, this pass will push down the vertical loop into the horizontal loops. In the above example, the expected output is

// horizontal loop(s) outside for j,i …

for k …

// computation here (1)

for j,i …
for k …

// computation here (2)

_push_K_loop_in_IJ(node: MapScope | ForScope)[source]
visit_ForScope(node: ForScope)[source]
visit_MapScope(node: MapScope)[source]
class gt4py.cartesian.gtc.dace.passes.SwapHorizontalMaps[source]

Bases: ScheduleNodeVisitor

Given a schedule tree with K-JI loops, swap the IJ for a K-IJ loop.

Expected input is something like

// horizontal loop - potentially nested map __j, __i in [0:J, 0:I]

// computation here

Expected output swaps the indices & range

// horizontal loop - potentially nested map __i, __j in [0:I, 0:J]

// computation here

visit_MapScope(node: MapScope) → None[source]