diff --git a/test/build_function_tests/intermediate-exprs-inplace.jl b/test/build_function_tests/intermediate-exprs-inplace.jl index f81204b48..2ec2fa480 100644 --- a/test/build_function_tests/intermediate-exprs-inplace.jl +++ b/test/build_function_tests/intermediate-exprs-inplace.jl @@ -1,22 +1,19 @@ -:(function (u,) - let ˍ₋out = zeros(Float64, map(length, (Base.OneTo(5), Base.OneTo(5)))) - begin - ˍ₋out_input_1 = let _out = zeros(Float64, map(length, (Base.OneTo(5), Base.OneTo(5)))) - begin - for (j, j′) = zip(1:5, reset_to_one(1:5)) - for (i, i′) = zip(1:5, reset_to_one(1:5)) - _out[i′, j′] = (+)(_out[i′, j′], (getindex)(u, (Main.limit)((+)(-1, i), 5), (Main.limit)((+)(1, j), 5))) - end +:(function (ˍ₋out, u) + begin + ˍ₋out_input_1 = let _out = zeros(Float64, map(length, (Base.OneTo(5), Base.OneTo(5)))) + begin + for (j, j′) = zip(1:5, reset_to_one(1:5)) + for (i, i′) = zip(1:5, reset_to_one(1:5)) + _out[i′, j′] = (+)(_out[i′, j′], (getindex)(u, (Main.limit2)((+)(-1, i), 5), (Main.limit2)((+)(1, j), 5))) end end - _out - end - for (j, j′) = zip(Base.OneTo(5), reset_to_one(Base.OneTo(5))) - for (i, i′) = zip(Base.OneTo(5), reset_to_one(Base.OneTo(5))) - ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(ˍ₋out_input_1, j, i)) end + _out + end + for (j, j′) = zip(Base.OneTo(5), reset_to_one(Base.OneTo(5))) + for (i, i′) = zip(Base.OneTo(5), reset_to_one(Base.OneTo(5))) + ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(ˍ₋out_input_1, j, i)) end end - ˍ₋out end end) \ No newline at end of file diff --git a/test/build_function_tests/intermediate-exprs-outplace.jl b/test/build_function_tests/intermediate-exprs-outplace.jl index 8113cf9e1..c9599c279 100644 --- a/test/build_function_tests/intermediate-exprs-outplace.jl +++ b/test/build_function_tests/intermediate-exprs-outplace.jl @@ -1,19 +1,22 @@ -:(function (ˍ₋out, u) - begin - ˍ₋out_input_1 = let _out = zeros(Float64, map(length, (Base.OneTo(5), Base.OneTo(5)))) - begin - for (j, j′) = zip(1:5, reset_to_one(1:5)) - for (i, i′) = zip(1:5, reset_to_one(1:5)) - _out[i′, j′] = (+)(_out[i′, j′], (getindex)(u, (Main.limit)((+)(-1, i), 5), (Main.limit)((+)(1, j), 5))) +:(function (u,) + let ˍ₋out = zeros(Float64, map(length, (Base.OneTo(5), Base.OneTo(5)))) + begin + ˍ₋out_input_1 = let _out = zeros(Float64, map(length, (Base.OneTo(5), Base.OneTo(5)))) + begin + for (j, j′) = zip(1:5, reset_to_one(1:5)) + for (i, i′) = zip(1:5, reset_to_one(1:5)) + _out[i′, j′] = (+)(_out[i′, j′], (getindex)(u, (Main.limit2)((+)(-1, i), 5), (Main.limit2)((+)(1, j), 5))) + end end end + _out + end + for (j, j′) = zip(Base.OneTo(5), reset_to_one(Base.OneTo(5))) + for (i, i′) = zip(Base.OneTo(5), reset_to_one(Base.OneTo(5))) + ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(ˍ₋out_input_1, j, i)) end - _out - end - for (j, j′) = zip(Base.OneTo(5), reset_to_one(Base.OneTo(5))) - for (i, i′) = zip(Base.OneTo(5), reset_to_one(Base.OneTo(5))) - ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(ˍ₋out_input_1, j, i)) end end + ˍ₋out end end) \ No newline at end of file diff --git a/test/build_function_tests/manual-limits-inplace.jl b/test/build_function_tests/manual-limits-inplace.jl index 5c8590138..d3ed5d330 100644 --- a/test/build_function_tests/manual-limits-inplace.jl +++ b/test/build_function_tests/manual-limits-inplace.jl @@ -1,12 +1,9 @@ -:(function (u,) - let ˍ₋out = zeros(Float64, map(length, (Base.OneTo(5), Base.OneTo(5)))) - begin - for (j, j′) = zip(1:5, reset_to_one(1:5)) - for (i, i′) = zip(1:5, reset_to_one(1:5)) - ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(u, (Main.limit)((+)(-1, i), 5), (Main.limit)((+)(1, j), 5))) - end +:(function (ˍ₋out, u) + begin + for (j, j′) = zip(1:5, reset_to_one(1:5)) + for (i, i′) = zip(1:5, reset_to_one(1:5)) + ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(u, (Main.limit2)((+)(-1, i), 5), (Main.limit2)((+)(1, j), 5))) end end - ˍ₋out end end) \ No newline at end of file diff --git a/test/build_function_tests/manual-limits-outplace.jl b/test/build_function_tests/manual-limits-outplace.jl index 85d19be7b..099cf69ff 100644 --- a/test/build_function_tests/manual-limits-outplace.jl +++ b/test/build_function_tests/manual-limits-outplace.jl @@ -1,9 +1,12 @@ -:(function (ˍ₋out, u) - begin - for (j, j′) = zip(1:5, reset_to_one(1:5)) - for (i, i′) = zip(1:5, reset_to_one(1:5)) - ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(u, (Main.limit)((+)(-1, i), 5), (Main.limit)((+)(1, j), 5))) +:(function (u,) + let ˍ₋out = zeros(Float64, map(length, (Base.OneTo(5), Base.OneTo(5)))) + begin + for (j, j′) = zip(1:5, reset_to_one(1:5)) + for (i, i′) = zip(1:5, reset_to_one(1:5)) + ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(u, (Main.limit2)((+)(-1, i), 5), (Main.limit2)((+)(1, j), 5))) + end end end + ˍ₋out end end) \ No newline at end of file diff --git a/test/build_function_tests/stencil-broadcast-inplace.jl b/test/build_function_tests/stencil-broadcast-inplace.jl index 8e7331058..2d2b6d2aa 100644 --- a/test/build_function_tests/stencil-broadcast-inplace.jl +++ b/test/build_function_tests/stencil-broadcast-inplace.jl @@ -1,16 +1,13 @@ -:(function (x,) - let ˍ₋out = zeros(Float64, map(length, (1:6, 1:6))) - begin - ˍ₋out_2_input_1 = (broadcast)(+, x, (adjoint)(x)) - ˍ₋out_1 = (view)(ˍ₋out, 1:6, 1:6) - ˍ₋out_1 .= 0 - ˍ₋out_2 = (view)(ˍ₋out, 2:5, 2:5) - for (j, j′) = zip(Base.OneTo(4), reset_to_one(Base.OneTo(4))) - for (i, i′) = zip(Base.OneTo(4), reset_to_one(Base.OneTo(4))) - ˍ₋out_2[i′, j′] = (+)(ˍ₋out_2[i′, j′], (+)(1, (getindex)(ˍ₋out_2_input_1, i, j))) - end +:(function (ˍ₋out, x) + begin + ˍ₋out_2_input_1 = (broadcast)(+, x, (adjoint)(x)) + ˍ₋out_1 = (view)(ˍ₋out, 1:6, 1:6) + ˍ₋out_1 .= 0 + ˍ₋out_2 = (view)(ˍ₋out, 2:5, 2:5) + for (j, j′) = zip(Base.OneTo(4), reset_to_one(Base.OneTo(4))) + for (i, i′) = zip(Base.OneTo(4), reset_to_one(Base.OneTo(4))) + ˍ₋out_2[i′, j′] = (+)(ˍ₋out_2[i′, j′], (+)(1, (getindex)(ˍ₋out_2_input_1, i, j))) end end - ˍ₋out end end) \ No newline at end of file diff --git a/test/build_function_tests/stencil-broadcast-outplace.jl b/test/build_function_tests/stencil-broadcast-outplace.jl index 2d2b6d2aa..8e7331058 100644 --- a/test/build_function_tests/stencil-broadcast-outplace.jl +++ b/test/build_function_tests/stencil-broadcast-outplace.jl @@ -1,13 +1,16 @@ -:(function (ˍ₋out, x) - begin - ˍ₋out_2_input_1 = (broadcast)(+, x, (adjoint)(x)) - ˍ₋out_1 = (view)(ˍ₋out, 1:6, 1:6) - ˍ₋out_1 .= 0 - ˍ₋out_2 = (view)(ˍ₋out, 2:5, 2:5) - for (j, j′) = zip(Base.OneTo(4), reset_to_one(Base.OneTo(4))) - for (i, i′) = zip(Base.OneTo(4), reset_to_one(Base.OneTo(4))) - ˍ₋out_2[i′, j′] = (+)(ˍ₋out_2[i′, j′], (+)(1, (getindex)(ˍ₋out_2_input_1, i, j))) +:(function (x,) + let ˍ₋out = zeros(Float64, map(length, (1:6, 1:6))) + begin + ˍ₋out_2_input_1 = (broadcast)(+, x, (adjoint)(x)) + ˍ₋out_1 = (view)(ˍ₋out, 1:6, 1:6) + ˍ₋out_1 .= 0 + ˍ₋out_2 = (view)(ˍ₋out, 2:5, 2:5) + for (j, j′) = zip(Base.OneTo(4), reset_to_one(Base.OneTo(4))) + for (i, i′) = zip(Base.OneTo(4), reset_to_one(Base.OneTo(4))) + ˍ₋out_2[i′, j′] = (+)(ˍ₋out_2[i′, j′], (+)(1, (getindex)(ˍ₋out_2_input_1, i, j))) + end end end + ˍ₋out end end) \ No newline at end of file diff --git a/test/build_function_tests/stencil-extents-inplace.jl b/test/build_function_tests/stencil-extents-inplace.jl index 20069daef..e063cf0b3 100644 --- a/test/build_function_tests/stencil-extents-inplace.jl +++ b/test/build_function_tests/stencil-extents-inplace.jl @@ -1,15 +1,12 @@ -:(function (x,) - let ˍ₋out = zeros(Float64, map(length, (1:5, 1:5))) - begin - ˍ₋out_1 = (view)(ˍ₋out, 1:5, 1:5) - ˍ₋out_1 .= 0 - ˍ₋out_2 = (view)(ˍ₋out, 2:4, 2:4) - for (j, j′) = zip(2:4, reset_to_one(2:4)) - for (i, i′) = zip(2:4, reset_to_one(2:4)) - ˍ₋out_2[i′, j′] = (+)(ˍ₋out_2[i′, j′], (*)(1//2, (+)((+)((+)((getindex)(x, (+)(-1, i), j), (getindex)(x, (+)(1, i), j)), (getindex)(x, i, (+)(-1, j))), (getindex)(x, i, (+)(1, j))))) - end +:(function (ˍ₋out, x) + begin + ˍ₋out_1 = (view)(ˍ₋out, 1:5, 1:5) + ˍ₋out_1 .= 0 + ˍ₋out_2 = (view)(ˍ₋out, 2:4, 2:4) + for (j, j′) = zip(2:4, reset_to_one(2:4)) + for (i, i′) = zip(2:4, reset_to_one(2:4)) + ˍ₋out_2[i′, j′] = (+)(ˍ₋out_2[i′, j′], (*)(1//2, (+)((+)((+)((getindex)(x, (+)(-1, i), j), (getindex)(x, (+)(1, i), j)), (getindex)(x, i, (+)(-1, j))), (getindex)(x, i, (+)(1, j))))) end end - ˍ₋out end end) \ No newline at end of file diff --git a/test/build_function_tests/stencil-extents-outplace.jl b/test/build_function_tests/stencil-extents-outplace.jl index e063cf0b3..20069daef 100644 --- a/test/build_function_tests/stencil-extents-outplace.jl +++ b/test/build_function_tests/stencil-extents-outplace.jl @@ -1,12 +1,15 @@ -:(function (ˍ₋out, x) - begin - ˍ₋out_1 = (view)(ˍ₋out, 1:5, 1:5) - ˍ₋out_1 .= 0 - ˍ₋out_2 = (view)(ˍ₋out, 2:4, 2:4) - for (j, j′) = zip(2:4, reset_to_one(2:4)) - for (i, i′) = zip(2:4, reset_to_one(2:4)) - ˍ₋out_2[i′, j′] = (+)(ˍ₋out_2[i′, j′], (*)(1//2, (+)((+)((+)((getindex)(x, (+)(-1, i), j), (getindex)(x, (+)(1, i), j)), (getindex)(x, i, (+)(-1, j))), (getindex)(x, i, (+)(1, j))))) +:(function (x,) + let ˍ₋out = zeros(Float64, map(length, (1:5, 1:5))) + begin + ˍ₋out_1 = (view)(ˍ₋out, 1:5, 1:5) + ˍ₋out_1 .= 0 + ˍ₋out_2 = (view)(ˍ₋out, 2:4, 2:4) + for (j, j′) = zip(2:4, reset_to_one(2:4)) + for (i, i′) = zip(2:4, reset_to_one(2:4)) + ˍ₋out_2[i′, j′] = (+)(ˍ₋out_2[i′, j′], (*)(1//2, (+)((+)((+)((getindex)(x, (+)(-1, i), j), (getindex)(x, (+)(1, i), j)), (getindex)(x, i, (+)(-1, j))), (getindex)(x, i, (+)(1, j))))) + end end end + ˍ₋out end end) \ No newline at end of file diff --git a/test/build_function_tests/stencil-transpose-arrayop-inplace.jl b/test/build_function_tests/stencil-transpose-arrayop-inplace.jl index b16912590..ed58d0356 100644 --- a/test/build_function_tests/stencil-transpose-arrayop-inplace.jl +++ b/test/build_function_tests/stencil-transpose-arrayop-inplace.jl @@ -1,13 +1,10 @@ -:(function (x,) - let ˍ₋out = zeros(Float64, map(length, (1:6, 1:6))) - begin - ˍ₋out_1 = (view)(ˍ₋out, 2:5, 2:5) - for (j, j′) = zip(1:4, reset_to_one(1:4)) - for (i, i′) = zip(1:4, reset_to_one(1:4)) - ˍ₋out_1[i′, j′] = (+)(ˍ₋out_1[i′, j′], (getindex)(x, j, i)) - end +:(function (ˍ₋out, x) + begin + ˍ₋out_1 = (view)(ˍ₋out, 2:5, 2:5) + for (j, j′) = zip(1:4, reset_to_one(1:4)) + for (i, i′) = zip(1:4, reset_to_one(1:4)) + ˍ₋out_1[i′, j′] = (+)(ˍ₋out_1[i′, j′], (getindex)(x, j, i)) end end - ˍ₋out end end) \ No newline at end of file diff --git a/test/build_function_tests/stencil-transpose-arrayop-outplace.jl b/test/build_function_tests/stencil-transpose-arrayop-outplace.jl index ed58d0356..b16912590 100644 --- a/test/build_function_tests/stencil-transpose-arrayop-outplace.jl +++ b/test/build_function_tests/stencil-transpose-arrayop-outplace.jl @@ -1,10 +1,13 @@ -:(function (ˍ₋out, x) - begin - ˍ₋out_1 = (view)(ˍ₋out, 2:5, 2:5) - for (j, j′) = zip(1:4, reset_to_one(1:4)) - for (i, i′) = zip(1:4, reset_to_one(1:4)) - ˍ₋out_1[i′, j′] = (+)(ˍ₋out_1[i′, j′], (getindex)(x, j, i)) +:(function (x,) + let ˍ₋out = zeros(Float64, map(length, (1:6, 1:6))) + begin + ˍ₋out_1 = (view)(ˍ₋out, 2:5, 2:5) + for (j, j′) = zip(1:4, reset_to_one(1:4)) + for (i, i′) = zip(1:4, reset_to_one(1:4)) + ˍ₋out_1[i′, j′] = (+)(ˍ₋out_1[i′, j′], (getindex)(x, j, i)) + end end end + ˍ₋out end end) \ No newline at end of file diff --git a/test/build_function_tests/transpose-inplace.jl b/test/build_function_tests/transpose-inplace.jl index 3e139301e..7d9dc7671 100644 --- a/test/build_function_tests/transpose-inplace.jl +++ b/test/build_function_tests/transpose-inplace.jl @@ -1,12 +1,9 @@ -:(function (x,) - let ˍ₋out = zeros(Float64, map(length, (Base.OneTo(4), Base.OneTo(4)))) - begin - for (j, j′) = zip(1:4, reset_to_one(1:4)) - for (i, i′) = zip(1:4, reset_to_one(1:4)) - ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(x, j, i)) - end +:(function (ˍ₋out, x) + begin + for (j, j′) = zip(1:4, reset_to_one(1:4)) + for (i, i′) = zip(1:4, reset_to_one(1:4)) + ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(x, j, i)) end end - ˍ₋out end end) \ No newline at end of file diff --git a/test/build_function_tests/transpose-outplace.jl b/test/build_function_tests/transpose-outplace.jl index 7d9dc7671..3e139301e 100644 --- a/test/build_function_tests/transpose-outplace.jl +++ b/test/build_function_tests/transpose-outplace.jl @@ -1,9 +1,12 @@ -:(function (ˍ₋out, x) - begin - for (j, j′) = zip(1:4, reset_to_one(1:4)) - for (i, i′) = zip(1:4, reset_to_one(1:4)) - ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(x, j, i)) +:(function (x,) + let ˍ₋out = zeros(Float64, map(length, (Base.OneTo(4), Base.OneTo(4)))) + begin + for (j, j′) = zip(1:4, reset_to_one(1:4)) + for (i, i′) = zip(1:4, reset_to_one(1:4)) + ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(x, j, i)) + end end end + ˍ₋out end end) \ No newline at end of file diff --git a/test/build_function_tests/transpose-term-inplace.jl b/test/build_function_tests/transpose-term-inplace.jl index 3dcb4066e..7d9dc7671 100644 --- a/test/build_function_tests/transpose-term-inplace.jl +++ b/test/build_function_tests/transpose-term-inplace.jl @@ -1,3 +1,9 @@ -:(function (x,) - (adjoint)(x) +:(function (ˍ₋out, x) + begin + for (j, j′) = zip(1:4, reset_to_one(1:4)) + for (i, i′) = zip(1:4, reset_to_one(1:4)) + ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(x, j, i)) + end + end + end end) \ No newline at end of file diff --git a/test/build_function_tests/transpose-term-outplace.jl b/test/build_function_tests/transpose-term-outplace.jl index 7d9dc7671..3dcb4066e 100644 --- a/test/build_function_tests/transpose-term-outplace.jl +++ b/test/build_function_tests/transpose-term-outplace.jl @@ -1,9 +1,3 @@ -:(function (ˍ₋out, x) - begin - for (j, j′) = zip(1:4, reset_to_one(1:4)) - for (i, i′) = zip(1:4, reset_to_one(1:4)) - ˍ₋out[i′, j′] = (+)(ˍ₋out[i′, j′], (getindex)(x, j, i)) - end - end - end +:(function (x,) + (adjoint)(x) end) \ No newline at end of file