<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Matthias,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
Thanks for your reply. Indeed declaring the size of the vector would be very useful, this would be a very welcome feature.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
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. </div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">The second solution looks much better - is this already available or should we wait until the next release? </div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Cheers</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 6, 2014 at 11:45 AM, Matthias Kretz <span dir="ltr"><<a href="mailto:kretz@compeng.uni-frankfurt.de" target="_blank">kretz@compeng.uni-frankfurt.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Georgios,<br>
<br>
I think I have the perfect solution for that coming up for Vc 1.0. The general<br>
idea is to use something like this:<br>
<br>
typedef Vc::simd_array<double, 2> double2_v;<br>
<br>
The implementation then is smart enough to figure out that - even when<br>
compiled for AVX - it should use an SSE register. The double_v type would<br>
still be the best for the target (in contrast to best for the problem :) ).<br>
<br>
Until then, with Vc 0.7, you can only work around this by using a different<br>
translation unit for where you want to use SSE. Compile with -DVC_IMPL=SSE and<br>
Vc::double_v will be Vc::SSE::double_v.<br>
BUT, be very careful what this means for the types. All Vc types will be<br>
different for differently compiled translation units then. You can only<br>
communicate between those via arrays of fundamental types.<br>
<br>
If you want to have a better solution sooner than Vc 1.0 there is something<br>
you could do for Vc 0.8. In principle Vc 0.8 could support declaring all<br>
possible Vc implementations in the same translation unit. Then Vc::double_v<br>
would still behave as now, but in addition you could explicitly use the<br>
Vc::SSE::double_v type. (Of course this reduces portability - but only until<br>
Vc 1.0 when you can replace this with the above double2_v.)<br>
<br>
Cheers,<br>
Matthias<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
─────────────────────────────────────────────────────────────<br>
Dipl.-Phys. Matthias Kretz<br>
<br>
Web: <a href="http://compeng.uni-frankfurt.de/?mkretz" target="_blank">http://compeng.uni-frankfurt.de/?mkretz</a><br>
<br>
SIMD easy and portable: <a href="http://compeng.uni-frankfurt.de/?vc" target="_blank">http://compeng.uni-frankfurt.de/?vc</a><br>
─────────────────────────────────────────────────────────────</font></span></blockquote></div><br></div></div>