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?
You should now get a warning if you try this. I didn't quite dare make this an error just yet, but it is now deprecated behavior and will go away in 2013.x. Andreas
pgpMQ3aTr05RR.pgp
Description: PGP signature
_______________________________________________ PyCUDA mailing list [email protected] http://lists.tiker.net/listinfo/pycuda
