I have written a program which does essentially this

- Code: Select all
`uint N,Nx,Nt;`

array x = constant(0, N, Nx, Nt);

array z = constant(0, N, Nx);

for (t = 0:Nt) {

gfor( array i, Nx ) {

x(span, i, t) = z(span, i) + ...//some matrix multiplication and addition

z(span, i) = x(span, i, t);

}

}

The point of z is to store a value for the next iteration of the outer for-loop.

I think that I have done everything according to the GFOR-rules, because the values of x at the end are correct (well, at least non-zero).

The problem is that z will always have the value of zeros if i dont force a deep copy using ".copy()" or do something stupid as "+0".

My interpretation of this note (from the assignment operator) "The array operator may not do a deep copy. A deep copy happens only if a subscript indexing is used.", this implies that a deep copy should happen in my case. So why is it not? Is this a limitation of GFOR, or is it a bug?

Thanks!