diff options
author | 2014-06-06 20:18:44 -0700 | |
---|---|---|
committer | 2014-06-06 20:18:44 -0700 | |
commit | 29aebf96e62f4fb5e4b1f3fb475e299df2e7a02e (patch) | |
tree | db806c8c2022e8719b83c44ead705da397b4799d /test | |
parent | 79085e08e9512f678b4584df49d1b2835b40117f (diff) |
Created the pblend packet primitive and implemented it using SSE and AVX instructions.
Diffstat (limited to 'test')
-rw-r--r-- | test/packetmath.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 9dab07522..663ab886d 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -261,6 +261,22 @@ template<typename Scalar> void packetmath() VERIFY(isApproxAbs(data2[j], data1[i+j*PacketSize], refvalue) && "ptranspose"); } } + + if (internal::packet_traits<Scalar>::HasBlend) { + Packet thenPacket = internal::pload<Packet>(data1); + Packet elsePacket = internal::pload<Packet>(data2); + EIGEN_ALIGN_DEFAULT internal::Selector<PacketSize> selector; + for (int i = 0; i < PacketSize; ++i) { + selector.select[i] = i; + } + + Packet blend = internal::pblend(selector, thenPacket, elsePacket); + EIGEN_ALIGN_DEFAULT Scalar result[size]; + internal::pstore(result, blend); + for (int i = 0; i < PacketSize; ++i) { + VERIFY(isApproxAbs(result[i], (selector.select[i] ? data1[i] : data2[i]), refvalue)); + } + } } template<typename Scalar> void packetmath_real() |