diff options
author | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-06-07 10:15:32 +0000 |
---|---|---|
committer | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-06-07 10:15:32 +0000 |
commit | e67f56076624ea83383901934a30280d7f97380f (patch) | |
tree | a28b45d7a79ff9002735ea225b3a4733ac4d0234 /test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallQuickStop.scala | |
parent | dd396886d0da88326e5e4772af4d8813360ea8a5 (diff) | |
download | scala-e67f56076624ea83383901934a30280d7f97380f.tar.gz scala-e67f56076624ea83383901934a30280d7f97380f.tar.bz2 scala-e67f56076624ea83383901934a30280d7f97380f.zip |
Adding parallel collections to trunk.
sabbus also edited to add parallel collections to the library jar - review by phaller
Diffstat (limited to 'test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallQuickStop.scala')
-rw-r--r-- | test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallQuickStop.scala | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallQuickStop.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallQuickStop.scala new file mode 100644 index 0000000000..310105dd41 --- /dev/null +++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForallQuickStop.scala @@ -0,0 +1,46 @@ +package scala.collection.parallel.benchmarks.parallel_array + + +import scala.collection.parallel.benchmarks._ + + +object ForallQuickStop extends Companion { + def benchName = "forall-quickstop"; + def apply(sz: Int, parallelism: Int, what: String) = new ForallQuickStop(sz, parallelism, what) + override def defaultSize = 200000 + + val pred = (a: Cont) => a.in != 50 + val predjsr = new extra166y.Ops.Predicate[Cont] { + def op(a: Cont) = a.in != 50 + } +} + +class ForallQuickStop(sz: Int, p: Int, what: String) +extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) +with HavingResult[Boolean] { + def companion = ForallQuickStop + + def runpar = runresult = pa.forall(ForallQuickStop.pred) + def runseq = runresult = sequentialForall(ForallQuickStop.pred, sz) + def comparisonMap = collection.Map() +} + + + + + + + + + + + + + + + + + + + + |