Boost logo

Boost :

Subject: Re: [boost] Accelerating algorithms with SIMD - Segmented iterators and alternatives
From: Jeffrey Lee Hellrung, Jr. (jhellrung_at_[hidden])
Date: 2010-10-14 11:22:40

On 10/14/2010 8:07 AM, Jeffrey Lee Hellrung, Jr. wrote:
> On 10/14/2010 1:23 AM, David Abrahams wrote:
>> That's gonna be slow. Lots of testing and branching.
> First, that quote applies directly to a join_iterator, though I'll give
> you that it *may* apply to my hypothetical a flat_multirange_iterator.
> What I'm having trouble with is it *looks* to me like you have the same
> tests and branches with a segmented iterator as with a
> flat_multirange_iterator. Comparing the nested for-loop on page 5 of the
> Austern paper (which is what a segmented iterator would give you) with
> the flattened while-loop on page 6 (let's replace the while-condition
> with true put an inserted break statement when !(node != nodes.end())),
> they both have the same number of iterator increments, comparisons, and
> assignments. What am I missing? Are compilers just able to produce
> better code for nested for-loops than flattened loops?

Actually, I just realized that making those loop modifications is
"cheating" :/ Unless you did some kind of Java-style iteration.


- Jeff

Boost list run by bdawes at, gregod at, cpdaniel at, john at