Hello, all.
What is the fastest way to find the largest element across the
vector (vFloat) ?
Currently i am saving it to the memory and performing scalar
compare, but this should be more logical and fast way to to so.
Thank you.
--
Sincerely,
Rustam Muginov
Rustam:
My macstl library has a max member function for all SIMD types and
works portably across Altivec and SSE e.g.
using namespace macstl;
vec <float> f (1, 2, 3, 4);
float maxf = f.max (); // should be 4
It uses SIMD intrinsics to compute this so there's little scalar
overhead, except for the last conversion to scalar. It also
generalizes to arrays of types (using C++ valarrays) if you so wish.