Skip to content

Bindless image desc match ur#21208

Open
cperkinsintel wants to merge 15 commits into
intel:syclfrom
cperkinsintel:bindless-image_desc-match-ur
Open

Bindless image desc match ur#21208
cperkinsintel wants to merge 15 commits into
intel:syclfrom
cperkinsintel:bindless-image_desc-match-ur

Conversation

@cperkinsintel

Copy link
Copy Markdown
Contributor

The bindless image image_descriptor does not have pitch/slice. We need that to properly create a ur_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_t from ur_api.h in case anyone is wondering:

typedef struct ur_image_desc_t {
  /// [in] type of this structure, must be ::UR_STRUCTURE_TYPE_IMAGE_DESC
  ur_structure_type_t stype;
  /// [in][optional] pointer to extension-specific structure
  const void *pNext;
  /// [in][nocheck] memory object type
  ur_mem_type_t type;
  /// [in] image width
  size_t width;
  /// [in] image height
  size_t height;
  /// [in] image depth
  size_t depth;
  /// [in] image array size
  size_t arraySize;
  /// [in] image row pitch
  size_t rowPitch;
  /// [in] image slice pitch
  size_t slicePitch;
  /// [in] number of MIP levels, must be `0`
  uint32_t numMipLevel;
  /// [in] number of samples, must be `0`
  uint32_t numSamples;

} ur_image_desc_t;

@cperkinsintel
cperkinsintel marked this pull request as ready for review June 30, 2026 00:26
@cperkinsintel
cperkinsintel requested a review from Copilot June 30, 2026 17:57

Copilot AI 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.

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_descriptor with row_pitch, slice_pitch, and num_samples, and thread these through UR descriptor construction.
  • Update bindless image UR-struct population to use descriptor-provided pitches (when an explicit pitch argument 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.

Comment thread sycl/doc/extensions/experimental/sycl_ext_oneapi_bindless_images.asciidoc Outdated
Comment thread sycl/source/handler.cpp
@cperkinsintel

Copy link
Copy Markdown
Contributor Author

ping to reviewers. The L0 team needs this for their work on linear/DRM

Copilot AI 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.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Comment thread sycl/source/handler.cpp
Comment thread sycl/unittests/Extensions/BindlessImages/ImageDescriptors.cpp

@iclsrc iclsrc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@cperkinsintel
cperkinsintel marked this pull request as draft July 14, 2026 20:36

@dyniols dyniols 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.

@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};

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.

Wouldn't be more reasonable to make 1 as default value since single sample == 1?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread sycl/include/sycl/ext/oneapi/bindless_images_descriptor.hpp
Comment thread sycl/unittests/Extensions/BindlessImages/ImageDescriptors.cpp Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Comment thread sycl/unittests/Extensions/BindlessImages/ImageDescriptors.cpp
Comment on lines +61 to +65
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
@cperkinsintel
cperkinsintel marked this pull request as ready for review July 23, 2026 00:32
@cperkinsintel
cperkinsintel requested review from a team as code owners July 23, 2026 00:32
@cperkinsintel
cperkinsintel requested a review from enm-intel July 23, 2026 00:32
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.

6 participants