On Tue, May 27, 2014 at 09:18:33AM -0700, Mehdi Amini wrote:
> In pythran/pythonic/types/numpy_iexpr.hpp:
> >
> > -                void init_buffer(long index) {
> > -                    auto siter = shape.begin();
> > -                    //accumulate the shape to jump to index position. Not
> done with std::accumulate
> > -                    //as we want to copy the shape at the same time.
> > -                    for(auto iter = arg.shape.begin() + 1, end =
> arg.shape.end(); iter != end; ++iter, ++siter)
> > -                        index *= *siter = *iter;
> > -                    buffer += index;
> > +                template<size_t N>
> > +                long init_buffer(long index, utils::int_<N>) {
> This deserve a comment (both on what it is doing here, and why it is not a
> loop).
agreed

> BTW: the commit title is "Force loop unrolling" while you don't force anything,
> just giving the compiler the opportunity to do it.

It already had the opportunity, but yes :-)