-
-
Notifications
You must be signed in to change notification settings - Fork 451
Open
Description
Right now, if you write a simple loop using the Vector API like this:
import jdk.incubator.vector.DoubleVector;
import jdk.incubator.vector.VectorSpecies;
import jdk.incubator.vector.VectorOperators;
import java.util.random.RandomGenerator;
import java.util.random.RandomGeneratorFactory;
final class Main {
private static final RandomGenerator rng = RandomGeneratorFactory.getDefault().create(System.nanoTime());
private static final VectorSpecies<Double> species = DoubleVector.SPECIES_PREFERRED;
public static void main(final String[] args){
final int length = 100_000;
final double[] v = new double[length];
for(int i=0; i<length; i++) {
v[i] = rng.nextDouble(-1.0, 1.0);
}
DoubleVector s = DoubleVector.broadcast(species, 0.0);
for(int i=0; i<species.loopBound(length); i += species.length()) {
final DoubleVector vi = DoubleVector.fromArray(species, v, i);
s = s.add(vi);
}
System.out.println(s.reduceLanes(VectorOperators.ADD));
}
}
JitWatch will show you nothing: not even the source code or the bytecode.
Do you have any plans to support it?
ericek111
Metadata
Metadata
Assignees
Labels
No labels