diff options
author | Joel Holdsworth <joel@airwebreathe.org.uk> | 2020-03-19 17:45:20 +0000 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2020-03-19 17:45:20 +0000 |
commit | d5c665742beb8dc00ce0f6eab633f719a9218e03 (patch) | |
tree | 2cea4f868303064d37e9321c810cd07c0fcfceac /test/packetmath.cpp | |
parent | 6ff5a14091151ce0d722878de93b57025976facb (diff) |
Add absolute_difference coefficient-wise binary Array function
Diffstat (limited to 'test/packetmath.cpp')
-rw-r--r-- | test/packetmath.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 3548eb481..1ba15496b 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -14,6 +14,7 @@ #define REF_SUB(a,b) ((a)-(b)) #define REF_MUL(a,b) ((a)*(b)) #define REF_DIV(a,b) ((a)/(b)) +#define REF_ABS_DIFF(a,b) ((a)>(b)?(a)-(b):(b)-(a)) template<typename Scalar,typename Packet> void packetmath() { @@ -557,6 +558,7 @@ template<typename Scalar,typename Packet> void packetmath_notcomplex() CHECK_CWISE2_IF(PacketTraits::HasMin, (std::min), internal::pmin); CHECK_CWISE2_IF(PacketTraits::HasMax, (std::max), internal::pmax); CHECK_CWISE1(numext::abs, internal::pabs); + CHECK_CWISE2_IF(PacketTraits::HasAbsDiff, REF_ABS_DIFF, internal::pabsdiff); ref[0] = data1[0]; for (int i=0; i<PacketSize; ++i) |