Wonderful, thanks!

On Wed, May 2, 2012 at 11:47 AM, Andreas Kloeckner
<[email protected]> wrote:
> On Fri, 27 Apr 2012 15:52:03 -0400, Lars Pastewka <[email protected]> wrote:
>> Hello Everybody,
>>
>> I ran into the following problem with PuCUDA. When I calling for example
>>
>> import pycuda.gpuarray as gpu
>> a = np.array([ [ 0, 1, 2 ], [ 1, 2, 3 ] ], dtype=np.float64)
>> a_gpu = gpu.to_gpu(np.transpose(a))
>>
>> a_gpu does not contain the transposed, but the original array.
>>
>> When looking into the numpy source I find that the transpose operation
>> just flips the FORTRAN flag. This can be easily checked:
>>
>> >>> a.flags.fortran
>> False
>> >>> b=np.transpose(a)
>> >>> b.flags.fortran
>> True
>> >>> c=np.transpose(b)
>> >>> c.flags.fortran
>> False
>> >>>
>>
>> GPUArray.set just copies the raw data. So if the FORTRAN flag is set,
>> the array on the GPU will end up transposed. Does anybody know an easy
>> fix for this behavior?
>
> That's a bug--.set() is missing checks for matching strides. I'll add
> that and let you know when it's done.
>
> Andreas
>
> --
> Andreas Kloeckner
> Room 1105A (Warren Weaver Hall), Courant Institute, NYU
> http://www.cims.nyu.edu/~kloeckner/
> +1-401-648-0599

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to