< prev index next >

test/jdk/jdk/incubator/vector/Byte512VectorTests.java

Print this page
rev 55594 : tests and benchmark changes


  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @modules jdk.incubator.vector
  27  * @run testng/othervm -ea -esa Byte512VectorTests
  28  */
  29 
  30 import jdk.incubator.vector.Vector.Shape;

  31 import jdk.incubator.vector.Vector;
  32 
  33 import jdk.incubator.vector.ByteVector;
  34 
  35 import org.testng.Assert;
  36 import org.testng.annotations.DataProvider;
  37 import org.testng.annotations.Test;
  38 
  39 import java.lang.Integer;
  40 import java.util.List;
  41 import java.util.function.BiFunction;
  42 import java.util.function.IntFunction;
  43 import java.util.stream.Collectors;
  44 import java.util.stream.Stream;
  45 
  46 @Test
  47 public class Byte512VectorTests extends AbstractVectorTest {
  48 
  49     static final ByteVector.ByteSpecies SPECIES =
  50                 ByteVector.species(Shape.S_512_BIT);
  51 
  52     static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
  53 
  54     interface FUnOp {
  55         byte apply(byte a);
  56     }
  57 
  58     static void assertArraysEquals(byte[] a, byte[] r, FUnOp f) {
  59         int i = 0;
  60         try {
  61             for (; i < a.length; i++) {
  62                 Assert.assertEquals(r[i], f.apply(a[i]));
  63             }
  64         } catch (AssertionError e) {
  65             Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]);
  66         }
  67     }
  68 
  69     static void assertArraysEquals(byte[] a, byte[] r, boolean[] mask, FUnOp f) {
  70         int i = 0;




  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @modules jdk.incubator.vector
  27  * @run testng/othervm -ea -esa Byte512VectorTests
  28  */
  29 
  30 import jdk.incubator.vector.Vector.Shape;
  31 import jdk.incubator.vector.Vector.Species;
  32 import jdk.incubator.vector.Vector;
  33 
  34 import jdk.incubator.vector.ByteVector;
  35 
  36 import org.testng.Assert;
  37 import org.testng.annotations.DataProvider;
  38 import org.testng.annotations.Test;
  39 
  40 import java.lang.Integer;
  41 import java.util.List;
  42 import java.util.function.BiFunction;
  43 import java.util.function.IntFunction;
  44 import java.util.stream.Collectors;
  45 import java.util.stream.Stream;
  46 
  47 @Test
  48 public class Byte512VectorTests extends AbstractVectorTest {
  49 
  50     static final Species<Byte> SPECIES =
  51                 ByteVector.SPECIES_512;
  52 
  53     static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
  54 
  55     interface FUnOp {
  56         byte apply(byte a);
  57     }
  58 
  59     static void assertArraysEquals(byte[] a, byte[] r, FUnOp f) {
  60         int i = 0;
  61         try {
  62             for (; i < a.length; i++) {
  63                 Assert.assertEquals(r[i], f.apply(a[i]));
  64             }
  65         } catch (AssertionError e) {
  66             Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]);
  67         }
  68     }
  69 
  70     static void assertArraysEquals(byte[] a, byte[] r, boolean[] mask, FUnOp f) {
  71         int i = 0;


< prev index next >