float3 array via pointer

I am trying to manage a float3 2D array with a pointer the desired strucktur looks like that

[codebox]global void float3func2d(float3 *a, float3 *b, float3 *out)

{

int i = threadIdx.x;

int j = threadIdx.y;

out[i][j]= a[i][j] do stuff with b[i][j];

}[/codebox]

or alternative like that if the idea above is not possible

[codebox]global void float3func(float3 *a, float3 *b, float3 *out)

{

int i = threadIdx.x;

out[i]= a[i] do stuff with b[i];

}[/codebox]

so far i was not able to get it working in the desired way, but i hope it is just a little thing I overlocked

and one more thing: I have to deal with images witch consist of float3 pixel. so far i do not see that advantage of using float3, you can simply put all the colourvalues in one big floatvector, and deal with them. you 3 times the thread number, but you are faster, or am i missing something?

float3 is a struct not an array. You should write

out[i].x= a[i].x # b[i].x;

out[i].y= a[i].y # b[i].y;

out[i].z= a[i].z # b[i].z;

Where # is a do-stuff operator :)

[quote name=‘PDan’ date=‘Jun 2 2009, 12:42 AM’ post=‘547637’]

float3 is a struct not an array.

thanks I know that, but i want to make an array that consists of serveral float3`s