1 /*
2 * Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
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 any
21 * questions.
22 */
70 import java.util.Arrays;
71 import java.util.function.BiFunction;
72 import java.util.function.IntFunction;
73 import java.util.Objects;
74 import java.util.stream.Collectors;
75 import java.util.stream.Stream;
76
77 @Test
78 public class $vectorteststype$ extends AbstractVectorTest {
79
80 #if[MaxBit]
81 static final VectorSpecies<$Wideboxtype$> SPECIES =
82 $Type$Vector.SPECIES_MAX;
83 #else[MaxBit]
84 static final VectorSpecies<$Wideboxtype$> SPECIES =
85 $Type$Vector.SPECIES_$bits$;
86 #end[MaxBit]
87
88 static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
89
90 #if[MaxBit]
91 static VectorShape getMaxBit() {
92 return VectorShape.S_Max_BIT;
93 }
94
95 private static final int Max = 256; // juts so we can do N/$bits$
96 #end[MaxBit]
97
98 #if[BITWISE]
99 private static final $type$ CONST_SHIFT = $Boxtype$.SIZE / 2;
100 #end[BITWISE]
101 #if[FP]
102 // for floating point addition reduction ops that may introduce rounding errors
103 private static final $type$ RELATIVE_ROUNDING_ERROR_FACTOR_ADD = ($type$)10.0;
104
105 // for floating point multiplication reduction ops that may introduce rounding errors
106 private static final $type$ RELATIVE_ROUNDING_ERROR_FACTOR_MUL = ($type$)50.0;
107 #end[FP]
108
109 static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / $bits$);
|
1 /*
2 * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
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 any
21 * questions.
22 */
70 import java.util.Arrays;
71 import java.util.function.BiFunction;
72 import java.util.function.IntFunction;
73 import java.util.Objects;
74 import java.util.stream.Collectors;
75 import java.util.stream.Stream;
76
77 @Test
78 public class $vectorteststype$ extends AbstractVectorTest {
79
80 #if[MaxBit]
81 static final VectorSpecies<$Wideboxtype$> SPECIES =
82 $Type$Vector.SPECIES_MAX;
83 #else[MaxBit]
84 static final VectorSpecies<$Wideboxtype$> SPECIES =
85 $Type$Vector.SPECIES_$bits$;
86 #end[MaxBit]
87
88 static final int INVOC_COUNT = Integer.getInteger("jdk.incubator.vector.test.loop-iterations", 100);
89
90 static $abstractvectortype$ bcast_vec = $abstractvectortype$.broadcast(SPECIES, ($type$)10);
91
92 #if[MaxBit]
93 static VectorShape getMaxBit() {
94 return VectorShape.S_Max_BIT;
95 }
96
97 private static final int Max = 256; // juts so we can do N/$bits$
98 #end[MaxBit]
99
100 #if[BITWISE]
101 private static final $type$ CONST_SHIFT = $Boxtype$.SIZE / 2;
102 #end[BITWISE]
103 #if[FP]
104 // for floating point addition reduction ops that may introduce rounding errors
105 private static final $type$ RELATIVE_ROUNDING_ERROR_FACTOR_ADD = ($type$)10.0;
106
107 // for floating point multiplication reduction ops that may introduce rounding errors
108 private static final $type$ RELATIVE_ROUNDING_ERROR_FACTOR_MUL = ($type$)50.0;
109 #end[FP]
110
111 static final int BUFFER_REPS = Integer.getInteger("jdk.incubator.vector.test.buffer-vectors", 25000 / $bits$);
|