Backend: A lot of bugfixes in dot() for handling shapes better

This commit is contained in:
Philippe Tillet
2015-06-30 17:55:57 -04:00
parent e7cabf65ac
commit cf2dba43ef
12 changed files with 108 additions and 73 deletions

View File

@@ -33,6 +33,7 @@ std::string mreduction::generate_impl(const char * suffix, expressions_tuple con
{
using tools::to_string;
std::vector<mapped_mreduction*> reductions;
expressions_tuple::data_type::const_iterator sit;
std::vector<mapping_type>::const_iterator mit;
@@ -114,6 +115,7 @@ std::string mreduction::generate_impl(const char * suffix, expressions_tuple con
{
std::string data_type = append_width("#scalartype",simd_width);
for (const auto & e : reductions)
{
std::map<std::string, std::string> accessors;
@@ -130,7 +132,6 @@ std::string mreduction::generate_impl(const char * suffix, expressions_tuple con
e->process_recursive(stream, PARENT_NODE_TYPE, accessors);
}
//Update accumulators
std::vector<std::string> str(simd_width);
if (simd_width==1)
@@ -240,6 +241,7 @@ std::string mreduction::generate_impl(const char * suffix, expressions_tuple con
stream << _size_t << " gsize1 = " << GlobalSize1(backend) <<";" << std::endl;
stream << _size_t << " upper_bound_1 = ( M +" << p_.local_size_1 - 1 << ")/" << p_.local_size_1 << "*" << p_.local_size_1 << ";" << std::endl;
stream << "for(" << _size_t << " r = gid1; r < upper_bound_1; r += gsize1){" << std::endl;
stream.inc_tab();