Hi Bogdan, all,

Bogdan Opanchuk <manti...@gmail.com> writes:
> Both in PyCUDA and PyOpenCL constructors of GPU arrays have
> ``strides`` keyword parameter, and you can create a non-contiguous
> array, e.g.:
>
>>>> import pyopencl as cl
>>>> from pyopencl.array import Array
>>>> import numpy
>>>> ctx = cl.create_some_context()
>>>> a = Array(ctx, (100,100), numpy.float32, strides=(512,4))
>>>> a.strides
> (512, 4)
>
> But you cannot get it back to CPU:
>
>>>> a.get()
> ...
> AssertionError: Array in get() must be contiguous
>
> And the size of the underlying buffer does not seem to correspond to
> the strides:
>
>>>> a.base_data.size
> 40000
>
> So, my question is: is it just that the specific feature of
> non-contiguous array support is missing at the moment, but in
> principle can be implemented, or there was an actual design decision
> of not supporting it at all? Or is it because the ``reorg`` fork of
> compyte seems to support it, and we are waiting for it to be merged?

I thought it was important that the data structure is able to represent
non-contiguous arrays, but they're not really supported at all by any of
the built-in operations. As you note, the plan is that in the medium
term bringing in the compyte array should fix this for many operations.

Andreas

Attachment: pgpJRv4Az7MFE.pgp
Description: PGP signature

_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to