Take the 2-minute tour ×

I need to do some operations on a matrix of values that take at most one byte (values form 0 to 20 most likely). Since the matrix is rather large I figured I'd do these operations on the GPU using OpenCL and storing the matrix as an image. The thing is that I failed to find any hints to whether OpenCL has support for single channel images... and I wouldn't want to pass around more data than I actually use.

Is there any support for single channel images?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

As mentioned in the Previous Answer use CL_INTENSITY and CL_LUMINANCE.

It is expected that the latency of addressing calculations is hidden better for Image objects, but texture cache is not kept coherent with respect to image writes, so any image read to an address that has been written to via an image write in the same kernel call returns undefined data.So developers prefer to use regular buffers only.

share|improve this answer
Since not even the asker upvoted your post, I did. –  Dudeson Mar 20 '13 at 10:17
add comment

There is CL_INTENSITY and CL_LUMINANCE. But if you don't need image related functions (as I would assume if you want to manipulate matrices) you are better off with a regular memory buffer.

share|improve this answer
OP didn't specify what he's doing with the data. Moreover, caching assumptions depend on the actual hardware and are not required by the specification. And if available, accesses to global memory can be cached via local shared memory. –  matthias Mar 19 '13 at 8:59
maybe you can answer this question then stackoverflow.com/questions/15322206/… –  user2088790 Mar 19 '13 at 9:18
add comment

Your Answer


