Skip to content

Commit

Permalink
compiler: Drop unused shift_back
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioLuporini committed May 26, 2023
1 parent 354d814 commit 1227db9
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions devito/ir/support/utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from collections import defaultdict

from devito.symbolics import (CallFromPointer, retrieve_indexed, retrieve_terminals,
uxreplace)
from devito.symbolics import CallFromPointer, retrieve_indexed, retrieve_terminals
from devito.tools import DefaultOrderedDict, as_tuple, flatten, filter_sorted, split
from devito.types import (Dimension, DimensionTuple, Indirection, ModuloDimension,
StencilDimension)

__all__ = ['AccessMode', 'Stencil', 'IMask', 'detect_accesses', 'detect_io',
'pull_dims', 'shift_back', 'sdims_min', 'sdims_max']
'pull_dims', 'sdims_min', 'sdims_max']


class AccessMode(object):
Expand Down Expand Up @@ -270,26 +269,6 @@ def pull_dims(exprs, flag=True):
return dims


def shift_back(objects):
"""
Translate the Indexeds in a given collection of objects along all
Dimensions by the left-halo.
This is useful to create input for recursive compilation from pre-existing,
and therefore already lowered/indefixied, input.
"""
processed = []
for o in as_tuple(objects):
subs = {}
for i in retrieve_indexed(o):
subs[i] = i.subs({v: v - s.left
for v, s in zip(i.indices, i.function._size_halo)})

processed.append(uxreplace(o, subs))

return processed


# *** Utility functions for expressions that potentially contain StencilDimensions

def sdims_min(expr):
Expand Down

0 comments on commit 1227db9

Please sign in to comment.