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 Long64VectorTests
28 */
29
30 import jdk.incubator.vector.Vector.Shape;
31 import jdk.incubator.vector.Vector;
32
33 import jdk.incubator.vector.LongVector;
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.Arrays;
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 Long64VectorTests extends AbstractVectorTest {
49
50 static final LongVector.LongSpecies SPECIES =
51 LongVector.species(Shape.S_64_BIT);
52
53 static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
54
55 interface FUnOp {
56 long apply(long a);
57 }
58
59 static void assertArraysEquals(long[] a, long[] 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(long[] a, long[] r, boolean[] mask, FUnOp f) {
71 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 Long64VectorTests
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.LongVector;
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.Arrays;
43 import java.util.function.BiFunction;
44 import java.util.function.IntFunction;
45 import java.util.stream.Collectors;
46 import java.util.stream.Stream;
47
48 @Test
49 public class Long64VectorTests extends AbstractVectorTest {
50
51 static final Species<Long> SPECIES =
52 LongVector.SPECIES_64;
53
54 static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
55
56 interface FUnOp {
57 long apply(long a);
58 }
59
60 static void assertArraysEquals(long[] a, long[] r, FUnOp f) {
61 int i = 0;
62 try {
63 for (; i < a.length; i++) {
64 Assert.assertEquals(r[i], f.apply(a[i]));
65 }
66 } catch (AssertionError e) {
67 Assert.assertEquals(r[i], f.apply(a[i]), "at index #" + i + ", input = " + a[i]);
68 }
69 }
70
71 static void assertArraysEquals(long[] a, long[] r, boolean[] mask, FUnOp f) {
72 int i = 0;
|