-
Notifications
You must be signed in to change notification settings - Fork 768
[SYCL] Fix crash on array of pointers #2413
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
The crash happens when address space of pointer element is checked using array type. The type of 'array element' should be checked, not the 'array type' itself. Signed-off-by: Elizabeth Andrews <[email protected]>
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.
Cool, easier than I thought :)
Does this work for arrays-of-pointers in the 'root' lambda? So something like:
void foo() {
int *array[2];
kernel<class whatever>([=](){ return array[0];});
}
I think so. I will add a test for that as well. Unfortunately though, I was just running some tests locally and it crashed for the 2D array of pointers in CodeGen :/ I'm not sure why check-all didn't show this when I tested it earlier. The runtime test should have crashed. |
Well, the question is more, "Are they wrapped" (I don't think so), and should they be? |
No they aren't. And they shouldn't be because that affects current USM functionality. We're maintaining struct depth to avoid this. The wrapping was added in a prior commit to get rid of runtime errors which came as a result of decomposition for unused pointers in structs. These should just be ignored by compiler (since they're not used). If they ever are incorrectly used it'll crash/error in backend. |
@elizabethandrews, check-sycl is not a not part of check-all. |
Oh really? That explains it then. I've always run check-all to make sure tests are passing but I guess I need to run check-all and check-sycl. Thanks for letting me know! |
for array of pointers not inside a struct. Signed-off-by: Elizabeth Andrews <[email protected]>
Use comment syntax when passing nullptr Signed-off-by: Elizabeth Andrews <[email protected]>
Signed-off-by: Elizabeth Andrews <[email protected]>
@intel/llvm-reviewers-runtime there is a runtime test change. It only adds unused array of pointers to a struct to confirm the code does not crash in this case. |
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.
Runtime changes LGTM
Thanks for the reviews everyone! @bader this is ready for your review/merge. |
[L0] Shorten the dir name for the fecthed repo to avoid hitting Windows max limit
The crash happens when address space of pointer element is
checked using array type. The type of 'array element' should
be checked, not the 'array type' itself. Also added a missing
LValueToRValue cast for pointers.
Signed-off-by: Elizabeth Andrews [email protected]