Compile for many targets
Matthias Kretz
[please enable javascript to see the address]
Tue Jun 7 10:12:21 CEST 2016
Hi Caio,
sorry for taking "too long" to answer. My time is too limited currently...
Your main place to watch is this: https://github.com/VcDevel/Vc/issues/118
In any case, yes you have to translate from a runtime info to a compile-time
difference. switch-case is the best solution in this case.
The issue with ExtraInstructions is hairy. I have no "100% that's the way to
do it" recommendation. And I think this is even somewhat broken in the trig
example in Vc. I'd be happy if you figure this out, if you paste your findings
in the GitHub issue tracker.
Cheers,
Matthias
On Samstag, 16. April 2016 19:21:00 CEST Caio S. Souza wrote:
> Hi!
> I'm a bit confused on how to make a program work on all available
> implementations. I implemented a simple function (foo) that uses Vc in
> a separate .cpp file. I then successfully compiled it using the macro
> vc_compile_for_all_implementations within cmake. Now I would like to
> select at runtime which version of foo to call based on the result of
> Vc::bestImplementationSupported. After looking at the trigonometric
> functions implementation I tried to use template specialization when
> defining foo and call each foo specialization inside an ugly
> switch-case. But I don't know how to specialize/call foo when there
> are extra instructions. How is the best way to proceed? Is a
> switch-case the best strategy in this context?
>
> Thanks in advance
> --
> Caio S. Souza
> Laboratório de Biologia Teórica e Computacional
> Universidade de Brasília
> www.lbtc.unb.br
>
> _______________________________________________
> Vc mailing list
>[please enable javascript to see the address]
> https://compeng.uni-frankfurt.de/mailman/listinfo/vc
--
──────────────────────────────────────────────────────────────────────────
Dr. Matthias Kretz https://kretzfamily.de
GSI Helmholtzzentrum für Schwerionenforschung https://gsi.de
SIMD easy and portable https://github.com/VcDevel/Vc
──────────────────────────────────────────────────────────────────────────
More information about the Vc
mailing list