opencl - What is the advantage of using a 1d image over a 1d buffer? -
I understand that in 2D, the images are cached in the X and Y instructions.
But in 1d, why do you want to use an image? What is the memory used for images compared to the memory used for buffers?
1D image image stays, so the image against buffer has all the advantages of this:
- Image IO operations are usually well-cached.
- Sampling can be used, which gives hardware such as computational cheap interpolation, access, etc.
However, you should remember that there are some constraints in comparison to the regular buffer in the image:
- Single image to either read or use Can be written in a kernel.
- You can not use the
vloadN
/vstoreN
functions, which is able to handle up to 16 values per call. Your best choice isread_imageX
& amp;write_imageX
function, which can load / store 4 values per call. Can be serious issue on GPU with vector architecture. - If you are not using a 4-component format, usually, you are losing part of the display, because many tasks processed from colorful planes simultaneously, therefore the payload is decreasing.
If we talk about the GPU, different parts of the hardware are involved in the processing of images; Buffer, so it is difficult to draw, how does one better than the other; Benchmarking & amp; Algorithm requires customization.
Comments
Post a Comment