Eigen support: only tensor module, or arrays and matrices as well?

I have a project whose compute code uses Eigen, and I wish to compile it for GPUs using ComputeCpp if possible.
While the Eigen Overview sounds like general support (“Codeplay has added OpenCL™ hardware support to Eigen”), reading a bit further makes it appear as if only Eigen’s tensor module is supported.
However, regarding that topic seems to be quite a while old (3-6 years, and I can’t post the links because of a link number limit as a new contributor).

Is it possible to compile Eigen code for GPUs with ComputeCpp, if the Eigen code uses Eigen::Array and Eigen::Matrix? And if not, is this planned for the (near) future?

Here are the links:


Hi @lens

Let me take the question and pass it on to people who are more familiar with this subject. I will get back to you with an answer.

Thank you.

ComputeCpp does not support Eigen anymore. Only DPCPP works with Tensor operation from the unsupported module. The unsupported module means in this context https://eigen.tuxfamily.org/dox/unsupported/index.html. They are modules that are not officially supported by the Eigen core dev team.

If you have any comments or questions please do put them here.

Hey illya, thanks for the reply!
On the documentation page you linked, there’s a single link to the “SYCL backend for Eigen”:
Both links on that page point to ComputeCpp-pages, and the tensor benchmark linked in one of them uses it as well:

It looks to me as if ComputeCpp is still required as a SYCL implementation - or the documentation is out of date. Could you clarify?

ComputeCpp after this PR ([SYCL-2020 Support] Enabling Intel DPCPP Compiler support to Eigen (!1126) · Merge requests · libeigen / eigen · GitLab), Eigen will not work with ComputeCpp as it requires support for the feature Generic pointer. Once ComputeCpp supports the feature allowing a generic address space, it will work again with Eigen.

Now you can run Eigen with DPC++, using the following:

export CXX=/path/to/intel/dpcpp_compiler/bin/clang++
export CC=/path/to/intel/dpcpp_compiler/bin/clang
export LD_LIBRARY_PATH=/path/to/intel/dpcpp_compiler/lib/
#if you are running on an Intel CPU or GPU
ctest --build-clean -C Release -D Experimental

The DPCPP target can be changed based on the architecture targeted: -DDPCPP_SYCL_TARGET=“spir64” is for Intel. NVidia has Ptx.

If required, to run only the SYCL tests, you can use the same EIGEN_MAKE_ARGS=“-j4” ./check.sh sycl

Sorry, forgot to mention. To use the Intel DPC++, a version LLVM clang compiler for SYCL, use the Intel oneAPI Base Toolkit.