aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Ogden <benie.ogden@linaro.org>2014-07-01 08:17:19 +0100
committerBernard Ogden <benie.ogden@linaro.org>2014-07-03 06:51:00 +0100
commite204f6d55faa64dada885318a1e404f64f6a389e (patch)
tree759ad4c4b198775692e9f3864bc95c825e2ea862
parent74b9922b587668b5cfb0e187699528223acc96b8 (diff)
More control over ranges and step size
-rw-r--r--scripts/bench.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/scripts/bench.py b/scripts/bench.py
index 8537f0b..b6efcc9 100644
--- a/scripts/bench.py
+++ b/scripts/bench.py
@@ -136,22 +136,31 @@ def run_top(cache):
#Syntax: python ../cortex-strings/scripts/bench.py -f bounce memcpy -v this glibc
parser.add_argument("-v", "--variants", nargs="+", help="library variant to run (run all if not specified)", default = VARIANTS, choices = VARIANTS)
parser.add_argument("-f", "--functions", nargs="+", help="function to run (run all if not specified)", default = FUNCTIONS, choices = FUNCTIONS)
- parser.add_argument("-l", "--limit", type=int, help="upper limit to test to (in bytes)", default = 512*1024)
+ parser.add_argument("-u", "--upper", type=int, help="upper limit to test to (in bytes)", default = 512*1024)
+ parser.add_argument("-l", "--lower", type=int, help="lowest block size to test (bytes)", default = 0)
+ parser.add_argument("-s", "--steps", nargs="+", help="steps to test powers of", default = ['1.4', '2.0'])
parser.add_argument("-p", "--prefix", help="path to executables, relative to CWD", default=".")
parser.add_argument("-d", "--dry-run", help="Dry run: just print the invocations that we would use", default=False, action="store_true")
args = parser.parse_args()
+ if(args.lower >= args.upper):
+ raise Exception("Range starts after it ends!")
+
global build, DRY_RUN
build = args.prefix
DRY_RUN = args.dry_run
bytes = []
- #Test powers of 2.0, 1.4
- for step in [2.0, 1.4]:
- # Figure out how many steps get us up to the top
- steps = int(round(math.log(args.limit) / math.log(step)))
- bytes.extend([int(step**x) for x in range(0, steps+1)])
+ #Test powers of steps
+ for step in args.steps:
+ if step[0] == '+':
+ step = int(step[1:])
+ bytes.extend(range(args.lower, args.upper + step, step))
+ else:
+ step = float(step)
+ steps = int(round(math.log(args.upper - args.lower, step)))
+ bytes.extend([args.lower - 1 + int(step**x) for x in range(steps+1)])
run_many(cache, args.variants, bytes, args.functions)