Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data: Prevent allocator info to be lost at finalize #2295

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading