Reputation: 13195
I understand that in 2d, images are cached in x and y directions.
But in 1d, why would you want to use an image? Is the memory used for images faster than memory used for buffers?
Upvotes: 0
Views: 728
Reputation: 1814
1D Image stays the image, so it has all advantages that Image has against Buffer. That is:
Though, you should remember that Image has some constraints in comparison to regular Buffer:
vloadN
/ vstoreN
operations, which can handle up to 16 values per call. Your best option is read_imageX
& write_imageX
functions, which can load / store up to 4 values per one call. That can be serious issue on GPU, with vector architecture.If we talk about GPU, different parts of hardware are involved into processing of Images & Buffers, so it's difficult to draw up, how one is better than another. Carefull benchmarking & algorithm optimizations are needed.
Upvotes: 3