Problem compiling with Intel OneAPI dpcpp
I have been trying to use Eigen with Intel OneAPI dpcpp compiler (based on clang). This compiler can also compile sycl. It had a few problems:
/opt/eigen/include/eigen3/Eigen/src/Core/MathFunctions.h:1062:51: error: use of undeclared identifier 'cl'
EIGEN_ALWAYS_INLINE float abs(float x) { return cl::sycl::fabs(x); }
After commenting out these lines in MathFunctions.h
, I still get problems:
/opt/eigen/include/eigen3/Eigen/src/Core/arch/SSE/Complex.h:378:3: error: non-void function does not return a value [-Werror,-Wreturn-type]
}
etc.
Finally, I used -DEIGEN_DONT_VECTORIZE
and it worked. I am not sure what needs fixing here, but it might be a good thing to do, since dpcpp might become more common soon?