Some renaming; lower overhead in benchmark
This commit is contained in:
@@ -17,9 +17,9 @@ mproduct_parameters::mproduct_parameters(unsigned int simd_width
|
||||
mL(ms*local_size_0), nL(ns*local_size_1){}
|
||||
|
||||
|
||||
unsigned int mproduct::lmem_usage(array_expressions_container const & array_expressions) const
|
||||
unsigned int mproduct::lmem_usage(expressions_tuple const & expressions) const
|
||||
{
|
||||
atidlas::array_expression const & array_expression = (*array_expressions.data().front());
|
||||
atidlas::array_expression const & array_expression = (*expressions.data().front());
|
||||
numeric_type numeric_t = lhs_most(array_expression.tree(), array_expression.root()).lhs.dtype;
|
||||
|
||||
unsigned int N = 0;
|
||||
@@ -30,16 +30,16 @@ mproduct_parameters::mproduct_parameters(unsigned int simd_width
|
||||
return N*size_of(numeric_t);
|
||||
}
|
||||
|
||||
unsigned int mproduct::registers_usage(array_expressions_container const & array_expressions) const
|
||||
unsigned int mproduct::registers_usage(expressions_tuple const & expressions) const
|
||||
{
|
||||
atidlas::array_expression const & array_expression = (*array_expressions.data().front());
|
||||
atidlas::array_expression const & array_expression = (*expressions.data().front());
|
||||
numeric_type numeric_t = lhs_most(array_expression.tree(), array_expression.root()).lhs.dtype;
|
||||
|
||||
unsigned int N = p_.mS * p_.nS + p_.mS * p_.kS + p_.kS * p_.nS;
|
||||
return N*size_of(numeric_t);
|
||||
}
|
||||
|
||||
int mproduct::check_invalid_impl(cl::Device const &, array_expressions_container const &) const
|
||||
int mproduct::check_invalid_impl(cl::Device const &, expressions_tuple const &) const
|
||||
{
|
||||
if (p_.A_fetching_policy!=FETCH_FROM_LOCAL && p_.B_fetching_policy!=FETCH_FROM_LOCAL&& (p_.local_fetch_0!=0 || p_.local_fetch_1!=0))
|
||||
return TEMPLATE_GLOBAL_MEMORY_REQUIRES_ZERO_LOCAL_FETCH;
|
||||
@@ -87,7 +87,7 @@ mproduct_parameters::mproduct_parameters(unsigned int simd_width
|
||||
return TEMPLATE_VALID;
|
||||
}
|
||||
|
||||
std::string mproduct::generate_impl(unsigned int label, const char * id, const array_expressions_container &array_expressions, const std::vector<mapping_type> &, bool fallback) const
|
||||
std::string mproduct::generate_impl(unsigned int label, const char * id, const expressions_tuple &expressions, const std::vector<mapping_type> &, bool fallback) const
|
||||
{
|
||||
using std::string;
|
||||
using tools::to_string;
|
||||
@@ -106,7 +106,7 @@ mproduct_parameters::mproduct_parameters(unsigned int simd_width
|
||||
/// INIT
|
||||
/// //////////////
|
||||
kernel_generation_stream stream;
|
||||
array_expression const & st = (*array_expressions.data().front());
|
||||
array_expression const & st = (*expressions.data().front());
|
||||
numeric_type dtype = lhs_most(st.tree(), st.root()).lhs.dtype;
|
||||
std::string dtypestr = numeric_type_to_string(dtype);
|
||||
|
||||
@@ -557,11 +557,11 @@ mproduct_parameters::mproduct_parameters(unsigned int simd_width
|
||||
#undef VST0RE
|
||||
}
|
||||
|
||||
std::vector<std::string> mproduct::generate_impl(unsigned int label, array_expressions_container const & array_expressions, std::vector<mapping_type> const & mappings) const
|
||||
std::vector<std::string> mproduct::generate_impl(unsigned int label, expressions_tuple const & expressions, std::vector<mapping_type> const & mappings) const
|
||||
{
|
||||
std::vector<std::string> res;
|
||||
res.push_back(generate_impl(label, "o", array_expressions, mappings, false));
|
||||
res.push_back(generate_impl(label, "f", array_expressions, mappings, true));
|
||||
res.push_back(generate_impl(label, "o", expressions, mappings, false));
|
||||
res.push_back(generate_impl(label, "f", expressions, mappings, true));
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -615,10 +615,10 @@ mproduct_parameters::mproduct_parameters(unsigned int simd_width
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<int_t> mproduct::infos(array_expressions_container const & array_expressions,
|
||||
std::vector<int_t> mproduct::infos(expressions_tuple const & expressions,
|
||||
lhs_rhs_element & C, lhs_rhs_element & A, lhs_rhs_element & B)
|
||||
{
|
||||
atidlas::array_expression const & array_expression = (*array_expressions.data().front());
|
||||
atidlas::array_expression const & array_expression = (*expressions.data().front());
|
||||
array_expression::container_type const & array = array_expression.tree();
|
||||
std::size_t root = array_expression.root();
|
||||
|
||||
@@ -640,18 +640,18 @@ mproduct_parameters::mproduct_parameters(unsigned int simd_width
|
||||
mproduct::mproduct(mproduct_parameters const & parameters, char A_trans, char B_trans) : base_impl<mproduct, mproduct_parameters>(parameters, BIND_ALL_UNIQUE), A_trans_(A_trans), B_trans_(B_trans)
|
||||
{ }
|
||||
|
||||
std::vector<int_t> mproduct::input_sizes(array_expressions_container const & array_expressions)
|
||||
std::vector<int_t> mproduct::input_sizes(expressions_tuple const & expressions)
|
||||
{
|
||||
lhs_rhs_element d0, d1, d2;
|
||||
return infos(array_expressions, d0, d1, d2);
|
||||
return infos(expressions, d0, d1, d2);
|
||||
}
|
||||
|
||||
void mproduct::enqueue(cl::CommandQueue & queue, std::vector<cl_ext::lazy_compiler> & programs, unsigned int label, array_expressions_container const & array_expressions)
|
||||
void mproduct::enqueue(cl::CommandQueue & queue, std::vector<cl_ext::lazy_compiler> & programs, unsigned int label, expressions_tuple const & expressions)
|
||||
{
|
||||
using namespace tools;
|
||||
|
||||
lhs_rhs_element C, A, B;
|
||||
std::vector<int_t> MNK = infos(array_expressions, C, A, B);
|
||||
std::vector<int_t> MNK = infos(expressions, C, A, B);
|
||||
|
||||
int_t M = MNK[0];
|
||||
int_t N = MNK[1];
|
||||
|
Reference in New Issue
Block a user