Skip to content

Commit a7a5a78

Browse files
update: restore boolUnaryOpProvider for reduction/Unit-BoolReduction-op.template
1 parent d058aef commit a7a5a78

3 files changed

Lines changed: 13 additions & 16 deletions

File tree

test/jdk/jdk/incubator/vector/AbstractVectorTest.java

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -110,27 +110,18 @@ static int[] fillInts(int[] a, IntOp f) {
110110
}
111111

112112
static final List<IntFunction<boolean[]>> BOOLEAN_MASK_GENERATORS = List.of(
113-
withToString("mask[i % 2]", (int l) -> {
114-
return fill_boolean(l,
113+
withToString("mask[i % 2]", (int s) -> {
114+
return fill_boolean(s,
115115
i -> ((i % 2) == 0));
116116
}),
117-
withToString("mask[i % 5]", (int l) -> {
118-
return fill_boolean(l,
119-
i -> ((i % 5) == 0));
120-
}),
121-
122-
withToString("mask[true]", (int l) -> {
123-
boolean[] a = new boolean[l];
117+
withToString("mask[true]", (int s) -> {
118+
boolean[] a = new boolean[s];
124119
Arrays.fill(a, true);
125120
return a;
126121
}),
127122
withToString("mask[false]", boolean[]::new),
128-
withToString("mask[random]", (int l) -> {
129-
boolean[] a = new boolean[l];
130-
for (int i = 0; i < l; i++) {
131-
a[i] = RAND.nextBoolean();
132-
}
133-
return a;
123+
withToString("mask[random]", (int s) -> {
124+
return fill_boolean(s,_i -> RAND.nextBoolean());
134125
})
135126
);
136127

test/jdk/jdk/incubator/vector/templates/Unit-BoolReduction-op.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
@Test(dataProvider = "boolMaskUnaryOpProvider")
2+
@Test(dataProvider = "boolUnaryOpProvider")
33
static void [[TEST]]$vectorteststype$(IntFunction<boolean[]> fm) {
44
[[KERNEL]]
55
assertReductionBoolArraysEquals(r, mask, $vectorteststype$::[[TEST]]);

test/jdk/jdk/incubator/vector/templates/Unit-header.template

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,12 @@ relativeError));
13901390
.collect(Collectors.toList());
13911391

13921392
#end[!FP]
1393+
@DataProvider
1394+
public Object[][] boolUnaryOpProvider() {
1395+
return BOOL_ARRAY_GENERATORS.stream().
1396+
map(f -> new Object[]{f}).
1397+
toArray(Object[][]::new);
1398+
}
13931399

13941400
static final List<List<IntFunction<$type$[]>>> $TYPE$_GENERATOR_TRIPLES =
13951401
$TYPE$_GENERATOR_PAIRS.stream().

0 commit comments

Comments
 (0)