Skip to content

[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

Closed

Conversation

AlexeySachkov
Copy link
Contributor

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.

Unified code related to `vec` alignment to reduce amount of macro-based
branching we have for preview breaking changes mode.
Comment on lines -291 to -294
#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
Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@aelovikov-intel aelovikov-intel left a 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
Copy link
Contributor

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.

@cperkinsintel
Copy link
Contributor

There is that "out of memory" problem on Windows. But also, don't overlook this error in check-sycl:
D:\github\_work\llvm\llvm\build\include\sycl/types.hpp(1460): error C2065: 'MaxVecAlignment': undeclared identifier

@AlexeySachkov
Copy link
Contributor Author

@steffenlarsen made some refactoring to the file as well, so I'm closing this for now till I revisit it later

@AlexeySachkov AlexeySachkov deleted the private/asachkov/vec-unification branch May 22, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants