Always operating on just the first two elements of a 4-sized vector
Georgios Bitzes
[please enable javascript to see the address]
Thu Mar 6 12:05:18 CET 2014
Hi Matthias,
Thanks for your reply. Indeed declaring the size of the vector would be
very useful, this would be a very welcome feature.
Regarding your proposed workarounds, unfortunately the first solution is
not really feasible in our code. Most of the target code for vectorization
is inside header files, so it could be that some code in the same
translation unit needs SSE and some other AVX. Moreover, the need to pass
vectors around would make this difficult and buggy in practice.
The second solution looks much better - is this already available or should
we wait until the next release?
Cheers
On Thu, Mar 6, 2014 at 11:45 AM, Matthias Kretz <
[please enable javascript to see the address]> wrote:
> Hi Georgios,
>
> I think I have the perfect solution for that coming up for Vc 1.0. The
> general
> idea is to use something like this:
>
> typedef Vc::simd_array<double, 2> double2_v;
>
> The implementation then is smart enough to figure out that - even when
> compiled for AVX - it should use an SSE register. The double_v type would
> still be the best for the target (in contrast to best for the problem :) ).
>
> Until then, with Vc 0.7, you can only work around this by using a different
> translation unit for where you want to use SSE. Compile with -DVC_IMPL=SSE
> and
> Vc::double_v will be Vc::SSE::double_v.
> BUT, be very careful what this means for the types. All Vc types will be
> different for differently compiled translation units then. You can only
> communicate between those via arrays of fundamental types.
>
> If you want to have a better solution sooner than Vc 1.0 there is something
> you could do for Vc 0.8. In principle Vc 0.8 could support declaring all
> possible Vc implementations in the same translation unit. Then Vc::double_v
> would still behave as now, but in addition you could explicitly use the
> Vc::SSE::double_v type. (Of course this reduces portability - but only
> until
> Vc 1.0 when you can replace this with the above double2_v.)
>
> Cheers,
> Matthias
>
> --
> ─────────────────────────────────────────────────────────────
> Dipl.-Phys. Matthias Kretz
>
> Web: http://compeng.uni-frankfurt.de/?mkretz
>
> SIMD easy and portable: http://compeng.uni-frankfurt.de/?vc
> ─────────────────────────────────────────────────────────────
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://compeng.uni-frankfurt.de/pipermail/vc/attachments/20140306/b73cd783/attachment.html>
More information about the Vc
mailing list