Boost logo

Boost :

Subject: Re: [boost] Accelerating algorithms with SIMD - Segmented iterators and alternatives
From: David Abrahams (dave_at_[hidden])
Date: 2010-10-12 22:07:44


At Tue, 12 Oct 2010 19:15:15 -0400,
David Sankel wrote:
>
> > > Here, I will only be talking of the full generator I described in that
> > > other thread, not the step one.
> > >
> > > It's push instead of pull, basically.
> > >
> > > - It's a very simple, easy-to-grasp concept, it's basically just
> > > allowing ranges to define their own for_each (I use an output iterator
> > > in my example, but it's not really different from a function object)
> >
> > Nice for very linear things. Not so great for sort, binary_search,
> > reverse, rotate, ...
> >
>
> Please please please, if you're going to attempt a better alternative for
> iterators, read "The essence of the Iterator pattern" [1] (or [2] for an
> updated version) and the important work on idioms[3] that it references. I
> wish I had more time to spend on this effort, but needless to say the tough
> semantic work has already been done!

I don't know about that. This work seems (to me) fundamentally
different in spirit from C++ iterators a là Stepanov and Musser. For
one thing, Gibbons fails to even address random access. Staying close
to the machine model and the ability to make the most generic
algorithms as efficient as hand-coded C (sometimes even assembly!) are
the lifeblood of generic programming, and I don't see how one can
ignore those things in the realm of HPC.

>
> Thanks David A. for pointing out there was a semantics discussion going on
> here.

Welcome. Sorry to be a contrarian :-)

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk