@@ -0,0 +1,2769 @@
+/**%0A * Copyright (c) 2016 - 2017 Syncleus, Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.aparapi.runtime;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0A%0A    import com.aparapi.Kernel;%0A    import com.aparapi.Range;%0A%0Apublic class MultiDimensionalLocalArrayTest%0A%7B%0A    @Test%0A    public void passingTest()%0A    %7B%0A        final int SIZE = 16;%0A        final float%5B%5D RESULT = new float%5B%5D %7B1%7D;%0A        Kernel kernel = new Kernel()%0A        %7B%0A            @Local%0A            final float%5B%5D localArray = new float%5BSIZE*SIZE%5D;%0A%0A            @Override%0A            public void run()%0A            %7B%0A                int row = getGlobalId(0);%0A                int column = getGlobalId(1);%0A                localArray%5Brow + column*SIZE%5D = row + column;%0A                localBarrier();%0A                float value = 0;%0A                for (int x = 0; x %3C SIZE; x++)%0A                %7B%0A                    for (int y = 0; y %3C SIZE; y++)%0A                    %7B%0A                        value += localArray%5Bx + y*SIZE%5D;%0A                    %7D%0A                %7D%0A                RESULT%5B0%5D = value;%0A            %7D%0A        %7D;%0A        kernel.execute(Range.create2D(SIZE, SIZE, SIZE, SIZE));%0A        assertEquals(3840, RESULT%5B0%5D, 1E-6F);%0A    %7D%0A%0A    @Ignore(%22Known bug, ignoring until fixed%22)%0A    @Test%0A    public void crashingTest()%0A    %7B%0A        final int SIZE = 16;%0A        final float%5B%5D RESULT = new float%5B%5D %7B1%7D;%0A        Kernel kernel = new Kernel()%0A        %7B%0A            @Local%0A            final float%5B%5D%5B%5D localArray = new float%5BSIZE%5D%5BSIZE%5D;%0A%0A            @Override%0A            public void run()%0A            %7B%0A                int row = getGlobalId(0);%0A                int column = getGlobalId(1);%0A                localArray%5Brow%5D%5Bcolumn%5D = row + column;%0A                localBarrier();%0A                float value = 0;%0A                for (int x = 0; x %3C SIZE; x++)%0A                %7B%0A                    for (int y = 0; y %3C SIZE; y++)%0A                    %7B%0A                        value += localArray%5Bx%5D%5By%5D;%0A                    %7D%0A                %7D%0A                RESULT%5B0%5D = value;%0A            %7D%0A        %7D;%0A        kernel.execute(Range.create2D(SIZE, SIZE, SIZE, SIZE));%0A        assertEquals(3840, RESULT%5B0%5D, 1E-6F);%0A    %7D%0A%7D%0A

add test demonstrating multidimensional local array crash.