Struct Alignment With Pyopencl
update: the int4 in my kernel was wrong. I am using pyopencl but am unable to get struct alignment to work correctly. In the code below, which calls the kernel twice, the b value
Solution 1:
In the OpenCL program, try the packed attribute on the struct itself, instead of one of the members:
typedefstructs {
int4 f0;
int4 f1;
} __attribute__((packed)) s;
It might be that because you only had the packed
attribute on a single member of the struct, it might not have been packing the entire structure.
Solution 2:
ok, i don't know where i got int4
from - i think it must be an intel extension. switching to AMD with int
as the kernel type works as expected. i'll post more at http://acooke.org/cute/Somesimple0.html once i have cleaned things up.
Post a Comment for "Struct Alignment With Pyopencl"