< prev index next >

test/jdk/jdk/incubator/vector/templates/Perf-Scalar-Reduction-Max-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 **** @Benchmark ! public $type$ [[TEST]][[TEST_TYPE]][[OP_NAME]]() { $type$[] as = fa.apply(size); $type$ r = [[TEST_INIT]]; for (int i = 0; i < as.length; i++) { r = ($type$)Math.max(r, as[i]); } ! return r; } --- 1,13 ---- @Benchmark ! 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.max(r, as[i]); } ! } ! bh.consume(r); }
< prev index next >