New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 1450 - Error while compiling any Eigen code with nvcc
Summary: Error while compiling any Eigen code with nvcc
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.3 (current stable)
Hardware: x86 - 64-bit Windows
: Normal Compilation Problem
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-18 07:45 UTC by Денис Сенькин
Modified: 2017-07-18 08:02 UTC (History)
3 users (show)



Attachments

Description Денис Сенькин 2017-07-18 07:45:47 UTC
Error:

d:\dev-tools\eigen\eigen\src/Core/MathFunctions.h(1090): error C2794: 'type' : is not a member of any direct or indirect base class of 'std::enable_if<false,T>'
1>          with
1>          [
1>              T=float
1>          ]
1>d:\dev-tools\eigen\eigen\src/Core/MathFunctions.h(1094): error C2794: 'type' : is not a member of any direct or indirect base class of 'std::enable_if<false,double>'
1>d:\dev-tools\eigen\eigen\src/Core/MathFunctions.h(1100): error C2794: 'type' : is not a member of any direct or indirect base class of 'std::enable_if<false,T>'
1>          with
1>          [
1>              T=float
1>          ]
1>d:\dev-tools\eigen\eigen\src/Core/MathFunctions.h(1106): error C2794: 'type' : is not a member of any direct or indirect base class of 'std::enable_if<false,double>'

Windows 10 x64
Visual Studio 2013
CUDA 8
Comment 1 Денис Сенькин 2017-07-18 08:02:36 UTC
Possible solution is to replace 

template<typename T>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
typename Eigen::internal::enable_if<!(NumTraits<T>::IsSigned || NumTraits<T>::isComplex), typename NumTraits<T>::Real>::type
abs(const T &x) {
  return x;
}


with


template<typename T, typename = typename Eigen::internal::enable_if<!(NumTraits<T>::IsSigned || NumTraits<T>::isComplex)>::type>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
typename NumTraits<T>::Real
abs(const T &x) {
  return x;
}

Note You need to log in before you can comment on or make changes to this bug.