Hi Giuseppe,
It seems that the problem is in these lines:
w, h = src.shape
result = gpuarray.empty((h, w), dtype=src.dtype, order='C')
The order of numpy arrays is row-major, so you should write instead:
h, w = src.shape
result = gpuarray.empty((w, h), dtype=src.dtype, order='C')
(that's why it worked correctly with w == h).
On Fri, Feb 22, 2013 at 9:29 PM, Giuseppe Tabbi <[email protected]> wrote:
> Hello members,
>
> I adapted the SDK diagonal transpose example and I want to transpose a
> 2776x2080 matrix. However I do not get the right transpose matrix. The
> output is:
>
> A
> shape: (2776, 2080)
> [[ 0 0 0 ..., 0 0 0]
> [ 1 1 1 ..., 1 1 1]
> [ 2 2 2 ..., 2 2 2]
> ...,
> [2773 2773 2773 ..., 2773 2773 2773]
> [2774 2774 2774 ..., 2774 2774 2774]
> [2775 2775 2775 ..., 2775 2775 2775]]
> --------------------------------------------------------------------------------
> A.T
> shape: (2080, 2776)
> [[ 0 1 2 ..., 924 926 927]
> [ 928 930 931 ..., 1853 1855 1856]
> [1857 1859 1860 ..., 6 8 9]
> ...,
> [2766 2767 2769 ..., 915 916 918]
> [ 919 920 922 ..., 1844 1845 1847]
> [1848 1849 1851 ..., 2773 2774 2775]]
> --------------------------------------------------------------------------------
>
> Did I miss something? What is wrong in my code?
> If I transpose 2776x2776 or 2080x2080 matrices everything is fine.
>
> Best regards,
> Giuseppe
>
>
>
> ------------------------------------------------------------------------------------------------
> ------------------------------------------------------------------------------------------------
> Forschungszentrum Juelich GmbH
> 52425 Juelich
> Sitz der Gesellschaft: Juelich
> Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
> Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
> Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
> Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
> Prof. Dr. Sebastian M. Schmidt
> ------------------------------------------------------------------------------------------------
> ------------------------------------------------------------------------------------------------
>
> _______________________________________________
> PyCUDA mailing list
> [email protected]
> http://lists.tiker.net/listinfo/pycuda
>
_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda