Skip to content

Commit dba8b0b

Browse files
committed
Attempt using structured void dtypes for CuPy
1 parent 919be15 commit dba8b0b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/zarr/core/buffer/core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,9 @@ def all_equal(self, other: Any, equal_nan: bool = True) -> bool:
529529
and other == 0.0
530530
and self._data.dtype.kind not in ("U", "S", "T", "O", "V")
531531
):
532-
_data, other = np.broadcast_arrays(self._data, other)
533-
return np.array_equal(_data.view("V"), other.view("V"))
532+
_data, other = np.broadcast_arrays(self._data, np.asarray(other, self._data.dtype))
533+
void_dtype = "V" + str(_data.dtype.itemsize)
534+
return np.array_equal(_data.view(void_dtype), other.view(void_dtype))
534535
# use array_equal to obtain equal_nan=True functionality
535536
# Since fill-value is a scalar, isn't there a faster path than allocating a new array for fill value
536537
# every single time we have to write data?

0 commit comments

Comments
 (0)