summaryrefslogtreecommitdiff
path: root/scripts/benchmark/benchmark_all.py
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-12-31 16:02:46 +0100
committerCedric Nugteren <web@cedricnugteren.nl>2017-12-31 16:02:46 +0100
commitb4c8e1d9a5804358d6ae350111c85405c3183807 (patch)
treea570d118d2ac0550a1c923a84e1a65e763180779 /scripts/benchmark/benchmark_all.py
parent936cf2668d478853e80dcde9955ecc07cb13f274 (diff)
Made plotting script more flexible: extra argument to set the comparison library
Diffstat (limited to 'scripts/benchmark/benchmark_all.py')
-rw-r--r--scripts/benchmark/benchmark_all.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/benchmark/benchmark_all.py b/scripts/benchmark/benchmark_all.py
index 9bf09190..2a7f6c9a 100644
--- a/scripts/benchmark/benchmark_all.py
+++ b/scripts/benchmark/benchmark_all.py
@@ -10,7 +10,7 @@ import argparse
import os
import sys
-from benchmark import benchmark_single
+from benchmark import benchmark_single, COMPARISONS
BENCHMARKS = ["axpy", "gemv", "gemm", "summary", "axpybatched", "gemmbatched"]
@@ -18,6 +18,7 @@ BENCHMARKS = ["axpy", "gemv", "gemm", "summary", "axpybatched", "gemmbatched"]
def parse_arguments(argv):
parser = argparse.ArgumentParser(description="Runs all (main) benchmarks in one go for a given device")
+ parser.add_argument("-c", "--comparisons", default=[], nargs='+', help="The library(s) to compare against (choose from %s)" % COMPARISONS)
parser.add_argument("-p", "--platform", required=True, type=int, help="The ID of the OpenCL platform to test on")
parser.add_argument("-d", "--device", required=True, type=int, help="The ID of the OpenCL device to test on")
parser.add_argument("-x", "--precision", type=int, default=32, help="The precision to test for (choose from 16, 32, 64, 3232, 6464")
@@ -29,12 +30,12 @@ def parse_arguments(argv):
return vars(cl_args)
-def benchmark_all(platform, device, precision, load_from_disk,
+def benchmark_all(comparisons, platform, device, precision, load_from_disk,
plot_title, output_folder, verbose):
for bench in BENCHMARKS:
from_disk = load_from_disk
for tight_plot in [True, False]: # two plots for a single benchmark
- benchmark_single(bench, platform, device, None, precision, from_disk,
+ benchmark_single(bench, comparisons, platform, device, None, precision, from_disk,
plot_title, tight_plot, output_folder, verbose)
from_disk = True # for the next plot of the same data