Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions pykokkos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def cleanup():
view.array = None
if hasattr(view, "data"):
view.data = None
if hasattr(view, "xp_array"):
view.xp_array = None
except (ReferenceError, AttributeError):
pass

Expand Down
7 changes: 7 additions & 0 deletions pykokkos/interface/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,13 @@ def __init__(
self.ndim = self.data.ndim
self.size = self.data.size

try:
from pykokkos import _view_registry

_view_registry.add(self)
except (ImportError, AttributeError):
pass
Comment on lines +635 to +636
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question, why would get ImportError or AttributeError here?


def _create_slice(self, data_slice: Union[slice, Tuple]) -> List[Union[int, slice]]:
"""
Transforms the slice into a list, removing all None values for start and stop
Expand Down
Loading