-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Fix builtins address space type #4275
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
Conversation
This patch fixes the `core/GroupAsyncCopy.cl` and `ocl/prefetch.cl` lit tests in `libclc`. These started failing with the introduction of the SYCL address spaces in intel#3634. The issue is that the builtins are declared with the SYCL address spaces in the tablegen so when used in an OpenCL setting it ends up with address space mismatches between things like `opencl_global` and `sycl_global`. These two were the only tests affected because they're also the only tested builtins that do not have generic address space variants in tablegen, the other tests would just fall back on the generic address space variants. With this patch the builtins should automatically get the appropriate version of the address space depending on the context.
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.
Might be good to have the SPIRVBuiltins.td
to use the opencl_*
address space rather than the sycl_*
ones now that the flip happens here as well. The reason is this would be a step toward allowing type definition sharing with OpenCLBuiltins.td
.
@premanandrao @AaronBallman @bader please take a look. I am not too familiar with address space handling. |
It looks good to me. But I would like @bader to confirm. |
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.
Changes seem reasonable to me, but should we have test coverage within SYCL for the changes?
Well this is exercised in Also this is not really a problem in SYCL, rather it's a problem when using SPIR-V builtins with |
Understood, but this is still a functional change to SYCL, so it should come with test coverage. Otherwise, we increase the maintenance burden for folks working in this repo because they can't run local tests when making changes, so we run the risk of accidentally regressing behavior (and hopefully catch it when running check-libclc as part of check-sycl from CI some day). Note that check-sycl is not where I'd want to see the test coverage anyway; the changes are to Clang, so I'm hoping to see check-clang coverage if possible. |
Oh I see, that makes sense, I'll add some specific clang tests for this. |
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, thank you for the additional test coverage!
I've had to update the lit tests patterns for windows, and it also turns out that the microsoft mangler didn't know how to mangle SYCL address spaces, so I'm not sure how that worked before. So I've also added a patch to the microsoft mangler to add the SYCL address spaces and hopefully that works, I don't have a windows build on hand to test that further but maybe we can see what the CI says before I set that up. |
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
This patch fixes the
core/GroupAsyncCopy.cl
andocl/prefetch.cl
littests in
libclc
.These started failing with the introduction of the SYCL address spaces
in #3634.
The issue is that the builtins are declared with the SYCL address spaces
in the tablegen so when used in an OpenCL setting it ends up with
address space mismatches between things like
opencl_global
andsycl_global
.These two were the only tests affected because they're also the only
tested builtins that do not have generic address space variants in
tablegen, the other tests would just fall back on the generic address
space variants.
With this patch the builtins should automatically get the appropriate
version of the address space depending on the context.