Using a pointer/image in a struct, array of images

Discussion created by bubu on Jan 26, 2011
Latest reply on Jan 28, 2011 by LeeHowes

Is this code legal?

How can I pass an image handle to a struct? How can I pass an array of images as kernel argument?





typedef struct tMyStruct { float a, b, c, d; const __global float *buf; __read_only image2d_t img; int e, f, g; } MyStruct; __kernel void MyKernel ( const __constant MyStruct *c ) { .... read a value from c->img and c->buf... } __kernel void MyKernel2 ( __read_only image2d_t *imgs ) { .... read a value from imgs[x] ... }