Open vasslitvinov opened 7 years ago
My gut reaction is that x
should start with the value 10
for each iteration. My sense of in
generally is that you get a copy of the original x
that you can modify within a certain scope. If changes persisted beyond that scope (the loop body in this case), that would strike me as confusing behavior.
The semantics of
in
forall intent is that the shadow variable implicitly refers to the implicit formal of the task function in the corresponding parallel iterator (leader or standalone) that executes the current yield statement. If the yield is executed outside any task constructs, the shadow variable refers to the implicit formal of the parallel iterator itself. These implicit formals havein
intent as well.This issue seeks to clarify what happens when a task construct follows a yield or visa versa. Specifically, the implicit formal of the task is initialized to:
This question is exemplified by the following code:
If each
coforall
executes just a single iteration, what should be the output?Or should
x
start out with the value 10 for each iteration? For each iteration except 4 and 5?