Skip to content

Commit

Permalink
fix benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
Quafadas committed Oct 4, 2024
1 parent 0cdc3ca commit 9af60ba
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion benchmark/src/Benchmark.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.util.concurrent.TimeUnit;
@OutputTimeUnit(TimeUnit.SECONDS)
@State(Scope.Thread)
@Fork(value = 1)
@Warmup(iterations = 3)
@Warmup(iterations = 1)
@Measurement(iterations = 3)
abstract class BLASBenchmark:

Expand Down
2 changes: 1 addition & 1 deletion benchmark/src/and.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.openjdk.jmh.infra.Blackhole
// import vecxt.Matrix.*
import vecxt.BoundsCheck
import scala.compiletime.uninitialized
import vecxt.*
import vecxt.all.*
import jdk.incubator.vector.VectorSpecies
import jdk.incubator.vector.VectorOperators
import jdk.incubator.vector.DoubleVector
Expand Down
2 changes: 1 addition & 1 deletion benchmark/src/countTrue.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.openjdk.jmh.infra.Blackhole
// import vecxt.Matrix.*
import vecxt.BoundsCheck
import scala.compiletime.uninitialized
import vecxt.*
import vecxt.all.*
import jdk.incubator.vector.VectorSpecies
import jdk.incubator.vector.VectorOperators
import jdk.incubator.vector.DoubleVector
Expand Down
2 changes: 1 addition & 1 deletion benchmark/src/increments.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.openjdk.jmh.infra.Blackhole
// import vecxt.Matrix.*
import vecxt.BoundsCheck
import scala.compiletime.uninitialized
import vecxt.*
import vecxt.all.*
import jdk.incubator.vector.VectorSpecies
import jdk.incubator.vector.VectorOperators
import jdk.incubator.vector.DoubleVector
Expand Down
14 changes: 7 additions & 7 deletions benchmark/src/logical.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.openjdk.jmh.infra.Blackhole
// import vecxt.Matrix.*
import vecxt.BoundsCheck
import scala.compiletime.uninitialized
import vecxt.*
import vecxt.all.*
import jdk.incubator.vector.VectorSpecies
import jdk.incubator.vector.VectorOperators
import jdk.incubator.vector.DoubleVector
Expand All @@ -42,12 +42,12 @@ class LogicalBenchmark extends BLASBenchmark:
var len: String = uninitialized;

var arr: Array[Double] = uninitialized


// format: off
@Setup(Level.Trial)
def setup: Unit =
arr = randomDoubleArray(len.toInt);
arr = randomDoubleArray(len.toInt);
()
end setup

Expand All @@ -68,14 +68,14 @@ class LogicalBenchmark extends BLASBenchmark:
val r = arr <= 4.0
bh.consume(r);
end lte_vec



@Benchmark
def lte_loop(bh: Blackhole) =
val r = arr.lte2(4.0)
bh.consume(r);
end lte_loop

end LogicalBenchmark

3 changes: 2 additions & 1 deletion benchmark/src/matmul.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ package vecxt.benchmark

import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import vecxt.Matrix.*
import vecxt.all.*
import vecxt.BoundsCheck
import scala.compiletime.uninitialized
import BoundsCheck.DoBoundsCheck.no

@State(Scope.Thread)
class DgemmBenchmark extends BLASBenchmark:

Expand Down
2 changes: 1 addition & 1 deletion benchmark/src/or.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.openjdk.jmh.infra.Blackhole
// import vecxt.Matrix.*
import vecxt.BoundsCheck
import scala.compiletime.uninitialized
import vecxt.*
import vecxt.all.*
import jdk.incubator.vector.VectorSpecies
import jdk.incubator.vector.VectorOperators
import jdk.incubator.vector.DoubleVector
Expand Down
4 changes: 2 additions & 2 deletions benchmark/src/sum.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.openjdk.jmh.infra.Blackhole
// import vecxt.Matrix.*
import vecxt.BoundsCheck
import scala.compiletime.uninitialized
import vecxt.*
import vecxt.all.*
import jdk.incubator.vector.VectorSpecies
import jdk.incubator.vector.VectorOperators
import jdk.incubator.vector.DoubleVector
Expand Down Expand Up @@ -58,7 +58,7 @@ class SumBenchmark extends BLASBenchmark:
inline def sum2 =
var sum: Double = 0.0
var i: Int = 0
val sp = Matrix.Matrix.doubleSpecies
val sp = Matrix.doubleSpecies
val l = sp.length()

while i < sp.loopBound(vec.length) do
Expand Down
3 changes: 1 addition & 2 deletions benchmark/src/vectorAddition.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ package vecxt.benchmark

import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import vecxt.Matrix.*
import jdk.incubator.vector.DoubleVector
import vecxt.*
import vecxt.all.*
import scala.compiletime.uninitialized

// format: off
Expand Down

0 comments on commit 9af60ba

Please sign in to comment.