def main(tester_lambda=None, pop_lambda=None, hlconfig_lambda=None, config_lambda=None): from optparse import OptionParser parser = OptionParser(usage="usage: sgatuner.py [options] Benchmark") parser.add_option("--check", action="store_true", dest="check", default=False, help="check for correctness") parser.add_option("--debug", action="store_true", dest="debug", default=False, help="enable debugging options") parser.add_option("-n", type="int", help="input size to train for") parser.add_option("--max_time", type="float", action="callback", callback=option_callback) parser.add_option("--rounds_per_input_size", type="int", action="callback", callback=option_callback) parser.add_option("--mutations_per_mutator", type="int", action="callback", callback=option_callback) parser.add_option("--output_dir", type="string", action="callback", callback=option_callback) parser.add_option("--population_size", type="int", action="callback", callback=option_callback) parser.add_option("--min_input_size", type="int", action="callback", callback=option_callback) parser.add_option("--offset", type="int", action="callback", callback=option_callback) parser.add_option("--threads", type="int", action="callback", callback=option_callback) parser.add_option("--name", type="string", action="callback", callback=option_callback) parser.add_option("--abort_on", type="string", action="callback", callback=option_callback) parser.add_option("--accuracy_target", type="float", action="callback", callback=option_callback) (options, args) = parser.parse_args() if len(args)!=1: parser.print_usage() sys.exit(1) if options.check: tunerconfig.applypatch(tunerconfig.patch_check) if options.debug: tunerconfig.applypatch(tunerconfig.patch_debug) if options.n: tunerconfig.applypatch(tunerconfig.patch_n(options.n)) config.benchmark=args[0] if tester_lambda is None and pop_lambda is None and hlconfig_lambda is None: recompile() autotune(config.benchmark, None, tester_lambda, pop_lambda, hlconfig_lambda, config_lambda)
parser.add_option("-n", type="int", help="input size to train for") parser.add_option("--max_time", type="float", action="callback", callback=option_callback) parser.add_option("--rounds_per_input_size", type="int", action="callback", callback=option_callback) parser.add_option("--mutations_per_mutator", type="int", action="callback", callback=option_callback) parser.add_option("--output_dir", type="string", action="callback", callback=option_callback) parser.add_option("--population_high_size", type="int", action="callback", callback=option_callback) parser.add_option("--population_low_size", type="int", action="callback", callback=option_callback) parser.add_option("--min_input_size", type="int", action="callback", callback=option_callback) parser.add_option("--offset", type="int", action="callback", callback=option_callback) parser.add_option("--threads", type="int", action="callback", callback=option_callback) parser.add_option("--name", type="string", action="callback", callback=option_callback) parser.add_option("--abort_on", type="string", action="callback", callback=option_callback) parser.add_option("--accuracy_target", type="float", action="callback", callback=option_callback) (options, args) = parser.parse_args() if len(args)!=1: parser.print_usage() sys.exit(1) if options.check: tunerconfig.applypatch(tunerconfig.patch_check) if options.debug: tunerconfig.applypatch(tunerconfig.patch_debug) if options.n: tunerconfig.applypatch(tunerconfig.patch_n(options.n)) config.benchmark=args[0] recompile() autotune(config.benchmark)
def main(tester_lambda=None, pop_lambda=None, hlconfig_lambda=None, config_lambda=None): from optparse import OptionParser parser = OptionParser(usage="usage: sgatuner.py [options] Benchmark") parser.add_option("--check", action="store_true", dest="check", default=False, help="check for correctness") parser.add_option("--debug", action="store_true", dest="debug", default=False, help="enable debugging options") parser.add_option("-n", type="int", help="input size to train for") parser.add_option("--max_time", type="float", action="callback", callback=option_callback) parser.add_option("--rounds_per_input_size", type="int", action="callback", callback=option_callback) parser.add_option("--mutations_per_mutator", type="int", action="callback", callback=option_callback) parser.add_option("--output_dir", type="string", action="callback", callback=option_callback) parser.add_option("--population_size", type="int", action="callback", callback=option_callback) parser.add_option("--min_input_size", type="int", action="callback", callback=option_callback) parser.add_option("--offset", type="int", action="callback", callback=option_callback) parser.add_option("--threads", type="int", action="callback", callback=option_callback) parser.add_option("--name", type="string", action="callback", callback=option_callback) parser.add_option("--abort_on", type="string", action="callback", callback=option_callback) parser.add_option("--accuracy_target", type="float", action="callback", callback=option_callback) (options, args) = parser.parse_args() if len(args) != 1: parser.print_usage() sys.exit(1) if options.check: tunerconfig.applypatch(tunerconfig.patch_check) if options.debug: tunerconfig.applypatch(tunerconfig.patch_debug) if options.n: tunerconfig.applypatch(tunerconfig.patch_n(options.n)) config.benchmark = args[0] if tester_lambda is None and pop_lambda is None and hlconfig_lambda is None: recompile() autotune(config.benchmark, None, tester_lambda, pop_lambda, hlconfig_lambda, config_lambda)