Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: pydir/szbuild_spec2k.py

Issue 1472833006: Subzero: Add "szbuild_spec2k.py --run" option. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python2 1 #!/usr/bin/env python2
2 2
3 import argparse 3 import argparse
4 import os 4 import os
5 import sys 5 import sys
6 6
7 import szbuild 7 import szbuild
8 8
9 from utils import FindBaseNaCl 9 from utils import FindBaseNaCl, shellcmd
10 10
11 def main(): 11 def main():
12 """Build native gcc-style executables for one or all Spec2K components. 12 """Build native gcc-style executables for one or all Spec2K components.
13 13
14 Afterwards, the executables can be run from the 14 Afterwards, the executables can be run from the
15 native_client/tests/spec2k/ directory as: 15 native_client/tests/spec2k/ directory as:
16 './run_all.sh RunBenchmarks SetupGccX8632Opt {train|ref} ...' 16 './run_all.sh RunBenchmarks SetupGccX8632Opt {train|ref} ...'
17 -- or -- 17 -- or --
18 './run_all.sh RunBenchmarks SetupPnaclX8632Opt {train|ref} ...' 18 './run_all.sh RunBenchmarks SetupPnaclX8632Opt {train|ref} ...'
19 """ 19 """
20 nacl_root = FindBaseNaCl() 20 nacl_root = FindBaseNaCl()
21 # Use the same default ordering as spec2k/run_all.sh. 21 # Use the same default ordering as spec2k/run_all.sh.
22 components = [ '177.mesa', '179.art', '183.equake', '188.ammp', '164.gzip', 22 components = [ '177.mesa', '179.art', '183.equake', '188.ammp', '164.gzip',
23 '175.vpr', '176.gcc', '181.mcf', '186.crafty', '197.parser', 23 '175.vpr', '176.gcc', '181.mcf', '186.crafty', '197.parser',
24 '253.perlbmk', '254.gap', '255.vortex', '256.bzip2', 24 '253.perlbmk', '254.gap', '255.vortex', '256.bzip2',
25 '300.twolf', '252.eon' ] 25 '300.twolf', '252.eon' ]
26 26
27 argparser = argparse.ArgumentParser(description=main.__doc__) 27 argparser = argparse.ArgumentParser(description=main.__doc__)
28 szbuild.AddOptionalArgs(argparser) 28 szbuild.AddOptionalArgs(argparser)
29 argparser.add_argument('--run', dest='run', action='store_true',
30 help='Run after building')
29 argparser.add_argument('comps', nargs='*', default=components) 31 argparser.add_argument('comps', nargs='*', default=components)
30 args = argparser.parse_args() 32 args = argparser.parse_args()
31 bad = set(args.comps) - set(components) 33 bad = set(args.comps) - set(components)
32 if bad: 34 if bad:
33 print 'Unknown component{s}: '.format(s='s' if len(bad) > 1 else '') + \ 35 print 'Unknown component{s}: '.format(s='s' if len(bad) > 1 else '') + \
34 ' '.join(x for x in bad) 36 ' '.join(x for x in bad)
35 sys.exit(1) 37 sys.exit(1)
36 38
37 # Fix up Subzero target strings for the run_all.sh script. 39 # Fix up Subzero target strings for the run_all.sh script.
38 target_map = { 40 target_map = {
(...skipping 11 matching lines...) Expand all
50 if name[0] == '.': 52 if name[0] == '.':
51 name = name[1:] 53 name = name[1:]
52 szbuild.ProcessPexe(args, 54 szbuild.ProcessPexe(args,
53 ('{root}/tests/spec2k/{comp}/' + 55 ('{root}/tests/spec2k/{comp}/' +
54 '{name}.opt.stripped.pexe' 56 '{name}.opt.stripped.pexe'
55 ).format(root=nacl_root, comp=comp, name=name), 57 ).format(root=nacl_root, comp=comp, name=name),
56 ('{root}/tests/spec2k/{comp}/' + 58 ('{root}/tests/spec2k/{comp}/' +
57 '{name}.{suffix}' 59 '{name}.{suffix}'
58 ).format(root=nacl_root, comp=comp, name=name, 60 ).format(root=nacl_root, comp=comp, name=name,
59 suffix=suffix)) 61 suffix=suffix))
62 if args.run:
63 os.chdir('{root}/tests/spec2k'.format(root=FindBaseNaCl()))
64 setup = 'SetupGcc' + {
65 'arm32': 'Arm',
66 'x8632': 'X8632'}[args.target] + 'Opt'
67 shellcmd(['./run_all.sh',
68 'RunTimedBenchmarks',
69 setup,
70 'train'] + args.comps)
60 71
61 if __name__ == '__main__': 72 if __name__ == '__main__':
62 main() 73 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698