Hello,

I need to read value from one of two images, like that:
Code :
for (i = 1; i < N; i++)
{
p = foo(i);
if (cond)
  v = read_image_f(a, sampler, p);
else
  v = read_image_f(b, sampler, p);
}

I would like to optimize the branch to be outside the loop:

Code :
image_2d_t* im = cond ? a : b;
for (i = 1; i < N; i++)
{
  p = foo(i);
  v = read_image_f(*im, sampler, p);
}

But OpenCL does not allow pointers to image2d_t.

Any workaround for this?