From 8f768633ad1f48aeefe948abc3e50fd7c2cd097e Mon Sep 17 00:00:00 2001 From: Dmitry Babokin Date: Wed, 13 Nov 2013 15:07:21 +0400 Subject: [PATCH] Make perf.py changes work as part of alloy.py --- alloy.py | 1 + perf.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/alloy.py b/alloy.py index 51aec82b..478895b7 100755 --- a/alloy.py +++ b/alloy.py @@ -495,6 +495,7 @@ def validation_run(only, only_targets, reference_branch, number, notify, update, performance.ref = "ispc_ref" if current_OS == "Windows": performance.ref = "ispc_ref.exe" + performance.perf_target = "" performance.in_file = "." + os.sep + f_date + os.sep + "performance.log" # prepare LLVM 3.3 as newest LLVM need_LLVM = check_LLVM(["3.3"]) diff --git a/perf.py b/perf.py index d7482fab..9875fbdb 100755 --- a/perf.py +++ b/perf.py @@ -392,7 +392,8 @@ def perf(options1, args): print_debug("Okey go go go!\n\n", s, perf_log) # report command line - print_debug("Command line: %s\n" % " ".join(map(str, sys.argv)), s, perf_log) + if __name__ == "__main__": + print_debug("Command line: %s\n" % " ".join(map(str, sys.argv)), s, perf_log) # report used ispc print_debug("Testing ispc: " + ispc_test + "\n", s, perf_log) @@ -424,8 +425,8 @@ def perf(options1, args): command = command[:-1] # handle conditional target argument target_str = "" - if options.target != "": - target_str = " ISPC_IA_TARGETS="+options.target + if options.perf_target != "": + target_str = " ISPC_IA_TARGETS="+options.perf_target if is_windows == False: ex_command_ref = "./ref " + command + " >> " + perf_temp + "_ref" ex_command = "./test " + command + " >> " + perf_temp + "_test" @@ -510,7 +511,7 @@ if __name__ == "__main__": help='set reference compiler for compare', default="") parser.add_option('-f', '--file', dest='in_file', help='file to save perf output', default="") - parser.add_option('-t', '--target', dest='target', + parser.add_option('-t', '--target', dest='perf_target', help='set ispc target for building benchmarks (both test and ref)', default="") (options, args) = parser.parse_args() perf(options, args)