hi, i would like to optimize the code of my algorithm trying to use pointers.
in my code i have a cycle within which the calculation always an expression.

Code :
__kernel void cicle(__global uchar * in, __global float * out, int w, int h)
{
 
int x = get_global_id(0);
float pix = 0;
 
...
 
for (int i = 0; i< h; i++)
{
...
     pix = in[x+i*w];
...
}
 
...
 
}

how can I use pointers to not always calculate the expression in the for cycle?

Thank you