-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Fix address space for spec constants buffer #3521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL] Fix address space for spec constants buffer #3521
Conversation
This patch sets OpenCL global address space for specialization constants buffer instead of generic one. It fixes the crash which happens during passing nullptr to piKernelSetArg PI API func Co-authored-by: Vlad Romanov <vlad.romanov@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding @bader as reviewer because this seems somewhat related to existing upstream work in https://reviews.llvm.org/D89909.
It looks like you're missing test coverage for the change. Also, I would appreciate a bit more information about why this is the correct fix (as opposed to checking for nullptr in the crashing API).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
It looks like we already have tests, but they were checking for wrong IR.
Please, update kernel-handler.cpp tests.
Thanks, fixed tests and updated description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* upstream/sycl: (39 commits) [CI] Switch to default clang-format version. (intel#3540) [Driver][NFC] Cleanup some option setting for SYCL offload (intel#3542) [GitHub Actions] Update main branch sync schedule [SYCL][NFC] Fix potential namespace conflicts with PSTL in tuple.hpp (intel#3541) [SYCL] Bump sycl library minor version (intel#3538) [SYCL][CUDA] Implemented cuda_piextUSMEnqueueMemAdvise (intel#3365) [SYCL][FPGA] Add mutual diagnostic of max_concurrency attribute in conjunction of disable_loop_pipelining attribute (intel#3512) [SYCL] [MATRIX] Enable joint_matrix_load, joint_matrix_store, and joint_matrix_mad for AMX (intel#3503) [ESIMD] Skip rewriting functions used through function pointers (intel#3527) [SYCL] Fix address space for spec constants buffer (intel#3521) [SYCL] Correct the tablegen for checking mutually exclusive stmt attrs (intel#3519) [SYCL][PI][L0][NFC] Refactor setting of LastCommandEvent (intel#3528) [SYCL] Fix group local memory sharing issue (intel#3489) [SYCL][NFC] Fix post-commit failure (intel#3532) [SYCL][Doc] Remove extension mechanism (intel#3526) [SYCL] Move sycl.hpp in install directory and adjust driver to match (intel#3523) [SYCL][ESIMD] Update ESIMD docs to address recent user comments: (intel#3516) [NFCI][SYCL] Correct -fdeclare-spirv-builtins to use marshalling (intel#3515) [SYCL] Rework MarkDevice and children (intel#3475) [SYCL] Fix StringLiteral Ctor issue from intel#3504. (intel#3520) ...
This patch sets OpenCL global address space for specialization constants
buffer instead of generic one.
This buffer passes to the kernel function as kernel argument through
clSetKernelArg
. According to OpenCL spec, if the argument is declaredto be a pointer of a built-in or user defined type with the
__global
or__constant
qualifier, the memory object specified as argument valuemust be a buffer object (or nullptr).
The buffer had generic address space, so there was a crash in run time
due to wrong address space.
Although OpenCL specification explicitly states that a string literal
should reside in constant address space, it does not work for SYCL
with "generic by default" address space rules.
Co-authored-by: Vlad Romanov vlad.romanov@intel.com