< prev index next >

test/jdk/jdk/incubator/vector/templates/Perf-Scalar-Reduction-Min-op.template

Print this page
rev 55606 : 8221812: Fine-tune jmh test for vector api
Summary: To compare performance of vector api and auto vectorization, vector
api and scalar test cases are updated to keep aligned.
Reviewed-by: duke

@@ -1,10 +1,13 @@
 
     @Benchmark
-    public $type$ [[TEST]][[TEST_TYPE]][[OP_NAME]]() {
+    public void [[TEST]][[TEST_TYPE]][[OP_NAME]](Blackhole bh) {
         $type$[] as = fa.apply(size);
         $type$ r = [[TEST_INIT]];
+        for (int ic = 0; ic < INVOC_COUNT; ic++) {
+            r = [[TEST_INIT]];
         for (int i = 0; i < as.length; i++) {
             r = ($type$)Math.min(r, as[i]);
         }
-        return r;
+        }
+        bh.consume(r);
     }
< prev index next >