public MinusBenchmark(VectorBenchmarks mark) {
this.mark = mark;
}
public void benchmark() {
mark.printStats(mark.getRunner().benchmark(new BenchmarkFn() {
@Override
public Boolean apply(Integer i) {
Vector v = mark.vectors[0][mark.vIndex(i)].minus(mark.vectors[0][mark.vIndex(randIndex())]);
return depends(v);
}
}), MINUS, DENSE_VECTOR);
mark.printStats(mark.getRunner().benchmark(new BenchmarkFn() {
@Override
public Boolean apply(Integer i) {
Vector v = mark.vectors[1][mark.vIndex(i)].minus(mark.vectors[1][mark.vIndex(randIndex())]);
return depends(v);
}
}), MINUS, RAND_SPARSE_VECTOR);
mark.printStats(mark.getRunner().benchmark(new BenchmarkFn() {
@Override
public Boolean apply(Integer i) {
Vector v = mark.vectors[2][mark.vIndex(i)].minus(mark.vectors[2][mark.vIndex(randIndex())]);
return depends(v);
}
}), MINUS, SEQ_SPARSE_VECTOR);
mark.printStats(mark.getRunner().benchmark(new BenchmarkFn() {
@Override
public Boolean apply(Integer i) {
Vector v = mark.vectors[0][mark.vIndex(i)].minus(mark.vectors[1][mark.vIndex(randIndex())]);
return depends(v);
}
}), MINUS, DENSE_FN_RAND);
mark.printStats(mark.getRunner().benchmark(new BenchmarkFn() {
@Override
public Boolean apply(Integer i) {
Vector v = mark.vectors[0][mark.vIndex(i)].minus(mark.vectors[2][mark.vIndex(randIndex())]);
return depends(v);
}
}), MINUS, DENSE_FN_SEQ);
mark.printStats(mark.getRunner().benchmark(new BenchmarkFn() {
@Override
public Boolean apply(Integer i) {
Vector v = mark.vectors[1][mark.vIndex(i)].minus(mark.vectors[0][mark.vIndex(randIndex())]);
return depends(v);
}
}), MINUS, RAND_FN_DENSE);
mark.printStats(mark.getRunner().benchmark(new BenchmarkFn() {
@Override
public Boolean apply(Integer i) {
Vector v = mark.vectors[1][mark.vIndex(i)].minus(mark.vectors[2][mark.vIndex(randIndex())]);
return depends(v);
}
}), MINUS, RAND_FN_SEQ);
mark.printStats(mark.getRunner().benchmark(new BenchmarkFn() {
@Override
public Boolean apply(Integer i) {
Vector v = mark.vectors[2][mark.vIndex(i)].minus(mark.vectors[0][mark.vIndex(randIndex())]);
return depends(v);
}
}), MINUS, SEQ_FN_DENSE);
mark.printStats(mark.getRunner().benchmark(new BenchmarkFn() {
@Override
public Boolean apply(Integer i) {
Vector v = mark.vectors[2][mark.vIndex(i)].minus(mark.vectors[1][mark.vIndex(randIndex())]);
return depends(v);
}