From 5178ba06f97a925ebca560e842a3ba3abd1d53d0 Mon Sep 17 00:00:00 2001 From: Philippe Tillet Date: Sat, 13 Aug 2016 09:41:04 -0700 Subject: [PATCH] Python: fixed compilation issues --- python/src/bind/kernels.cpp | 26 +++++++++++++------------- tune/android/tune/optimize.py | 8 ++++---- tune/android/tune/tune.py | 6 +++--- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/python/src/bind/kernels.cpp b/python/src/bind/kernels.cpp index da9758e63..b22dbbfde 100644 --- a/python/src/bind/kernels.cpp +++ b/python/src/bind/kernels.cpp @@ -49,8 +49,8 @@ void export_templates() bp::scope template_scope = templates_module; - bp::enum_ - ("fetching_policy_type") + bp::enum_ + ("fetch_type") .value("FETCH_FROM_LOCAL", tpt::FETCH_FROM_LOCAL) .value("FETCH_FROM_GLOBAL_STRIDED", tpt::FETCH_FROM_GLOBAL_STRIDED) .value("FETCH_FROM_GLOBAL_CONTIGUOUS", tpt::FETCH_FROM_GLOBAL_CONTIGUOUS); @@ -69,25 +69,25 @@ void export_templates() } #define WRAP_BASE(name) bp::class_, bp::bases, boost::noncopyable>(#name, bp::no_init)\ - .add_property("local_size_0", &tpt::base_impl::local_size_0)\ - .add_property("local_size_1", &tpt::base_impl::local_size_1); + .add_property("ls0", &tpt::base_impl::ls0)\ + .add_property("ls1", &tpt::base_impl::ls1); #define WRAP_TEMPLATE(name, basename, ...) bp::class_ > >(#name, bp::init<__VA_ARGS__>())\ ; #define WRAP_SINGLE_TEMPLATE(name, ...) WRAP_BASE(name) WRAP_TEMPLATE(name, name, __VA_ARGS__) //Vector AXPY - WRAP_SINGLE_TEMPLATE(elementwise_1d, uint, uint, uint, tpt::fetching_policy_type) - WRAP_SINGLE_TEMPLATE(elementwise_2d, uint, uint, uint, uint, uint, tpt::fetching_policy_type) - WRAP_SINGLE_TEMPLATE(reduce_1d, uint, uint, uint, tpt::fetching_policy_type) + WRAP_SINGLE_TEMPLATE(elementwise_1d, uint, uint, uint, tpt::fetch_type) + WRAP_SINGLE_TEMPLATE(elementwise_2d, uint, uint, uint, uint, uint, tpt::fetch_type) + WRAP_SINGLE_TEMPLATE(reduce_1d, uint, uint, uint, tpt::fetch_type) WRAP_BASE(reduce_2d) - WRAP_TEMPLATE(reduce_2d_rows, reduce_2d, uint, uint, uint, uint, uint, tpt::fetching_policy_type) - WRAP_TEMPLATE(reduce_2d_cols, reduce_2d, uint, uint, uint, uint, uint, tpt::fetching_policy_type) + WRAP_TEMPLATE(reduce_2d_rows, reduce_2d, uint, uint, uint, uint, uint, tpt::fetch_type) + WRAP_TEMPLATE(reduce_2d_cols, reduce_2d, uint, uint, uint, uint, uint, tpt::fetch_type) WRAP_BASE(matrix_product) - WRAP_TEMPLATE(matrix_product_nn, matrix_product, uint, uint, uint, uint, uint, uint, uint, uint, tpt::fetching_policy_type, tpt::fetching_policy_type, uint, uint) - WRAP_TEMPLATE(matrix_product_tn, matrix_product, uint, uint, uint, uint, uint, uint, uint, uint, tpt::fetching_policy_type, tpt::fetching_policy_type, uint, uint) - WRAP_TEMPLATE(matrix_product_nt, matrix_product, uint, uint, uint, uint, uint, uint, uint, uint, tpt::fetching_policy_type, tpt::fetching_policy_type, uint, uint) - WRAP_TEMPLATE(matrix_product_tt, matrix_product, uint, uint, uint, uint, uint, uint, uint, uint, tpt::fetching_policy_type, tpt::fetching_policy_type, uint, uint) + WRAP_TEMPLATE(matrix_product_nn, matrix_product, uint, uint, uint, uint, uint, uint, uint, uint, tpt::fetch_type, tpt::fetch_type, uint, uint) + WRAP_TEMPLATE(matrix_product_tn, matrix_product, uint, uint, uint, uint, uint, uint, uint, uint, tpt::fetch_type, tpt::fetch_type, uint, uint) + WRAP_TEMPLATE(matrix_product_nt, matrix_product, uint, uint, uint, uint, uint, uint, uint, uint, tpt::fetch_type, tpt::fetch_type, uint, uint) + WRAP_TEMPLATE(matrix_product_tt, matrix_product, uint, uint, uint, uint, uint, uint, uint, uint, tpt::fetch_type, tpt::fetch_type, uint, uint) } diff --git a/tune/android/tune/optimize.py b/tune/android/tune/optimize.py index 2108924de..a69b05224 100644 --- a/tune/android/tune/optimize.py +++ b/tune/android/tune/optimize.py @@ -34,10 +34,10 @@ import tools from tools import profile_execution_failure from time import sleep -fetch_types = [sc.templates.fetching_policy_type.FETCH_FROM_GLOBAL_CONTIGUOUS, - sc.templates.fetching_policy_type.FETCH_FROM_GLOBAL_STRIDED, - sc.templates.fetching_policy_type.FETCH_FROM_LOCAL, - sc.templates.fetching_policy_type.FETCH_FROM_LOCAL] +fetch_types = [sc.templates.fetch_type.FETCH_FROM_GLOBAL_CONTIGUOUS, + sc.templates.fetch_type.FETCH_FROM_GLOBAL_STRIDED, + sc.templates.fetch_type.FETCH_FROM_LOCAL, + sc.templates.fetch_type.FETCH_FROM_LOCAL] def exhaustive(template, sizes, context): tree, _ = tools.tree_of(template, sizes, context) diff --git a/tune/android/tune/tune.py b/tune/android/tune/tune.py index 66604ab87..cd00bfbe9 100644 --- a/tune/android/tune/tune.py +++ b/tune/android/tune/tune.py @@ -152,11 +152,11 @@ class Tuner: with open(os.path.join(savepath, 'profiles.csv')) as f: def mmap(x): if x=='FETCH_FROM_LOCAL': - return sc.templates.fetching_policy_type.FETCH_FROM_LOCAL + return sc.templates.fetch_type.FETCH_FROM_LOCAL if x=='FETCH_FROM_GLOBAL_CONTIGUOUS': - return sc.templates.fetching_policy_type.FETCH_FROM_GLOBAL_CONTIGUOUS + return sc.templates.fetch_type.FETCH_FROM_GLOBAL_CONTIGUOUS if x=='FETCH_FROM_GLOBAL_STRIDED': - return sc.templates.fetching_policy_type.FETCH_FROM_GLOBAL_STRIDED + return sc.templates.fetch_type.FETCH_FROM_GLOBAL_STRIDED return int(x) profiles = [map(mmap,row) for v in row for row in csv.reader(f, delimiter=',')] except: