constant sampler_t sampler = CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_MIRRORED_REPEAT | CLK_FILTER_NEAREST;
int4 temp = (int4)(0,0,0,0);
( read_imagei(idata, sampler, (float2)(0, temp)) + temp) >> 1;
The error is passing in an int4 object instead of a float.