Bindless image desc match ur#21208
Conversation
…to properly populate the UR ur_image_desc_t.
There was a problem hiding this comment.
Pull request overview
This PR extends the SYCL bindless image image_descriptor so that layout-related fields (row pitch / slice pitch, plus num_samples) can be carried through to Unified Runtime (UR) ur_image_desc_t, enabling correct interop with externally-provided image memory that uses aligned/strided layouts.
Changes:
- Extend
sycl::ext::oneapi::experimental::image_descriptorwithrow_pitch,slice_pitch, andnum_samples, and thread these through UR descriptor construction. - Update bindless image UR-struct population to use descriptor-provided pitches (when an explicit
pitchargument is not provided). - Add unit tests and documentation updates covering the new descriptor fields.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sycl/unittests/Extensions/BindlessImages/ImageDescriptors.cpp | Adds UR-mock-based unit tests asserting descriptor layout fields arrive at UR. |
| sycl/unittests/Extensions/BindlessImages/CMakeLists.txt | Registers the new unit test source file. |
| sycl/source/handler.cpp | Updates UR image descriptor filling for bindless image copy command setup. |
| sycl/source/detail/image_impl.hpp | Adjusts checkImageDesc declaration (removes unused UserPtr parameter). |
| sycl/source/detail/image_impl.cpp | Adjusts checkImageDesc definition/call site and removes SYCL 1.2.1-era defensive checks. |
| sycl/source/detail/bindless_images.cpp | Propagates descriptor-provided row/slice pitch and num_samples into UR image descriptors. |
| sycl/include/sycl/ext/oneapi/bindless_images_descriptor.hpp | Adds layout fields to the public descriptor type and updates constructors accordingly. |
| sycl/doc/extensions/experimental/sycl_ext_oneapi_bindless_images.asciidoc | Documents the new descriptor fields/constructors. |
|
ping to reviewers. The L0 team needs this for their work on linear/DRM |
iclsrc
left a comment
There was a problem hiding this comment.
Round 3 follow-up review. The latest commits correctly address previous feedback: num_samples, row_pitch, and slice_pitch are now fully propagated through both the populate_ur_structs (bindless path) and fill_image_desc/fill_copy_args (handler path) routes. The "explicit pitch arg wins when non-zero" precedence rule is consistently implemented and the new unit tests cover the key propagation scenarios. The removal of redundant validations in checkImageDesc is safe because getImageDesc already guarantees those invariants before calling the checker. No Critical or Important issues found.
dyniols
left a comment
There was a problem hiding this comment.
@cperkinsintel Let me know if you add more changes. For now except few comments it looks good.
| image_type type{image_type::standard}; | ||
| unsigned int num_levels{1}; | ||
| unsigned int array_size{1}; | ||
| unsigned int num_samples{0}; |
There was a problem hiding this comment.
Wouldn't be more reasonable to make 1 as default value since single sample == 1?
There was a problem hiding this comment.
I think we should keep it at 0. That matches how its siblings ( row_pitch, slice_pitch etc behave). To my mind that clearly denotes "we aren't multi-sampling" and we can derive it if needed. Note that if we did change it, we'd also have to change constructor default values, including for constructors that someone might write in the future. Much safer to follow the initialize to zero norm.
| unsigned int num_levels{1}; // -- ur_image_desc_t::numMipLevel | ||
| unsigned int array_size{1}; // -- ur_image_desc_t::arraySize | ||
| unsigned int num_samples{0}; // -- ur_image_desc_t::numSamples | ||
| size_t row_pitch{0}; // -- ur_image_desc_t::rowPitch | ||
| size_t slice_pitch{0}; // -- ur_image_desc_t::slicePitch |
…fault pitch, else L0 will miss optimizations
The bindless image
image_descriptordoes not have pitch/slice. We need that to properly create aur_image_desc_t. Without it we'll never be able to support linear images that have aligned strides. There are also some older SYCL 1.2.1 defensive checks that will also block.Added a unit test that demonstrates that these values correctly arrive at the UR.
Here is the
ur_image_desc_tfrom ur_api.h in case anyone is wondering: