-
Notifications
You must be signed in to change notification settings - Fork 428
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
Should we support with
intent clauses for on
clauses?
#26752
Comments
Historically, I believe I've been the person most opposed to this, arguing that it isn't really necessary / doesn't add anything that you couldn't express in other ways; but I've come around over time, in part because I think the GPU cases are pretty compelling, partially from an orthogonality standpoint, and partially because so many Chapel programmers have seemed to expect it. The only thing that gives me slight hesitation is that—without taking on breaking language changes—the default intents for on-clauses would be different from other contexts (argument passing, task intents), and I believe we've been criticized for having a too-complex default intent story before. I also think there's a productivity / least surprise argument that could be made for the status quo, but would not be surprised if the addition of |
with
intent clauses to on
clauses?with
intent clauses for on
clauses?
It's an interesting question how this proposal could interact with It might be that, if you want to get a local copy of a variable on a per-locale basis, it would be this: coforall loc in Locales with (in x) {
on loc with (in x) {
... do something with x ...
}
} It's interesting to think about if copy elision has a role here. We could say, we don't have to copy the I suppose that Which gets me wondering if this version would suffice: coforall loc in Locales {
on loc with (in x) {
... do something with x ...
}
} |
I am a strong supporter of exploring this direction. Intent inconsistency worry that @bradcray brought up is an important concern, but I have no immediate reaction to it. For @mppf's musings about A user could very well write the code as in the first variant. I see that as a more prescriptive version of doing the same thing, in which case, I'd expect to see two outputs from that |
In recent years, particularly as GPU support has come on-line, we've increasingly taken it as a given that
on
clauses ought to supportwith
clauses to specify the intents for how an outer-scope variable is made available on a (potentially) distinct locale. Today, the default is arguably[const] ref
for everything (based on the outer variable'sconst
ness)—or potentiallyconst in
in cases where remote value forwarding (RVF) kicks in (?).Here are some examples of how this might look/work:
Mostly this has been discussed in live meetings, and showed up prominently in #18585, but I was surprised today to not be able to find an issue for it, so am opening this one.
The text was updated successfully, but these errors were encountered: