-
Notifications
You must be signed in to change notification settings - Fork 23
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
Inconsistent grain size pragma syntax #90
Comments
Thanks for bringing this up. When we originally added the grainsize pragma, we opted for a simpler syntax that was more in keeping with other clang pragmas. On our end, we've generally found that issues with backwards compatibility on the grainsize pragma are straightforward to overcome. If need be, however, it shouldn't be too onerous to add support for the In general, backwards compatibility is something we're considering carefully as we develop OpenCilk and revisit decisions regarding Cilk syntax and semantics. So please let us know about any concerns you have regarding Cilk syntax and semantics. |
Here's a patch from Shannon that allows either syntax: |
Tapir also requires that the grainsize be an integral constant expression. Many of our codes compute the grainsize at run time which is no longer supported. |
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
Yes, Tapir is currently limited to constant (expression) grainsizes. Arbitrary grainsizes can be implemented by hand using manual loop stripmining. I'm curious what kinds of runtime computations you're using for grainsizes. I ask because, with Cilk Plus, we would often see a poor use of runtime-computed grainsizes that was often a pessimization for the program's performance. |
In one case it was a performance benchmark where we wanted to control exactly how many tasks cilk_for was creating. In other codes, when it is known that each loop iteration does the same amount of work, we try to minimize the overhead of task creation by creating exactly one task per execution context. But in general I agree that runtime-computed grain sizes are not good coding practice. |
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
…x. Thanks to @skuntz for the essential code for this patch. This commit partially addresses wsmoses/Tapir-LLVM#90.
Tapir's expected syntax for the grain size pragma doesn't match other Cilk compilers.
Example:
Error:
Removing the equals sign (i.e.
#pragma cilk grainsize 100
) fixes the error, but breaks compatibility with other Cilk compilers like gcc 5.5:Intel's definition of Cilk required the equals sign, see https://www.cilkplus.org/sites/default/files/open_specifications/cilk_plus_language_specification_0_9.pdf.
The text was updated successfully, but these errors were encountered: