I know CUDA but I’m new in OpenCL and I have a small question for you.
I have an array
unsigned char * my_array
representing in fact a 2D array of size W*H.
I want to interpolate this array.
Let me use the following notation:
my_array[r][c] = my_array[r*W+c]
What I want to do is to access in my kernel to my_array[r][c] where r and c are not integer.
So far, my kernel gets the value of the 4 neighbors and scale the values (linear interpolation).
But I think this is absolutely not optimal (bank conflict, non coalesced reads).
In CUDA, you just need to put your array in a CUDA texture.
If you ask then in your kernel to access the value on not integer indexes, CUDA will automatically linearly interpolate the array.
I want to do the same in OpenCL. Is there a way of doing it? Are the “image2d_t” the correct object to do?
Can you please help me on this?