Trying to compile a program using Cuda 5.5 and visual 2012. This is my log : c:\****\eigen-dev\eigen\src/Core/util/Meta.h(103): error : identifier "__FLT_EPSILON__" is undefined c:\****\eigen-dev\eigen\src/Core/util/Meta.h(108): error : identifier "__DBL_EPSILON__" is undefined c:\****\eigen-dev\eigen\src/Core/util/Memory.h(92): warn ing: integer conversion resulted in a change of sign c:\****\eigen-dev\eigen\src/Core/Block.h(105): error: "o perator=" has already been declared in the current scope detected during instantiation of class "Eigen::Block<XprType, BlockRow s, BlockCols, InnerPanel> [with XprType=VectorType, BlockRows=<expression>, Bloc kCols=<expression>, InnerPanel=false]" c:\****\eigen-dev\eigen\src/Core/VectorBlock.h(58): here c:\****\eigen-dev\eigen\src/Core/Ref.h(123): error: "ope rator=" has already been declared in the current scope detected during instantiation of class "Eigen::RefBase<Derived> [with Derived=Eigen::Ref<PlainObjectType, Options, StrideType>]" (184): here c:\****\eigen-dev\eigen\src/Core/products/Parallelizer.h (20): warning: variable "m_maxThreads" was set but never used c:\****\eigen-dev\eigen\src/Core/ArrayWrapper.h(133): wa rning: __declspec attributes ignored c:\****\eigen-dev\eigen\src/Geometry/RotationBase.h(76): error: function template "Eigen::operator*(const Eigen::EigenBase<OtherDerived> &, const Eigen::Quaternion<_Scalar, _Options> &)" has already been defined detected during: instantiation of class "Eigen::RotationBase<Derived, _Dim> [with Der ived=Eigen::Quaternion<_Scalar, _Options>, _Dim=3]" c:\****\eigen-dev\eigen\src/Geometry/Quaternion.h(35): h ere instantiation of class "Eigen::QuaternionBase<Derived> [with Derived =Eigen::Quaternion<_Scalar, _Options>]" c:\****\eigen-dev\eigen\src/Geometry/Quaternion.h(232): here For the first two errors it is just a windows include problem I guess. For the next ones, it seems to have issues with templates.
Just including <Eigen/Eigen> in a .cu file produces similar problems for me with Cuda 6.5, Visual Studio 2013. I've tried several branches of Eigen, including 3.2 development branch and nvcc_fix, all with the same issues. MSVC Output follows: c:\dev\sysroot32\usr\include\eigen\src/Core/util/Meta.h(103): error : identifier "__FLT_EPSILON__" is undefined c:\dev\sysroot32\usr\include\eigen\src/Core/util/Meta.h(108): error : identifier "__DBL_EPSILON__" is undefined c:\dev\sysroot32\usr\include\eigen\src/Core/Block.h(105): error : "operator=" has already been declared in the current scope detected during instantiation of class "Eigen::Block<XprType, BlockRows, BlockCols, InnerPanel> [with XprType=VectorType, BlockRows=<expression>, BlockCols=<expression>, InnerPanel=false]" c:\dev\sysroot32\usr\include\eigen\src/Core/VectorBlock.h(58): here c:\dev\sysroot32\usr\include\eigen\src/Core/Ref.h(123): error : "operator=" has already been declared in the current scope detected during instantiation of class "Eigen::RefBase<Derived> [with Derived=Eigen::Ref<PlainObjectType, Options, StrideType>]" (188): here c:\dev\sysroot32\usr\include\eigen\src/Core/products/Parallelizer.h(20): warning : variable "m_maxThreads" was set but never used c:\dev\sysroot32\usr\include\eigen\src/Core/ArrayWrapper.h(133): warning : __declspec attributes ignored
I have also had this issue historically, and I managed to fix them myself. Now I am able to include <Eigen/Core> in Cuda files and compile without warnings. My fork with this solution is given in the following repo https://github.com/Berzerka/eigen It seems that the needed fixes was to move some code from implementation files to DenseBase (due to compiler bugs in nvcc), it seems this has already been done in some other cases, so if this is deemed an acceptable change we could maybe move my commits into the dev branch?
Could you please provide a patch (or pull request) against the current head?
I have provided a pull request, it will likely need some polishing.
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/735.