Skip to content
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 packages/tack-core/tests/test_array_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
DLPack; and to writing only its own rows.
"""

import ctypes
import gc

import numpy as np
Expand Down Expand Up @@ -146,6 +147,8 @@ def _same_view(a, b):
assert x.__array_interface__ == y.__array_interface__, k
elif hasattr(x, "ptr"): # Warp's array over the view's memory
assert (x.ptr, x.shape, x.dtype) == (y.ptr, y.shape, y.dtype), k
elif isinstance(x, ctypes.c_void_p): # Level Zero's pointer: ctypes compares by identity
assert type(y) is ctypes.c_void_p and x.value == y.value, k
elif k != "_view": # Metal's NumPy view of its memory
assert x == y or x is y, k

Expand Down
Loading