Skip to content

Changes to support SYCL

Aurora Perego requested to merge AuroraPerego/eigen:sycl into master

Working on the porting of pixeltrack-standalone to SYCL there were few things that didn't supported SYCL yet.

support for SYCL math functions Some functions in the namespace std are not supported in SYCL and their equivalent is in the SYCL namespace. For this reason EIGEN_USING_STD has been divided into EIGEN_USING_STD for non-math functions and in EIGEN_USING_STD_MATH for math functions. When EIGEN_USE_SYCL is defined, math functions in the SYCL namespace are used.

All the using std:: of a math function have been moved to EIGEN_USING_STD_MATH to be consistent with the above change.

SYCL_EXTERNAL Only when EIGEN_USE_SYCL is defined, the SYCL_EXTERNAL attribute has been added when needed.

std::rand() not supported in SYCL kernels As a workaround to std::rand(), a random number generator taken from oneDPL is used instead. Not completely sure about this, since oneDPL has to be downloaded from github if the user is not using dpcpp and oneAPI Toolkit (here is included by default).

other

  • patch in Eigen/src/Core/GenericPacketMath.h because from is a sycl::vec and not a scalar (this probably needs more investigation)
  • add a multi_ptr in Eigen/src/Core/arch/SYCL/PacketMath.h because the compiler was not able to choose between the const and the not const version of a method
  • changed some deprecated methods

Merge request reports