Subject: Re: [boost] Boost SIMD beta release
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-12-23 08:26:23
On 23/12/12 13:41, Mathias Gaunard wrote:
> Technical problem: for each segment, the type of the iterator needs to
> be the same. The code for incrementing or dereferencing the iterator is
> therefore the same.
> This gives us two solutions:
> - Do a branch in the dereferencing function of the iterator to load
> normal data and trailing data differently (at every iteration, not ok --
> this approach also works with normal iterators)
> - Pre-emptively build the last vector of the data and copy it into the
> iterator (which implies unnecessary loads, stores and cache misses and
> makes the iterator expensive to copy), and consider that as an
> additional segment of contiguous memory.
The above only stands for input iterators. I forgot mentioning output ones.
The first solution still works for output iterators, but the second one
clearly does not.
The only way we would have to make efficient segmented output iterators
for this case would be to allow iterator of different segments to be of
different types, which would require making the number of segments per
level a compile-time constant. This would make the segmented iterator
concepts significantly less useful for the use cases they were designed for.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk