Boost logo

Boost :

Subject: Re: [boost] Accelerating algorithms with SIMD - Segmented iterators and alternatives
From: David Abrahams (dave_at_[hidden])
Date: 2010-10-18 10:34:02


At Mon, 18 Oct 2010 11:24:10 +0100,
Mathias Gaunard wrote:
>
> On 16/10/10 20:20, David Abrahams wrote:
> > At Sat, 16 Oct 2010 19:01:12 +0100,
> > Mathias Gaunard wrote:
> >>
> >> On 15/10/2010 04:48, David Abrahams wrote:
> >>> At Thu, 14 Oct 2010 20:00:15 +0100,
> >>> Mathias Gaunard wrote:
> >>>>
> >>>> On 13/10/10 18:50, David Abrahams wrote:
> >>>>
> >>>>> I think you mean
> >>>>>
> >>>>> 1 2 | 3 4 5 6 | 7 8 9 10 | 11
> >>>>
> >>>> What is that nonsense supposed to be?
> >>>
> >>> I fear this conversation is becoming uncivil.
> >>
> >> Sorry, I just couldn't make sense of what this is supposed to be,
> >> and used bad phrasing.
> >>
> >> What would the value type of that range be?
> >
> > int
>
> So how does that help using SIMD instructions at all?

When a complete segment is processed, you can use SIMD. Elsewhere, not.

> What do the | represent for you?

Segment boundaries

> >>> That's what "if" statements are for.
> >>
> >> We want to avoid these.
> >
> > Actually, you don't need them. This is really simple; it's just like
> > processing a deque.
>
> As I said, it isn't. Iterating all segments of a deque is done with
> the same code but at different locations.

I don't mean processing a deque as done by algorithms today, I mean
processing a deque with a hierarchical algorithm as described in the
paper.

> I need different code for iterating each segment.

No, you need different code for iterating the end bits. Look
carefully at the hierarchical_fill implementation near the end of the
paper.

-- 
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