Avoid temp buffer if strides match in cupy_array[:] = numpy_array copy
@@ -1187,6 +1187,9 @@ cdef class ndarray:
isinstance(value, numpy.ndarray)):
if (self.dtype == value.dtype and
self.shape == value.shape):
+ if self.strides == value.strides:
+ ptr = ctypes.c_void_p(value.__array_interface__['data'][0])
+ else:
order = 'F' if self.flags.f_contiguous else 'C'
tmp = value.ravel(order)
ptr = ctypes.c_void_p(tmp.__array_interface__['data'][0])
