Trying to do something weird in a kernel Programming

Hi everyone,

At this point, I have to do something in a kernel, here’s how it is:

int col = blockIdx.x*blockDim.x+threadIdx.x;
int fila = blockIdx.y*blockDim.y+threadIdx.y;

idata_remap[ iYcoord[ filawidth+col ]width + iXcoord[ filawidth+col ] ].x =
idata_remap[ iYcoord[ fila
width+col ]width + iXcoord[ filawidth+col ] ] ].x + ( x1y1[ fila*width+col ]idata[ filawidth+col ].x );

where iYcoord, iXcoord, x1y1 and idata are arrays with some data. what I need to do is to allocate data in a position of the idata_remap array depending on the data who is stored in the arrays iYcoord and iXcoord.
Obviously, this code doesn’t compile, it generates errors… Does anybody know a way to do this???

Thanks.

Remove the extra closing bracket?

Remove the extra closing bracket?

And remove the needless repetition for better readability?

sm like idata_remap[ iYcoord[ filawidth+col ]width + iXcoord[ filawidth+col ] ].x += x1y1[ filawidth+col ]idata[ filawidth+col ].x ;

And remove the needless repetition for better readability?

sm like idata_remap[ iYcoord[ filawidth+col ]width + iXcoord[ filawidth+col ] ].x += x1y1[ filawidth+col ]idata[ filawidth+col ].x ;

Thanks for the answers… what I did was convert iYCoord and IXCoord into a variable…

Thanks for the answers… what I did was convert iYCoord and IXCoord into a variable…