Skip to content

[E2E][BINDLESS] Add ptr to ptr of image_handle test failing on level zero only #18721

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

Open
wants to merge 4 commits into
base: sycl
Choose a base branch
from

Conversation

JackAKirk
Copy link
Contributor

This test passes on the cuda backend but fails on level_zero. It allocates a single element array of unsampled_image_handle*, pointing to a valid unsampled_image_handle that is dereferenced on the device. The casting to generic void* is not necessary to make the test fail on l0, but is done to keep this test matching the original bug report we received.

Note that rewriting this test to make an identical dereference with for example a single 2d C array of long passes on level_zero, indicating that this issue is specific to image_handles.

@JackAKirk JackAKirk requested a review from a team as a code owner May 29, 2025 09:17
Signed-off-by: JackAKirk <[email protected]>
Copy link
Contributor

@ProGTX ProGTX left a comment

Choose a reason for hiding this comment

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

I think the code makes sense, but it's difficult to understand what's going on, I've made some suggestions to help the reader. So if it's passing on CUDA but failing on L0 it might be an issue with either the L0 driver or with IGC.

}

// Image descriptor - can use the same for both images
sycl::ext::oneapi::experimental::image_descriptor desc(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to use the syclexp namespace alias everywhere instead of specifying the full namespace, to make the code clearer

Suggested change
sycl::ext::oneapi::experimental::image_descriptor desc(
syclexp::image_descriptor desc(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks

sycl::ext::oneapi::experimental::unsampled_image_handle imgOut =
sycl::ext::oneapi::experimental::create_image(imgMemoryOut, desc, q);

void *imageHandlePtrGen = static_cast<void *>(sycl::malloc_device(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
void *imageHandlePtrGen = static_cast<void *>(sycl::malloc_device(
void *imageHandlePtrGen = sycl::malloc_device(

It's OK if we deviate from the original bug report a bit to make the test clearer, in this case malloc_device returns void* anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks


void *imageHandlePtrGen = static_cast<void *>(sycl::malloc_device(
sizeof(sycl::ext::oneapi::experimental::unsampled_image_handle), q));
q.memcpy(static_cast<void *>(imageHandlePtrGen),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be good to add a short comment to each copy about what it's supposed to be doing. In this case we're copying the image handle from the host to an image handle on device. But it gets more complicated with the copies below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks

Signed-off-by: JackAKirk <[email protected]>
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.

2 participants