Skip to content

Add support for specialization constants#2304

Draft
ndgrigorian wants to merge 5 commits intorename-sycl-program-sycl-kernel-bundlefrom
feature/specialization-constants
Draft

Add support for specialization constants#2304
ndgrigorian wants to merge 5 commits intorename-sycl-program-sycl-kernel-bundlefrom
feature/specialization-constants

Conversation

@ndgrigorian
Copy link
Copy Markdown
Collaborator

This PR introduces support for specialization constants in dpctl, including both a Cython class SpecializationConstant for construction and passing of the constructed class to create_kernel_bundle_from_spirv via a new specializations keyword argument.

The SpecializationConstant class supports multiple constructors, including from Python buffers, a dtype string and a Python buffer (casting to the dtype via NumPy), and a number of bytes and a pointer as integers.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

@ndgrigorian ndgrigorian changed the title Feature/specialization constants Add support for specialization constants Apr 28, 2026
@github-actions
Copy link
Copy Markdown

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Apr 28, 2026

Coverage Status

Coverage is 75.042%feature/specialization-constants into rename-sycl-program-sycl-kernel-bundle. No base build found for rename-sycl-program-sycl-kernel-bundle.

also removes "v" as a permitted specialization constant intermediate data type, as composite specialization constants are broken into multiple specialization constants, so structs end up passed as a single constant while the program expects multiple, and therefore, doesn't work as intended
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