#! /usr/bin/env perl # experiment 04: dynamic parallelism vs other approaches (1 thread block or 1 # host stream / bunch) do "../common.pl"; # test parameters $step = 4000; $ntries = 5; init_exp(); #output file $out_file = "./exp-04.csv"; open(CSV, ">", $out_file) or die "cannot open $out_file: $!"; for($nhits = $step; $nhits < $max_nhits; $nhits += $step) { run_test("-Bhstream -b2000"); $hstream_time = $avg_time; $hstream_perf = $perf; run_test("-Btblock -b1000"); $tblock_time = $avg_time; $tblock_perf = $perf; run_test("-Bdyn -b1000"); $dyn_time = $avg_time; $dyn_perf = $perf; $str = sprintf "%6d %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f\n", $nhits, $hstream_time, $tblock_time, $dyn_time, $hstream_perf, $tblock_perf, $dyn_perf; printf CSV "%s", $str; printf "%s", $str; } close CSV;