Boost logo

Boost :

Subject: Re: [boost] Boost SIMD beta release
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-12-20 06:38:57


On 20/12/2012 11:05, Joel Falcou wrote:

>> * is it possible to define simd kernels for both packs and scalars e.g.
>> to make use of branches in the scalar implementation used in
>> preroll/postroll of unrolled loops?
>
> All operations on pack are also defined on scalar so if you write a
> polymorphic template functor, it will work on both. There is a simple
> example of
> this in the paper.

While this works, if you do this you won't be able to use lazy branch
evaluation in the scalar version.

If you write

c = if_else(a != 0, b/a, b);

this is equivalent in scalar to

c = (a != 0) ? b/a : b;

except that in the case above you will always compute the division.


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