Skip to content

Commit

Permalink
misc: Respond to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
EdCaunt committed Sep 26, 2024
1 parent 1297db1 commit c989bc0
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions devito/ir/equations/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def concretize_subdims(exprs, **kwargs):
dimensions = tuple(mapper.get(d, d) for d in f.dimensions)
if dimensions != f.dimensions:
# A dimension has been rebuilt, so build a mapper for Indexed
mapper[f.indexed] = f._rebuild(dimensions=dimensions, function=None).indexed
mapper[f.indexed] = f._rebuild(dimensions=dimensions).indexed

processed = [uxreplace(e, mapper) for e in exprs]

Expand Down Expand Up @@ -213,9 +213,8 @@ def _(d, mapper, rebuilt, sregistry):
# Already have a substitution for this dimension
return

tkns = [tkn._rebuild(name=sregistry.make_name(prefix=tkn.name))
for tkn in d.tkns]
tkns_subs = {tkn0: tkn1 for tkn0, tkn1 in zip(d.tkns, tkns)}
tkns_subs = {tkn: tkn._rebuild(name=sregistry.make_name(prefix=tkn.name))
for tkn in d.tkns}
left, right = [mM.subs(tkns_subs) for mM in (d.symbolic_min, d.symbolic_max)]
thickness = tuple((v, d._thickness_map[k]) for k, v in tkns_subs.items())

Expand Down Expand Up @@ -272,9 +271,7 @@ def _(d, mapper, rebuilt, sregistry):
rebuilt[idim0] = idim1 = idim0._rebuild(name=iname)

kwargs['implicit_dimension'] = idim1
fkwargs.update({'dimensions': (idim1,) + d.functions.dimensions[1:],
'halo': None,
'padding': None})
fkwargs['dimensions'] = (idim1,) + d.functions.dimensions[1:]

if d.functions in rebuilt:
functions = rebuilt[d.functions]
Expand All @@ -284,10 +281,12 @@ def _(d, mapper, rebuilt, sregistry):
# Warn the user if name has been changed, since this will affect overrides
if fname != d.functions.name:
fkwargs['name'] = fname
warning("%s <%s> renamed as '%s'" %
(str(d.functions), id(d.functions), fname))
warning("%s <%s> renamed as '%s'. Consider assigning a unique name to %s." %
(str(d.functions), id(d.functions), fname, d.functions.name))

fkwargs['function'] = None
fkwargs.update({'function': None,
'halo': None,
'padding': None})

# Data in MultiSubDimension function may not have been touched at this point,
# in which case do not use an allocator, as there is nothing to allocate, and
Expand Down

0 comments on commit c989bc0

Please sign in to comment.