cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

boxerab
Challenger

A few questions about images

What are the size limits of image memory on AMD cards?  I have an 8 MB image

that I would like to work with.

Also, suppose I want to do a YUV transform on an image.

Since images are read only or write only, is it faster to:

1) use single buffer in global memory

or

2) create two images, one source read only, and one destination write only, and do

YUV transform from source to destination

Also, can I convert a write only image to a read only image?

Thanks!

0 Likes
6 Replies
nou
Exemplar

8MB are fine. IIRC someone reported problems with allocating 1GB image.

you don't need "convert" image from read to write only. the restriction is on for single kernel invocation. you can use image as read in first invocation and as write in next. just to be sure that you mark image with proper flags during creation (CL_MEM_READ_ONLY, CL_WRITE_ONLY, CL_MEM_READ_WRITE).

0 Likes

THanks.  So, if I create two images with CL_MEM_READ_WRITE flag, then I can

1) run kernel 1, read from image1 and write to image 2

2) run kernel 2, read from image 2, and write to image1

Yes?

0 Likes

correct

0 Likes

Yes. A CL_MEM_READ_WRITE image can be read from or written to from a kernel but not both (in OpenCL 1.x; in OpenCL 2.x it is possible to do both).

Maximum device image size is available using CL_DEVICE_IMAGE2D_MAX_WIDTH & CL_DEVICE_IMAGE2D_MAX_HEIGHT. The OpenCL 1.1 specification says the minimum is 2K x 2K. Modern devices provide 4K, 8K, 16K or even 32K pixel width and/or tall images (but you'll likely run out of memory if you try both dimensions that large at once).

Since OpenCL doesn't have a YUV image type and YUV layout are frequently sub-sampled in chroma and/or have planar layouts, you'll likely need a Buffer (not an Image) to store them.

0 Likes

Thanks, guys. @dithermaster: there is no subsampling involved: this is the first step in jpeg 2000 compression:

RGB channels are converted to YUV. So, I should be able to use an image.

One twist: after RGB to YUV conversion, each channel is processed separately by subsequent kernels..

So, it looks like I need 4 images:

RGB read only

Y greyscale write only

U greyscale write only

V greyscale write only

The kernel will read (r,g,b) from the source image and store (y,u,v) to the three images respectively.

Next step is a wavelet transform, but each channel is transformed separately. So, my second kernel will treat

the three Y,U and V images as read only, and transform to another set of three images.

0 Likes
ahmed
Journeyman III

Hi,

Please, if there is someone help me to find BOOKS about (Image Processing) working with AMD Card and AMPC++ Library

Thank,

0 Likes