SYCL Docs?
Describe the feature you would like to be implemented.
Docs / getting started guide for SYCL with Eigen.
Would such a feature be useful for other users? Why?
Yes, SYCL appears to be non-trivial to get working with Eigen. State seems to be moving quickly, so I am uncertain if limited docs I could find external to Eigen are current. I can see via grep
, there has been significant investment in SYCL compatibility in code base, so some docs would identify the capability and improve positive exploitation.
Any hints on how to implement the requested feature?
Something similar to CUDA page? https://eigen.tuxfamily.org/dox/TopicCUDA.html
It would be wonderful to have a test program available for environment validation. Appreciate the potential maintenance burden.
For me, minimal test program of Eigen::Vector3d operations in SYCL kernel required:
#define EIGEN_DONT_VECTORIZE_SYCL 1
#define EIGEN_DONT_VECTORIZE 1
Otherwise compiler (Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.1.0.20220316)) errored on:
/eigen-3.4.0/Eigen/src/Core/arch/SSE/PacketMath.h:794:117: error: always_inline function '_mm_storeu_pd' requires target feature 'sse2', but would be inlined into function 'pstoreu' that is compiled without support for 'sse2'
template<> EIGEN_STRONG_INLINE void pstoreu<double>(double* to, const Packet2d& from) { EIGEN_DEBUG_UNALIGNED_STORE _mm_storeu_pd(to, from); }
I'd point out the plethora of environment variables suggested in links below. I'm hesitant to use them as these docs are old/possibly deprecated. I have stepped the defines to find minimal ones which appear to compile (vectorization). I'm uncertain if this results in a config with performance problems however. I assume that for host and device side compute I'd need to separate compilation with and without use of Eigen vectorization respectively, these kinds of points are great for docs / getting started.
Additional resources
- CodePlay docs (deprecated?): https://developer.codeplay.com/products/computecpp/ce/2.11.0/guides/eigen-overview/options-for-building-eigen-sycl
- Past issue with vectorization blocker: #1836 (closed) (#1836 (closed))
- CodePlay forum support post: https://support.codeplay.com/t/eigen-support-only-tensor-module-or-arrays-and-matrices-as-well/561/5