Skip to content

Commit

Permalink
Check memoryview is C-contiguous
Browse files Browse the repository at this point in the history
The contiguous check allowed F-contiguous arrays through. However we
don't support F-contiguous arrays in the array interface case, so update
this check accordingly.
  • Loading branch information
jakirkham committed Aug 11, 2020
1 parent 84eedca commit 686ff3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ucp/_libs/utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ cpdef Py_ssize_t get_buffer_nbytes(buffer, check_min_size, bint cuda_support) ex
else:
mview = memoryview(buffer)
nbytes = mview.nbytes
if not mview.contiguous:
raise ValueError("buffer must be contiguous")
if not mview.c_contiguous:
raise ValueError("buffer must be C-contiguous")

if check_min_size is not None:
min_size = check_min_size
Expand Down

0 comments on commit 686ff3e

Please sign in to comment.