Skip to content

Fix IMAGE1D and IMAGE1D_ARRAY image type deduction in addImage - #484

Open
bigmat18 wants to merge 1 commit into
intel:mainfrom
bigmat18:fix-image1D-type-deduction
Open

Fix IMAGE1D and IMAGE1D_ARRAY image type deduction in addImage#484
bigmat18 wants to merge 1 commit into
intel:mainfrom
bigmat18:fix-image1D-type-deduction

Conversation

@bigmat18

@bigmat18 bigmat18 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes: #481

Description of Changes

Instead of guessing the image type from its dimensions, the Intercept Layer should explicitly query the exact memory object type by adding one more API call alongside the existing clGetImageInfo queries.

We can retrieve the type using clGetMemObjectInfo with the CL_MEM_TYPE flag, matching the existing coding style:

cl_mem_object_type imageType;

errorCode |= dispatch().clGetMemObjectInfo(
    image,
    CL_MEM_TYPE,
    sizeof(imageType),
    &imageType,
    NULL );

This guarantees that CL_MEM_OBJECT_IMAGE1D (and its array counterpart) remains exactly what the application requested, immune to driver quirks.

Testing Done

Tested on Windows

@bashbaug bashbaug left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Have you checked that the example you described on the issue generates the correct metadata now?

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

Successfully merging this pull request may close these issues.

OBJECT_IMAGE1D and IMAGE1D_ARRAY are incorrectly classified as 2D

2 participants