Is `[<var> in <distributed variable>] equivalent to` forall`?

I noticed something in the code snippet that gave me:

var D: domain(2) dmapped Block(boundingBox=Space) = Space;
var A: [D] int;
[a in A] a = a.locale.id;

Is [a in A]equivalent forall a in A a = a.locale.id?

+4
source share
1 answer

Yes exactly. The Chapel is [a in A] exprequivalent forall a in A do expr.

As for the title of this question, please note that this does not depend on whether it is distributed . For example, you can also write , not . A[i in 1..n]forall i in 1..n do

Array types in the Chapel, such as [D] real, can similarly be read as

"for all indices in , highlight the type element ." D real

+3
source

Source: https://habr.com/ru/post/1676100/


All Articles