-
Notifications
You must be signed in to change notification settings - Fork 787
[NFC][SYCL] vec
code unification
#11879
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
[NFC][SYCL] vec
code unification
#11879
Conversation
Unified code related to `vec` alignment to reduce amount of macro-based branching we have for preview breaking changes mode.
#define __SYCL_ALIGNED_VAR(type, x, var) \ | ||
type __declspec(align((x < 64) ? x : 64)) var | ||
#else | ||
#define __SYCL_ALIGNED_VAR(type, x, var) alignas(x) type var |
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.
Ok, I see now why we need that macro :) Please expect another attempt at unifying this in the next commit
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.
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, but I'll leave the approval to @cperkinsintel.
specification requirements, a limitation of the MSVC compiler(Error C2719).\ | ||
Requested alignment applied, limited at 64.") | ||
#define __SYCL_ALIGNED_VAR(type, x, var) \ | ||
type __declspec(align((x < 64) ? x : 64)) var |
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.
This doesn't seem right. You are now returning us to having Windows use __declspec(align(...))
in both the -fpreview
and not.
Part of the problem is that __declspec(align(...))
is not respected by the device at all. It means nothing. To get the alignments to agree, we need to use alignas
on both host and device on both linux and windows when using the -fpreview
flag. When not using the -fpreview
flag, we leave things as they were.
There is that "out of memory" problem on Windows. But also, don't overlook this error in check-sycl: |
@steffenlarsen made some refactoring to the file as well, so I'm closing this for now till I revisit it later |
This is a follow-up from #11697. There is a number of low-hanging fruits where we could reduce amount of macro-based branches for preview breaking changes mode.