-
Notifications
You must be signed in to change notification settings - Fork 842
[NFC][SYCL] Add pragma unroll in accessor.hpp #4347
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
Changes from 5 commits
d560cf7
3cdd2a4
309995e
9074026
418dbe8
699c560
04aabf7
63623fe
8419b48
e9d4e64
2d80f2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,3 +100,15 @@ | |
| // clang emits "warning:" in the message pragma output | ||
| #define __SYCL_WARNING(msg) __pragma(message(msg)) | ||
| #endif // __GNUC__ | ||
|
|
||
| // defined __SYCL_UNROLL to add pragma/attribute unroll to a loop | ||
| #ifndef __SYCL_UNROLL | ||
| #if defined(__clang__) || defined(__INTEL_COMPILER) | ||
| #define __SYCL_UNROLL(x) _Pragma(unroll (x)) | ||
| #elif (defined(__GNUC__) && __GNUC__ >= 8) || \ | ||
| (defined(__GNUG__) && __GNUG__ >= 8) | ||
| #define __SYCL_UNROLL(x) _Pragma(GCC unroll (x)) | ||
| #else | ||
| #define __SYCL_UNROLL(x) | ||
| #endif // compiler switch | ||
| #endif // __SYCL_UNROLL | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While looking at this I wonder why just using a metaprogrammed loop instead is not better than this pragmatic spaghetti plate.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It also works with one-iteration loops, unlike this pragma-based solution: #6560 |
||
Uh oh!
There was an error while loading. Please reload this page.