tests/memory-block-merging/coalescing/safety-condition-5/neg0.fut
raw| 1 | -- t0 cannot be coalesced into t1, since the index function includes i1, which |
| 2 | -- depends on the result of t0. |
| 3 | -- == |
| 4 | -- input { [0, 1] |
| 5 | -- [[5, 5], [5, 5]] |
| 6 | -- 0 |
| 7 | -- } |
| 8 | -- output { [[5, 5], [1, 2]] |
| 9 | -- } |
| 10 | -- structure seq-mem { Alloc 1 } |
| 11 | -- structure gpu-mem { Alloc 1 } |
| 12 | |
| 13 | let main [n] (ns: [n]i32) (t1: *[n][n]i32) (i0: i32): [][]i32 = |
| 14 | let t0 = map (+ 1) ns |
| 15 | |
| 16 | let i1 = t0[i0] |
| 17 | let t1[i1] = t0 |
| 18 | |
| 19 | in t1 |