Code Quality: renamed base_impl -> parameterized_base
This commit is contained in:
@@ -91,12 +91,12 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class base_impl : public base
|
||||
class parameterized_base : public base
|
||||
{
|
||||
private:
|
||||
virtual int is_invalid_impl(driver::Device const &, expression_tree const &) const;
|
||||
public:
|
||||
base_impl(unsigned int _vwidth, int_t _ls0, int_t _ls1);
|
||||
parameterized_base(unsigned int _vwidth, int_t _ls0, int_t _ls1);
|
||||
unsigned int ls0() const;
|
||||
unsigned int ls1() const;
|
||||
/** @brief returns whether or not the profile has undefined behavior on particular device */
|
||||
|
@@ -29,7 +29,7 @@ namespace isaac
|
||||
namespace templates
|
||||
{
|
||||
|
||||
class elementwise_1d : public base_impl
|
||||
class elementwise_1d : public parameterized_base
|
||||
{
|
||||
private:
|
||||
virtual int is_invalid_impl(driver::Device const &, expression_tree const &) const;
|
||||
|
@@ -30,7 +30,7 @@ namespace isaac
|
||||
namespace templates
|
||||
{
|
||||
|
||||
class elementwise_2d : public base_impl
|
||||
class elementwise_2d : public parameterized_base
|
||||
{
|
||||
private:
|
||||
int is_invalid_impl(driver::Device const &, expression_tree const &) const;
|
||||
|
@@ -31,7 +31,7 @@ namespace isaac
|
||||
namespace templates
|
||||
{
|
||||
|
||||
class gemm : public base_impl
|
||||
class gemm : public parameterized_base
|
||||
{
|
||||
private:
|
||||
unsigned int temporary_workspace(expression_tree const & expressions) const;
|
||||
|
@@ -29,7 +29,7 @@ namespace isaac
|
||||
namespace templates
|
||||
{
|
||||
|
||||
class reduce_1d : public base_impl
|
||||
class reduce_1d : public parameterized_base
|
||||
{
|
||||
private:
|
||||
unsigned int lmem_usage(expression_tree const & expressions) const;
|
||||
|
@@ -32,7 +32,7 @@ namespace isaac
|
||||
namespace templates
|
||||
{
|
||||
|
||||
class reduce_2d : public base_impl
|
||||
class reduce_2d : public parameterized_base
|
||||
{
|
||||
protected:
|
||||
reduce_2d(unsigned int vwidth, unsigned int ls0, unsigned int ls1, unsigned int ng0, unsigned int ng1, fetch_type fetch, operation_type_family);
|
||||
|
@@ -66,19 +66,19 @@ std::string base::generate(std::string const & suffix, expression_tree const &
|
||||
return generate_impl(suffix, expression, device, mapping);
|
||||
}
|
||||
|
||||
int base_impl::is_invalid_impl(driver::Device const &, expression_tree const &) const
|
||||
int parameterized_base::is_invalid_impl(driver::Device const &, expression_tree const &) const
|
||||
{ return TEMPLATE_VALID; }
|
||||
|
||||
base_impl::base_impl(unsigned int vwidth, int_t ls0, int_t ls1): vwidth_(vwidth), ls0_(ls0), ls1_(ls1)
|
||||
parameterized_base::parameterized_base(unsigned int vwidth, int_t ls0, int_t ls1): vwidth_(vwidth), ls0_(ls0), ls1_(ls1)
|
||||
{ }
|
||||
|
||||
unsigned int base_impl::ls0() const
|
||||
unsigned int parameterized_base::ls0() const
|
||||
{ return ls0_; }
|
||||
|
||||
unsigned int base_impl::ls1() const
|
||||
unsigned int parameterized_base::ls1() const
|
||||
{ return ls1_; }
|
||||
|
||||
int base_impl::is_invalid(expression_tree const & expressions, driver::Device const & device) const
|
||||
int parameterized_base::is_invalid(expression_tree const & expressions, driver::Device const & device) const
|
||||
{
|
||||
//Query device informations
|
||||
size_t lmem_available = device.local_mem_size();
|
||||
|
@@ -111,7 +111,7 @@ std::string elementwise_1d::generate_impl(std::string const & suffix, expression
|
||||
}
|
||||
|
||||
elementwise_1d::elementwise_1d(unsigned int vwidth, unsigned int ls, unsigned int ng, fetch_type fetch):
|
||||
base_impl(vwidth,ls,1), ng_(ng), fetch_(fetch)
|
||||
parameterized_base(vwidth,ls,1), ng_(ng), fetch_(fetch)
|
||||
{}
|
||||
|
||||
|
||||
|
@@ -106,7 +106,7 @@ std::string elementwise_2d::generate_impl(std::string const & suffix, expression
|
||||
|
||||
elementwise_2d::elementwise_2d(unsigned int vwidth, unsigned int ls0, unsigned int ls1,
|
||||
unsigned int ng0, unsigned int ng1, fetch_type fetch):
|
||||
base_impl(vwidth, ls0, ls1), ng0_(ng0), ng1_(ng1), fetch_(fetch)
|
||||
parameterized_base(vwidth, ls0, ls1), ng0_(ng0), ng1_(ng1), fetch_(fetch)
|
||||
{}
|
||||
|
||||
std::vector<int_t> elementwise_2d::input_sizes(expression_tree const & expression) const{
|
||||
|
@@ -683,7 +683,7 @@ namespace templates
|
||||
,int_t ms, int_t ks, int_t ns
|
||||
,fetch_type Afetch , fetch_type Bfetch
|
||||
,int_t lf0, int_t lf1, char A_trans, char B_trans) :
|
||||
base_impl(vwidth, ls0, ls1), mL_(ms*ls0), kL_(kL), nL_(ns*ls1), depth_(D), mS_(ms), kS_(ks), nS_(ns),
|
||||
parameterized_base(vwidth, ls0, ls1), mL_(ms*ls0), kL_(kL), nL_(ns*ls1), depth_(D), mS_(ms), kS_(ks), nS_(ns),
|
||||
Afetch_(Afetch), Bfetch_(Bfetch), lf0_(lf0), lf1_(lf1), A_trans_(A_trans), B_trans_(B_trans)
|
||||
{
|
||||
if(A_trans_=='N' && B_trans_=='N') type_ = GEMM_NN;
|
||||
|
@@ -250,7 +250,7 @@ std::string reduce_1d::generate_impl(std::string const & suffix, expression_tree
|
||||
}
|
||||
|
||||
reduce_1d::reduce_1d(unsigned int vwidth, unsigned int ls, unsigned int ng, fetch_type fetch):
|
||||
base_impl(vwidth,ls,1), ng_(ng), fetch_(fetch)
|
||||
parameterized_base(vwidth,ls,1), ng_(ng), fetch_(fetch)
|
||||
{}
|
||||
|
||||
std::vector<int_t> reduce_1d::input_sizes(expression_tree const & x) const
|
||||
|
@@ -278,7 +278,7 @@ std::string reduce_2d::generate_impl(std::string const & suffix, expression_tree
|
||||
|
||||
reduce_2d::reduce_2d(unsigned int vwidth, unsigned int ls0, unsigned int ls1, unsigned int ng0, unsigned int ng1, fetch_type fetch,
|
||||
operation_type_family rtype) :
|
||||
base_impl(vwidth, ls0, ls1), ng0_(ng0), ng1_(ng1), fetch_(fetch),
|
||||
parameterized_base(vwidth, ls0, ls1), ng0_(ng0), ng1_(ng1), fetch_(fetch),
|
||||
reduction_type_(rtype){ }
|
||||
|
||||
std::vector<int_t> reduce_2d::input_sizes(expression_tree const & tree) const
|
||||
|
@@ -68,17 +68,17 @@ void export_templates()
|
||||
#undef __PROP
|
||||
}
|
||||
|
||||
bp::class_<tpt::base_impl, bp::bases<tpt::base>, boost::noncopyable>("base_impl", bp::no_init)
|
||||
.add_property("ls0", &tpt::base_impl::ls0)
|
||||
.add_property("ls1", &tpt::base_impl::ls1);
|
||||
bp::class_<tpt::parameterized_base, bp::bases<tpt::base>, boost::noncopyable>("parameterized_base", bp::no_init)
|
||||
.add_property("ls0", &tpt::parameterized_base::ls0)
|
||||
.add_property("ls1", &tpt::parameterized_base::ls1);
|
||||
|
||||
#define WRAP_BASE(name) bp::class_<tpt::name, bp::bases<tpt::base_impl>, boost::noncopyable>(#name, bp::no_init);
|
||||
#define WRAP_BASE(name) bp::class_<tpt::name, bp::bases<tpt::parameterized_base>, boost::noncopyable>(#name, bp::no_init);
|
||||
|
||||
#define WRAP_TEMPLATE(name, basename, ...) bp::class_<tpt::name, std::shared_ptr<tpt::name>, bp::bases<basename>>(#name, bp::init<__VA_ARGS__>())\
|
||||
;
|
||||
WRAP_TEMPLATE(elementwise_1d, tpt::base_impl, uint, uint, uint, tpt::fetch_type)
|
||||
WRAP_TEMPLATE(elementwise_2d, tpt::base_impl, uint, uint, uint, uint, uint, tpt::fetch_type)
|
||||
WRAP_TEMPLATE(reduce_1d, tpt::base_impl, uint, uint, uint, tpt::fetch_type)
|
||||
WRAP_TEMPLATE(elementwise_1d, tpt::parameterized_base, uint, uint, uint, tpt::fetch_type)
|
||||
WRAP_TEMPLATE(elementwise_2d, tpt::parameterized_base, uint, uint, uint, uint, uint, tpt::fetch_type)
|
||||
WRAP_TEMPLATE(reduce_1d, tpt::parameterized_base, uint, uint, uint, tpt::fetch_type)
|
||||
WRAP_BASE(reduce_2d)
|
||||
WRAP_TEMPLATE(reduce_2d_rows, tpt::reduce_2d, uint, uint, uint, uint, uint, tpt::fetch_type)
|
||||
WRAP_TEMPLATE(reduce_2d_cols, tpt::reduce_2d, uint, uint, uint, uint, uint, tpt::fetch_type)
|
||||
|
Reference in New Issue
Block a user