Skip to content

Commit

Permalink
respond to feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Abraham <[email protected]>
  • Loading branch information
jabraham17 committed Sep 21, 2023
1 parent b41c468 commit 302440f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions test/release/examples/primers/arrays.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ writeln("After incrementing B's elements, B is:\n", B, "\n");
// Array ``A2`` above will have the implicit domain ``{0..4}`` to
// represent the five values in its initializing expression.
//
// When an array is modified without being specified in the iterand inside
// of a parallel construct (like ``forall`` in the example below), it needs
// an explicit ``ref`` intent.
// The explicit ``ref`` intent is required for ``B`` in the example below
// because ``B`` is not modifed directly through the loop's index variable (in
// this case ``i`` and ``j``).
//
// An array's domain can be queried using the ``.domain`` method,
// which returns a ``const ref`` to the domain in question. For
Expand Down
9 changes: 5 additions & 4 deletions test/release/examples/primers/forallLoops.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ an expression. Both kinds are shown in the following sections.
"Must-parallel" forall statement
--------------------------------
In the following example, the forall loop iterates over the array indices
in parallel. Since the loop indirectly loops over ``A`` and the body modifies it, an explicit ``ref`` intent must be used.
In the following example, the forall loop iterates over the array indices in
parallel. Since the loop iterates over ``1..n`` and not ``A``, an explicit
``ref`` intent must be used to allow modification of ``A``.
*/

config const n = 5;
Expand Down Expand Up @@ -81,8 +82,8 @@ provide a "leader" iterator and all iterables provide "follower" iterators.
These are described in the :ref:`parallel iterators primer
<primers-parIters-leader-follower>`.
Here we illustrate zippering arrays and domains. Since ``C`` is not directly
iterated over, we must explicitly mark it as modified with a ``ref`` intent.
Here we illustrate zippering arrays and domains. In this example, we must
explicitly mark ``C`` as modified with a ``ref`` intent.
*/

var C: [1..n] real;
Expand Down

0 comments on commit 302440f

Please sign in to comment.