alexaverbuch

clCreateImage2D "Unimplemented"?

Discussion created by alexaverbuch on Sep 20, 2009
Latest reply on Oct 4, 2010 by MicahVillmow
Don't know how to load an image using OpenCL

Hi,

I'm just trying to load an image using clCreateImage2D but I keep getting the following error when I call this function:

/home/ayouhas/opencl/opencl/runtime/src/api/cl_memobj.cpp:585: Unimplemented()

Abort

The directory above, "ayouhas", doesn't even actually exist on my system (Ubuntu 9.04), which makes it even more confusing.

I know the image is there because I can load it using the OpenCV library.

It would be great if someone could inspect the attached code sample and provide any suggestions to help me get this working.

Cheers,

Alex

cl_int status = 0; cl_int error; cl_context context = clCreateContextFromType(0, CL_DEVICE_TYPE_DEFAULT, NULL, NULL, &status); void* image = fopen("test_image.bmp","rb"); size_t width = //ASSIGN WIDTH HERE size_t height = //ASSIGN HEIGHT HERE size_t rowpitch = 0; cl_image_format format; format.image_channel_order = CL_RGBA; format.image_channel_data_type = CL_UNSIGNED_INT8; cl_mem_flags flags; flags = CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR; cl_mem myClImage = clCreateImage2D( context, // a valid OpenCL context flags, // option flags [1] &format, // image format properties [2] width, // width of the image in pixels height, // height of the image in pixels rowpitch, // scan-line pitch in bytes [3] image, // pointer to the image data &error // on return, the result code );

Outcomes