Repository navigation
Check the number of kernel arguments only for interoperability kernels - #2425
Open
ndgrigorian wants to merge 3 commits into
Open
ndgrigorian wants to merge 3 commits into
ndgrigorian wants to merge 3 commits into
Conversation
ndgrigorian
requested review from
antonwolfy and
vlad-perevezentsev
as code owners
November 8, 2026 20:51
The number of arguments is only defined for kernels from OpenCL C source or SPIR-V bundles, so SyclKernel records the kind of bundle it comes from and submit checks the count only for those. DPCTLKernel_GetNumArgs no longer aborts when the query throws.
ndgrigorian
force-pushed
the
fix-kernel-arg-count-check
branch
from
November 8, 2026 20:51
c562604 to
b7f435b
Compare
|
View rendered docs @ https://intelpython.github.io/dpctl/pulls/2425/index.html |
Collaborator
A sycl::local_accessor of a kernel compiled from SYCL to SPIR-V can take several arguments; the error says so when a LocalAccessor is given, and the LocalAccessor docstring explains it.
A LocalAccessor works for a kernel compiled from SYCL to SPIR-V when the accessor's ranges are passed after it; say so in the docstring and the error, and test it.
This branch has not been deployed
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 fixes the check on the number of kernel arguments added to
SyclQueue.submitandSyclQueue.submit_asyncin gh-2382. It compares the number of arguments given withinfo::kernel::num_args, which SYCL defines only for kernels in kernel bundles created through backend interoperability. For a kernel compiled from SYCL source, DPC++ reports the backend's count instead, in which asycl::local_accessortakes 4 arguments, so such a kernel can not be submitted with adpctl.LocalAccessor:dpctl.compiler.SyclKernelnow records the kind of kernel bundle it comes from, and the number of arguments is only checked for kernels from kernel bundles created from OpenCL C source or SPIR-V. The arguments of other kernels, including those passed to dpctl throughSyclKernel_Make, are not checked. On OpenCL, the backend rejects a wrong number of arguments on submission, raisingSyclKernelSubmitError, while on Level Zero too few arguments are not detectedA kernel compiled from SYCL to SPIR-V may also expect a
sycl::local_accessorparameter as several arguments: the local memory pointer, followed by the accessor's access range, memory range and offset. Adpctl.LocalAccessorprovides only the pointer, so the others have to be passed explicitly after it. For kernels from a SPIR-V bundle, the error now says so when the arguments include adpctl.LocalAccessor, and thedpctl.LocalAccessordocstring shows how to pass them:DPCTLKernel_GetNumArgsalso no longer aborts the process when the query throws, returning -1, andSyclKernel.get_num_argsraisesRuntimeErrorin that case