On Tue, 17 Jan 2012 16:55:22 -0500, Yifei Li <yifl...@gmail.com> wrote:
> Hi all,
> 
> I modified the example
> http://documen.tician.de/pycuda/tutorial.html#advanced-topics by removing
> the '__padding'  from the structure definition and got incorrect result.
> The kernel is launched with 2 blocks and one thread in each block.
> 
> Each thread prints the 'len' field in structure, which should be 3 for
> block 0 and 2 for block 1. However, the result I got is:
> 
> block 1: 2097664
> block 0: 3
> 
> No such problem if I write the following program using C.  Any help is
> appreciated.

It seems CUDA doesn't automatically align the pointer, without being
told to?

https://en.wikipedia.org/wiki/Data_structure_alignment

Andreas

Attachment: pgpJVXJeDyvjc.pgp
Description: PGP signature

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

Reply via email to