AdaptiveCpp: Eigen not working on hipSYCL sample code

I have tried to run a very simple SYCL code that uses EIgen, but fails to compile with cuda backend.

Code is the following:

#include <Eigen/Core>

int main() {
  Eigen::Vector4d a = Eigen::Vector4d::Random();
  Eigen::Vector4d b = Eigen::Vector4d::Random();
  Eigen::Vector4d c = Eigen::Vector4d::Random();

  cl::sycl::default_selector deviceSelector;
  cl::sycl::queue queue(deviceSelector);
  {
    cl::sycl::buffer<Eigen::Vector4d, 1> a_sycl(&a, cl::sycl::range<1>(1));
    cl::sycl::buffer<Eigen::Vector4d, 1> b_sycl(&b, cl::sycl::range<1>(1));
    cl::sycl::buffer<Eigen::Vector4d, 1> c_sycl(&c, cl::sycl::range<1>(1));

    queue.submit([&](cl::sycl::handler& cgh) {
      auto a_acc = a_sycl.get_access<cl::sycl::access::mode::read>(cgh);
      auto b_acc = b_sycl.get_access<cl::sycl::access::mode::read>(cgh);
      auto c_acc =
          c_sycl.get_access<cl::sycl::access::mode::discard_write>(cgh);

      cgh.single_task<class vector_addition>(
          [=]() {});  // c_acc[0] = a_acc[0] + b_acc[0]; });
    });

    // sycl buffers go out of scope and content is copied to host data
    // Are they copied also for a and b which havent changed?
  }

  std::cout << "  A { " << a.x() << ", " << a.y() << ", " << a.z() << ", "
            << a.w() << " }\n"
            << "+ B { " << b.x() << ", " << b.y() << ", " << b.z() << ", "
            << b.w() << " }\n"
            << "------------------\n"
            << "= C { " << c.x() << ", " << c.y() << ", " << c.z() << ", "
            << c.w() << " }" << std::endl;

  return 0;
}

and it fails with the following compilation errors

In file included from ../main.cpp:2:
In file included from /home/jjcasmar/D/usr/local/include/eigen3/Eigen/Core:155:
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/util/Meta.h:263:12: error: no matching function for call to '__int_as_float'
    return CUDART_MAX_NORMAL_F;
           ^~~~~~~~~~~~~~~~~~~
/opt/cuda/include/math_constants.h:57:33: note: expanded from macro 'CUDART_MAX_NORMAL_F'
#define CUDART_MAX_NORMAL_F     __int_as_float(0x7f7fffff)
                                ^~~~~~~~~~~~~~
/usr/lib/clang/10.0.1/include/__clang_cuda_device_functions.h:453:18: note: candidate function not viable: call to __device__ function from __host__ function
__DEVICE__ float __int_as_float(int __a) { return __nv_int_as_float(__a); }
                 ^
In file included from ../main.cpp:2:
In file included from /home/jjcasmar/D/usr/local/include/eigen3/Eigen/Core:155:
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/util/Meta.h:273:12: error: no matching function for call to '__int_as_float'
    return CUDART_INF_F;
           ^~~~~~~~~~~~
/opt/cuda/include/math_constants.h:54:33: note: expanded from macro 'CUDART_INF_F'
#define CUDART_INF_F            __int_as_float(0x7f800000)
                                ^~~~~~~~~~~~~~
/usr/lib/clang/10.0.1/include/__clang_cuda_device_functions.h:453:18: note: candidate function not viable: call to __device__ function from __host__ function
__DEVICE__ float __int_as_float(int __a) { return __nv_int_as_float(__a); }
                 ^
In file included from ../main.cpp:2:
In file included from /home/jjcasmar/D/usr/local/include/eigen3/Eigen/Core:155:
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/util/Meta.h:281:12: error: no matching function for call to '__int_as_float'
    return CUDART_NAN_F;
           ^~~~~~~~~~~~
/opt/cuda/include/math_constants.h:55:33: note: expanded from macro 'CUDART_NAN_F'
#define CUDART_NAN_F            __int_as_float(0x7fffffff)
                                ^~~~~~~~~~~~~~
/usr/lib/clang/10.0.1/include/__clang_cuda_device_functions.h:453:18: note: candidate function not viable: call to __device__ function from __host__ function
__DEVICE__ float __int_as_float(int __a) { return __nv_int_as_float(__a); }
                 ^
In file included from ../main.cpp:2:
In file included from /home/jjcasmar/D/usr/local/include/eigen3/Eigen/Core:155:
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/util/Meta.h:298:12: error: no matching function for call to '__longlong_as_double'
    return CUDART_INF;
           ^~~~~~~~~~
/opt/cuda/include/math_constants.h:91:33: note: expanded from macro 'CUDART_INF'
#define CUDART_INF              __longlong_as_double(0x7ff0000000000000ULL)
                                ^~~~~~~~~~~~~~~~~~~~
/usr/lib/clang/10.0.1/include/__clang_cuda_device_functions.h:511:19: note: candidate function not viable: call to __device__ function from __host__ function
__DEVICE__ double __longlong_as_double(long long __a) {
                  ^
In file included from ../main.cpp:2:
In file included from /home/jjcasmar/D/usr/local/include/eigen3/Eigen/Core:155:
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/util/Meta.h:306:12: error: no matching function for call to '__longlong_as_double'
    return CUDART_NAN;
           ^~~~~~~~~~
/opt/cuda/include/math_constants.h:92:33: note: expanded from macro 'CUDART_NAN'
#define CUDART_NAN              __longlong_as_double(0xfff8000000000000ULL)
                                ^~~~~~~~~~~~~~~~~~~~
/usr/lib/clang/10.0.1/include/__clang_cuda_device_functions.h:511:19: note: candidate function not viable: call to __device__ function from __host__ function
__DEVICE__ double __longlong_as_double(long long __a) {
                  ^
In file included from ../main.cpp:2:
In file included from /home/jjcasmar/D/usr/local/include/eigen3/Eigen/Core:164:
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_char' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1072:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1052:53: note: expanded from macro 'SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_char)   \
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:48: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                               ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:48: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                               ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:23: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                      ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_char' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1072:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1052:53: note: expanded from macro 'SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_char)   \
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:54: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                                     ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:58: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                                         ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:43: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                                          ^~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_char' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1072:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1052:53: note: expanded from macro 'SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_char)   \
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:54: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                                     ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:68: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                                                   ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:63: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                                                              ^~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_short' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1072:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1053:53: note: expanded from macro 'SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_short)  \
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:48: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                               ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:48: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                               ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:23: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                      ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_short' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1072:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1053:53: note: expanded from macro 'SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_short)  \
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:54: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                                     ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:58: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                                         ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:43: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                                          ^~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_short' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1072:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1053:53: note: expanded from macro 'SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_short)  \
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:54: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                                     ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:68: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                                                   ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:63: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                                                              ^~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_int' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1072:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1054:53: note: expanded from macro 'SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_int)    \
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:48: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                               ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:48: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                               ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:23: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                      ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_int' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1072:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1054:53: note: expanded from macro 'SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_int)    \
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:54: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                                     ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:58: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                                         ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:43: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                                          ^~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_int' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1072:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1054:53: note: expanded from macro 'SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_int)    \
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:54: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                                     ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:68: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                                                   ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:63: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                                                              ^~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_long' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1072:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1055:53: note: expanded from macro 'SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_long)
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:48: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                               ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:48: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                               ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:23: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                      ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_long' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1072:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1055:53: note: expanded from macro 'SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_long)
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:54: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                                     ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:58: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                                         ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:43: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                                          ^~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_long' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1072:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY(NAME, FUNC) \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1055:53: note: expanded from macro 'SYCL_SPECIALIZE_SIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_long)
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:54: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                                     ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:68: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                                                   ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:63: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                                                              ^~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_uchar' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1073:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY(NAME, FUNC)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1062:53: note: expanded from macro 'SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_uchar)  \
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:48: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                               ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:48: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                               ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:23: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                      ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1110:1: error: no type named 'cl_uchar' in namespace 'cl::sycl'
SYCL_SPECIALIZE_INTEGER_TYPES_BINARY(mini, min)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1073:3: note: expanded from macro 'SYCL_SPECIALIZE_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY(NAME, FUNC)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1062:53: note: expanded from macro 'SYCL_SPECIALIZE_UNSIGNED_INTEGER_TYPES_BINARY'
  SYCL_SPECIALIZE_BINARY_FUNC(NAME, FUNC, cl::sycl::cl_uchar)  \
                                          ~~~~~~~~~~^
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1108:54: note: expanded from macro 'SYCL_SPECIALIZE_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN2_BINARY_FUNC(NAME, FUNC, TYPE, TYPE)
                                                     ^~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1105:58: note: expanded from macro 'SYCL_SPECIALIZE_GEN2_BINARY_FUNC'
  SYCL_SPECIALIZE_GEN1_BINARY_FUNC(NAME, FUNC, RET_TYPE, ARG_TYPE, ARG_TYPE)
                                                         ^~~~~~~~
/home/jjcasmar/D/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:1100:43: note: expanded from macro 'SYCL_SPECIALIZE_GEN1_BINARY_FUNC'
  EIGEN_ALWAYS_INLINE RET_TYPE NAME(const ARG_TYPE1& x, const ARG_TYPE2& y) { \
                                          ^~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated when compiling for sm_60.

About this issue

Most upvoted comments

To my understanding, Eigen supports clang cuda (https://gitlab.com/libeigen/eigen/-/issues/1173), and in my test code, I dont even use eigen types in a kernel (kernel is empty).

Right. If there’s no code inside a kernel, then I’m not sure how hipSYCL could trigger those CUDA issues. I would still recommend checking if you can compile a CUDA version of the same code with clang to narrow down the issue. It might be that clang is not as well tested and there’s a regression in Eigen, or that it used to work and only newer clang versions cause trouble etc…

If Eigen also supports SYCL backend, could it be that is trying somehow to enable both CUDA backend and SYCL backend for Eigen?

I think this is exactly what is happening. See https://gitlab.com/libeigen/eigen/-/blob/master/Eigen/src/Core/util/Macros.h

The assumption inside Eigen that code is either SYCL or CUDA is not correct, since a SYCL implementation might sit on top of CUDA, as hipSYCL odes.

I am not sure your workaround is a good idea, since Eigen defines vectors with different padding depending if it detects CUDA compiler or not, so trying to tweak it may open a can of worms.

I would say, our goal should be to have it treat the vector like a SYCL vector and not like a CUDA one, hence my workaround. It seems you can also disable CUDA in Eigen with the macro EIGEN_NO_CUDA, so this might also be worth a try.