Frage

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?

War es hilfreich?

Lösung 2

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.

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top