-
Notifications
You must be signed in to change notification settings - Fork 8
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
Other kinds of for loops #191
Comments
Would it work to implement (1) and (2) by using prefix or suffix views and then iterating over those? We would, of course, need to figure out what it means to take a view using an index type… |
Well normally, the other loops wouldn't be unrolled so the iterator would be treated as "just" a dynamic number for slicing purposes. I still don't know of a way to unroll the outer loop without doing the equivalent of the suggestion in #72... The Jason Cong paper seems to recommend having the inner loop unrolled with a static bound while the outer (controller) loops has a dynamic bound. |
I don't think having a prefix view for (2) helps (unless I missed something). What we need is loops with dynamic bounds:
Right now, the compiler restricts As a bonus, we can transitively calculate the |
I suppose I was implicitly suggesting that loops might be written to use the size of an array for their bounds—sort of like a "foreach" loop. Then, you would do this by first taking a view on the array and then iterating over the entire array. This proposal doesn't really solve the problem; it just moves it into the view creation instead of the iteration… |
Yeah, I don't know if that fixes it. See the example in #193 which tries to use both the underlying array and the view together. |
Two common patterns of
for
loops I've encountered in PolyBench:for
loopsThere might be interesting type system things we can do for these loops. Every other
for
loop should just be turned into awhile
loop.For (3), we can do something of the form where only some of the banks are consumed since not all of them are touched.
Don't know what to do for (1) and (2).
The text was updated successfully, but these errors were encountered: