Add support for specialization constants#2304
Open
ndgrigorian wants to merge 7 commits intorename-sycl-program-sycl-kernel-bundlefrom
Open
Add support for specialization constants#2304ndgrigorian wants to merge 7 commits intorename-sycl-program-sycl-kernel-bundlefrom
ndgrigorian wants to merge 7 commits intorename-sycl-program-sycl-kernel-bundlefrom
Conversation
|
View rendered docs @ https://intelpython.github.io/dpctl/pulls/2304/index.html |
Collaborator
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
b7f8d82 to
8c5651d
Compare
961be21 to
8dbb320
Compare
also adds spec_id, itemsize, and default_value fields
8dbb320 to
043aa83
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces support for specialization constants in dpctl, including both a Cython class
SpecializationConstantfor construction and passing of the constructed class tocreate_kernel_bundle_from_spirvvia a newspecializationskeyword argument.The
SpecializationConstantclass 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.Also introduces
dpctl.program.utilswithparse_spirv_specializationsutility function, allowing the user to query a SPIR-V directly from Python.