'Copy device array to host.
Returns:
numpy.ndarray: A host numpy array'

def get(self, stream=None):

    if self.is_contiguous:
        ary = np.empty(self.shape, self.dtype)
        drv.memcpy_dtoh_async(ary, self.gpudata, stream)
    else:
        ary_d = self.backend.empty(self.shape, self.dtype)
        ary_d.copy(self)
        ary = np.empty(self.shape, self.dtype)
        drv.memcpy_dtoh_async(ary, ary_d.gpudata, stream)
    return ary
