Skip to content

[Bindless Images][Bug] Fixed bindless_images bugs with copy_extent #2689

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 1 commit into
base: SYCLomatic
Choose a base branch
from

Conversation

TejaX-Alaghari
Copy link
Contributor

This PR aims to update the bindless_image memory copies that are changed in the compiler on Jan31

@TejaX-Alaghari TejaX-Alaghari requested a review from a team as a code owner March 5, 2025 03:20
zhimingwang36 pushed a commit that referenced this pull request Mar 7, 2025
Mark OpenCL CPU known failing device more generally
@TejaX-Alaghari TejaX-Alaghari force-pushed the bug branch 2 times, most recently from 00033c1 to 8b196e1 Compare March 27, 2025 05:34
Copy link
Contributor

@przemektmalon przemektmalon left a comment

Choose a reason for hiding this comment

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

I'm not sure if one of the changes here is correct, as most of the functions are not documented properly as to the copy direction they intend to perform.

There are some bugs in the Bindless Images copy code. See intel/llvm#19093 for the fix to the way we pass pitch values to the SYCL backends. The above linked PR also includes changes to the Bindless Images specification, which was underspecified, in that the CopyExtent parameters require that each dimension of the CopyExtent is greater than or equal to 1.

Comment on lines +966 to 955
const auto copy_extend = sycl::range<3>(w / ele_size, h, 1);
return q.ext_oneapi_copy(src, src_offset, desc_src, dest, dest_offset,
dest_extend, copy_extend);
desc_src, p, copy_extend);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if this is correct, as there are no comments that describe what this function does (i.e. what the copy direction is).

If this is a (device) image_mem_handle src to (host) void *dest copy, then this should be:

return q.ext_oneapi_copy(src, src_offset, desc_src, dest, dest_offset,
                         dest_extend, copy_extend);

But, if this is a (device) image_mem_handle src to (device) void *dest copy, then it should be as it is in this PR (which changes the direction of this copy function).

@@ -949,9 +949,9 @@ dpct_memcpy(sycl::ext::oneapi::experimental::image_mem_handle src,
sycl::range<3>(w_offset_src / ele_size, h_offset_src, 0);
const auto dest_offset = sycl::range<3>(0, 0, 0);
const auto dest_extend = sycl::range<3>(p / ele_size, 0, 0);
const auto copy_extend = sycl::range<3>(w / ele_size, h, 0);
const auto copy_extend = sycl::range<3>(w / ele_size, h, 1);
return q.ext_oneapi_copy(src, src_offset, desc_src, dest, dest_offset,
Copy link
Contributor

Choose a reason for hiding this comment

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

If the API that coping to the device is different from copying to the host, we should judge the pointer and then choose the right way. Or add a parameter to show the difference.

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.

3 participants