~linaro-toolchain-dev/cortex-strings/trunk

« back to all changes in this revision

Viewing changes to scripts/bench.py

  • Committer: Will Newton
  • Date: 2013-06-14 09:20:08 UTC
  • Revision ID: will.newton@linaro.org-20130614092008-3am3v7itqy544uch
Allow running a subset of benchmarks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
 
60
60
    return took
61
61
 
62
 
def run_many(cache, variants, bytes, alignments):
 
62
def run_many(cache, variants, bytes, alignments, all_functions):
63
63
    # We want the data to come out in a useful order.  So fix an
64
64
    # alignment and function, and do all sizes for a variant first
65
65
    bytes = sorted(bytes)
66
66
    mid = bytes[len(bytes)/2]
67
67
 
68
 
    # Use the ordering in 'this' as the default
69
 
    all_functions = HAS['this'].split()
 
68
    if not all_functions:
 
69
        # Use the ordering in 'this' as the default
 
70
        all_functions = HAS['this'].split()
70
71
 
71
 
    # Find all other functions
72
 
    for functions in HAS.values():
73
 
        for function in functions.split():
74
 
            if function not in all_functions:
75
 
                all_functions.append(function)
 
72
        # Find all other functions
 
73
        for functions in HAS.values():
 
74
            for function in functions.split():
 
75
                if function not in all_functions:
 
76
                    all_functions.append(function)
76
77
 
77
78
    for alignment in alignments:
78
79
        for function in all_functions:
104
105
 
105
106
def run_top(cache):
106
107
    variants = sorted(HAS.keys())
 
108
    functions = sys.argv[1:]
107
109
 
108
110
    # Upper limit in bytes to test to
109
111
    top = 512*1024
122
124
 
123
125
    alignments = [8, 16, 4, 1, 2, 32]
124
126
 
125
 
    run_many(cache, variants, bytes, alignments)
 
127
    run_many(cache, variants, bytes, alignments, functions)
126
128
 
127
129
def main():
128
130
    cachename = 'cache.txt'