Skip to content

Commit

Permalink
data: prevent allocator info to be lost at finalize
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jan 13, 2024
1 parent d8ca72f commit d57cd7b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions devito/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def __array_finalize__(self, obj):
self._is_distributed = False
self._modulo = tuple(False for i in range(self.ndim))
self._decomposition = (None,)*self.ndim
self._allocator = ALLOC_ALIGNED
elif obj._index_stash is not None:
# From `__getitem__`
self._is_distributed = obj._is_distributed
Expand All @@ -125,9 +126,11 @@ def __array_finalize__(self, obj):
else:
decomposition.append(dec.reshape(i))
self._decomposition = tuple(decomposition)
self._allocator = obj._allocator
else:
self._is_distributed = obj._is_distributed
self._distributor = obj._distributor
self._allocator = obj._allocator
if self.ndim == obj.ndim:
# E.g., from a ufunc, such as `np.add`
self._modulo = obj._modulo
Expand Down

0 comments on commit d57cd7b

Please sign in to comment.