tests/memory-block-merging/coalescing/safety-condition-4/neg0.fut
raw| 1 | -- Negative test. 'ys' aliases 'zs', so it already occupies another memory |
| 2 | -- block than "its own". |
| 3 | -- == |
| 4 | -- input { [[2, 2], |
| 5 | -- [2, 2]] |
| 6 | -- [[3, 4], |
| 7 | -- [10, 20]] |
| 8 | -- 0 |
| 9 | -- 0 |
| 10 | -- } |
| 11 | -- output { [[9, 12], |
| 12 | -- [2, 2]] |
| 13 | -- } |
| 14 | -- structure seq-mem { Alloc 1 } |
| 15 | -- structure gpu-mem { Alloc 1 } |
| 16 | |
| 17 | let main [n] (xs: *[n][n]i32) (zs0: [n][n]i32) (i: i32) (j: i32): [n][n]i32 = |
| 18 | let zs = map (\z -> map (* 3) z) zs0 |
| 19 | let ys = zs[i] |
| 20 | let xs[j] = ys |
| 21 | in xs |