Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to using clCreateImage to create a miapmap image? #1182

Open
xxxxxxLD opened this issue Jun 14, 2024 · 1 comment
Open

How to using clCreateImage to create a miapmap image? #1182

xxxxxxLD opened this issue Jun 14, 2024 · 1 comment

Comments

@xxxxxxLD
Copy link

xxxxxxLD commented Jun 14, 2024

I'm trying to use clCreateImage to create a mipmap image, but returns CL_INVALID_IMAGE_DESCRIPTOR . Here is my code:

cl_image_desc clImageIn;
memset(&clImageIn, 0, sizeof(cl_image_desc));
clImageIn.image_type = CL_MEM_OBJECT_IMAGE2D;
clImageIn.image_width = 1920;
clImageIn.image_height = 1080;
clImageIn.num_mip_levels = 2;

cl_image_format clImageFormat;
clImageFormat.image_channel_order = CL_R;
clImageFormat.image_channel_data_type = CL_UNORM_INT8;

int ret;
cl_mem image = clCreateImage(context, CL_READ_ONLY, &clImageFormat, &clImageIn, NULL, ret);

and the ret also returns -65, is there something wrong?
Btw, I find mali-G57 cannot support OPENCL EXTENSION of cl_khr_mipmap_image ,is that true?

@bashbaug
Copy link
Contributor

Can you please include the device you're running on? Are you sure your device supports cl_khr_mipmap_image?

FWIW I tried your example on an Intel GPU that supports cl_khr_mipmap_image and it worked fine for me, with a few small corrections to the last line:

cl_mem image = clCreateImage(context, CL_MEM_READ_ONLY, &clImageFormat, &clImageIn, NULL, &ret);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants