C++Guns – RoboBlog


C++ Guns: SIMDvalarray; std::valarray for SSE

Filed under: Allgemein — Tags: — Thomas @ 11:05

SIMDvalarray is the class for representing and manipulating arrays of values like std::valarray but it uses SIMD techniques like SSE, AVX ... and has no subscript operators like slicing.

Einfach SIMDarray mit Operatoren +, -, *, /, +=, -=, *=, /=

template<typename T, std::size_t N>
struct SIMDvalarray : acpl::SIMDarray<T,N> 
{ };


SIMDvalarray arr1 {1.0, 2.0};
SIMDvalarray arr2 {2.0, 4.0};
SIMDvalarray erg1 = arr1+arr2;

Erzeugt packed values SIMD Assember Code, wie gewünscht. Und mit C++17 Decudtion Guidelines muss man die nervigen, redundanten Template Parameter auch nicht mehr mit angeben.


No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress