Skip to content

Commit

Permalink
compiler: Fix issue where untouched data would be petrified upon rebu…
Browse files Browse the repository at this point in the history
…ilding
  • Loading branch information
EdCaunt committed Sep 13, 2024
1 parent 635e3f6 commit ff9b7a8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions devito/ir/equations/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,16 @@ def _(d, mapper, rebuilt, sregistry):
functions = rebuilt[d.functions]
except KeyError:
fkwargs.update({'name': sregistry.make_name(prefix=d.functions.name),
'function': None,
'allocator': DataReference(d.functions._data)})
'function': 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
# doing so will petrify the `_data` attribute as None.
if d.functions._data is not None:
fkwargs.update({'allocator': DataReference(d.functions._data)})

rebuilt[d.functions] = functions = d.functions._rebuild(**fkwargs)

kwargs['functions'] = functions

mapper[d] = d._rebuild(**kwargs)
mapper[d] = d._rebuild(**kwargs)

0 comments on commit ff9b7a8

Please sign in to comment.