Re: [eigen] 3.2.10 released!

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Oh, thanks so much. Sorry for generating so much work. I tested it on gcc-4.1.2, and it worked.


I tested it on gcc-4.4.6, gcc-4.8.2 and MSVC2010, and they all say

In function `double __vector Eigen::internal::pinsertlast<double __vector>(double __vector const&, Eigen::internal::unpacket_traits<double __vector>::type)':                    
body.cpp:(.text+0x90): multiple definition of `double __vector Eigen::internal::pinsertlast<double __vector>(double __vector const&, Eigen::internal::unpacket_traits<double __vector>::type)'


It seems easy to fix by adding an "inline" at an appropriate place. I tested it and it seems to work. I'm in a hurry now, so I won't generate a patch. Find the "hg diff" output below:


hg diff Eigen/
diff -r c115a27ab86d Eigen/src/Core/arch/AVX/PacketMath.h
--- a/Eigen/src/Core/arch/AVX/PacketMath.h      Tue Oct 25 08:42:15 2016 -0700
+++ b/Eigen/src/Core/arch/AVX/PacketMath.h      Tue Oct 25 18:20:09 2016 +0200
@@ -604,12 +604,12 @@
   return _mm256_blendv_pd(thenPacket, elsePacket, false_mask);
 }

-template<> EIGEN_DEVICE_FUNC Packet8f pinsertlast(const Packet8f& a, float b)
+template<> inline EIGEN_DEVICE_FUNC Packet8f pinsertlast(const Packet8f& a, float b)
 {
   return _mm256_blend_ps(a,pset1<Packet8f>(b),(1<<7));
 }

-template<> EIGEN_DEVICE_FUNC Packet4d pinsertlast(const Packet4d& a, double b)
+template<> inline EIGEN_DEVICE_FUNC Packet4d pinsertlast(const Packet4d& a, double b)
 {
   return _mm256_blend_pd(a,pset1<Packet4d>(b),(1<<3));
 }
diff -r c115a27ab86d Eigen/src/Core/arch/SSE/PacketMath.h
--- a/Eigen/src/Core/arch/SSE/PacketMath.h      Tue Oct 25 08:42:15 2016 -0700
+++ b/Eigen/src/Core/arch/SSE/PacketMath.h      Tue Oct 25 18:20:09 2016 +0200
@@ -818,7 +818,7 @@
 #endif
 }

-template<> EIGEN_DEVICE_FUNC Packet4f pinsertlast(const Packet4f& a, float b)
+template<> inline EIGEN_DEVICE_FUNC Packet4f pinsertlast(const Packet4f& a, float b)
 {
 #ifdef EIGEN_VECTORIZE_SSE4_1
   return _mm_blend_ps(a,pset1<Packet4f>(b),(1<<3));
@@ -828,7 +828,7 @@
 #endif
 }

-template<> EIGEN_DEVICE_FUNC Packet2d pinsertlast(const Packet2d& a, double b)
+template<> inline EIGEN_DEVICE_FUNC Packet2d pinsertlast(const Packet2d& a, double b)
 {
 #ifdef EIGEN_VECTORIZE_SSE4_1
   return _mm_blend_pd(a,pset1<Packet2d>(b),(1<<1));



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/