OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1719 Discussions

clCreateImage2D() always returns -10 (CL_IMAGE_FORMAT_NOT_SUPPORTED)

javedrabbani
Beginner
1,699 Views
Hi All,

I have used clCreateBuffer() with success but when I try to use clCreateImage2D(), it always returns -10 (CL_IMAGE_FORMAT_NOT_SUPPORTED). It appears to me that IMAGES are not supported yet by Intel OpenCL SDK 1.5, only BUFFERS are?

I have tried with different formats, but to no avail. I have gone through the Intel SDK 1.5 Release Notes and there is no such mention about clCreateImage2D() being unsupported.

By the way, none of the SDK samples seem to use clCreateImage2D() either!
Thanks.

- Javed Rabbani
0 Kudos
6 Replies
Jim_Vaughn
Beginner
1,699 Views
Can you post code to reproduce the issue? While I have some other issues with interop I am able to create some image fine and I get a CL_SUCCESS. I just reconfirmed by recreating a 8bit unsigned int CL_RGBA image.
0 Kudos
javedrabbani
Beginner
1,699 Views

If I create CL_RGBA image with CL_UNSIGNED_INT8 / INT16 / INT32 or even CL_FLOAT data type, it succeeds. However, if I repeat the same with channel order CL_RGB or CL_R, it fails all together. It appears that not all channel orders are supported. My image dimensions are 600 x 400 (w x h).

0 Kudos
Jim_Vaughn
Beginner
1,699 Views

You are correct as I was able to reproduce this error when using CL_R and CL_RGB, CL_LUMINANCE, and I think almost every format except CL_RGBA. This may be the cause of a number of problems I had getting my code ported to Intel's OpenCL implementation.

0 Kudos
Boaz_O_Intel
Employee
1,699 Views
Hi,

Our OpenCL implementation supports the minimal set described in the OpenCL specification.
The formats stated in this post are not supported by our implementation

clGetSupportedImageFormats() APIcan be used to get the list of image formats supported by an OpenCL implementation.

Thanks,
Boaz
0 Kudos
Jim_Vaughn
Beginner
1,699 Views
Hi Boaz,

Your implementation reports that is supports interop extension (which doesn't seem to work when executing kernelsfor me and someone there mentioned you reproduced the issue on another thread) which requires considerably more images to be implemented as long as the corresponding texture is loaded correctly in OpenGL.Those combinations are the ones below:

CL_RGBA, CL_UNORM_INT8

CL_BGRA, CL_UNORM_INT8
CL_RGBA, CL_UNORM_INT8
CL_BGRA, CL_UNORM_INT8
CL_RGBA, CL_UNORM_INT16
CL_RGBA, CL_SIGNED_INT8
CL_RGBA, CL_SIGNED_INT16
CL_RGBA, CL_SIGNED_INT32
CL_RGBA, CL_UNSIGNED_INT8
CL_RGBA, CL_UNSIGNED_INT16
CL_RGBA, CL_UNSIGNED_INT32
CL_RGBA, CL_HALF_FLOAT
CL_RGBA, CL_FLOAT

0 Kudos
javedrabbani
Beginner
1,699 Views
Hi,

The clGetSupportedImageFormats() returns following 13 supported formats, out of which 10 are CL_RGBA, 1 each is CL_BGRA, CL_LUMINANCE, CL_INTENSITY:


Format [0] = CL_RGBA / CL_UNORM_INT8
Format [1] = CL_RGBA / CL_UNORM_INT16
Format [2] = CL_RGBA / CL_SIGNED_INT8
Format [3] = CL_RGBA / CL_SIGNED_INT16
Format [4] = CL_RGBA / CL_SIGNED_INT32
Format [5] = CL_RGBA / CL_UNSIGNED_INT8
Format [6] = CL_RGBA / CL_UNSIGNED_INT16
Format [7] = CL_RGBA / CL_UNSIGNED_INT32
Format [8] = CL_RGBA / CL_HALF_FLOAT
Format [9] = CL_RGBA / CL_FLOAT
Format [10] = CL_BGRA / CL_UNORM_INT8
Format [11] = CL_INTENSITY / CL_FLOAT
Format [12] = CL_LUMINANCE / CL_FLOAT

I guess, it would be helpful if thisinformation is documented within the release notes as it is most likely that someone will look to use CL_RGB first up if he/she is coming from an image processingbackground.

Also, the Intel SDK 1.5 samples should include at least one sample of using Image2D memory objects alongside Buffers. If Image3Dusage is demonstrated as well, that will be more than useful.

I think Image Convolution can be a perfect starting pointdemonstrating Image2D usage. "Heterogeneous Computing using OpenCL" lastest book uses that example to teach Image2D usage in chapter 4.

Thanks.

- Javed
0 Kudos
Reply