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?
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”: https://eigen.tuxfamily.org/dox/unsupported/SYCL_EIGEN.html
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?
Now you can run Eigen with DPC++, using the following:
export LD_LIBRARY_PATH=/path/to/intel/dpcpp_compiler/lib/ #if you are running on an Intel CPU or GPU
cmake … -DEIGEN_TEST_SYCL=1 -DEIGEN_SYCL_DPCPP=ON -DCMAKE_BUILD_TYPE=Release -DDPCPP_SYCL_TARGET=“spir64” -DSITE=“your site name” -DEIGEN_TEST_BUILD_DOCUMENTATION=1 -DEIGEN_INTERNAL_DOCUMENTATION=1 -GNinja
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