diff --git a/tune/pysrc/autotune.py b/tune/pysrc/autotune.py index 35afed4e1..bc3cbc593 100644 --- a/tune/pysrc/autotune.py +++ b/tune/pysrc/autotune.py @@ -96,12 +96,12 @@ def do_tuning(args): else: def compute_perf(x, t): return TYPES[operation]['perf-index']([datatype(0).size, x, t]) - #profiles = dataset.sample_profiles(execution_handler, tuning_sizes) + profiles = dataset.sample_profiles(execution_handler, tuning_sizes) if args.build_model: - #X, Y, profiles = dataset.sample_dataset(prefix, profiles, execution_handler, training_sizes) - profiles = np.loadtxt(prefix+'/profiles.csv') - X = np.loadtxt(prefix+'/X.csv',ndmin=2) - Y = np.loadtxt(prefix+'/Y.csv',ndmin=2) + X, Y, profiles = dataset.sample_dataset(prefix, profiles, execution_handler, training_sizes) + #profiles = np.loadtxt(prefix+'/profiles.csv') + #X = np.loadtxt(prefix+'/X.csv',ndmin=2) + #Y = np.loadtxt(prefix+'/Y.csv',ndmin=2) clf = train_model(X, Y, profiles, compute_perf, TYPES[operation]['perf-measure']) D['predictor'] = [{'children_left': e.tree_.children_left.tolist(), 'children_right': e.tree_.children_right.tolist(), diff --git a/tune/pysrc/dataset.py b/tune/pysrc/dataset.py index 6c56b6fdd..84df6eb3f 100644 --- a/tune/pysrc/dataset.py +++ b/tune/pysrc/dataset.py @@ -12,10 +12,7 @@ def sample_profiles(execution_handler, generator): print x if i==0: X = np.empty((0,len(x))) - try: - y = execution_handler(x) - except: - continue + y = execution_handler(x) if y not in profiles: profiles.append(y) idx = profiles.index(y) diff --git a/tune/pysrc/misc_tools.py b/tune/pysrc/misc_tools.py index 8c6feca7c..e133fd8ee 100644 --- a/tune/pysrc/misc_tools.py +++ b/tune/pysrc/misc_tools.py @@ -206,7 +206,7 @@ def skip(template, symbolic): return True elif vendor == isc.vendor.NVIDIA and local_size%32!=0: return True - elif vendor == isc.vendor.INTEL in vendor and local_size%8!=0: + elif vendor == isc.vendor.INTEL and local_size%8!=0: return True array_expressions = isc.array_expression_container(symbolic) registers_usage = template.registers_usage(array_expressions)/4