0
votes

I am trying to understand what the constant CL_DEVICE_IMAGE_MAX_BUFFER_SIZE means from an OpenCL device.

This page says that "Max number of pixels for a 1D image created from a buffer object.".

The value on my device is 2^24. However if I make an image from a buffer larger than 2^21 elements (channel_type is float, channel_order is R), reads become garbage-y.

1

1 Answers

0
votes

It means exactly what it says.

The value returned is implementation dependent, but in general it will look like this: Say you have X bytes as the maximum amount of system memory that you can allocate for a mem object. And say Y is the maximum value of bytes per pixel supported (This again depends on which all formats are supported). Then the value of the constant will in general be X/Y or lesser. For example, if your image format is CL_RGBA and CL_UNSIGNED_INT32, then the bytes per pixel is 16

Assuming you meant the image pixels are garbage when you said "reads become garbage", it is definitely not caused because of this constant. You seem to be within limits. Are you sure that the parent buffer has stored float pixels in CL_R channel order?