Closed nR3D closed 3 months ago
@nR3D we can check the macro in eigen for using https://gitlab.com/libeigen/eigen/-/blob/master/Eigen/Core#L111
@nR3D another place for sycl is https://eigen.tuxfamily.org/dox-devel/Macros_8h_source.html and https://gitlab.com/libeigen/eigen/-/blob/master/Eigen/src/Core/util/Macros.h#L851
I have solved the issue in the 3d case, it turned out to be a problem with the allocation size of the neighborhood list, which was too small. As discussed in previous PRs, the solution would be to define a method that determines the maximum number of particles contained withing the kernel's smoothing radius, or by removing the usage of a neighborhood list all together.
At this point all the issues with Eigen seem to have been solved, so I will remove the draft status from the PR.
@nR3D Great to hear it.
So far SYCL vector types (
sycl::vec
) have been used as a replacement for Eigen matrices and arrays, since the latter are directly supported for SYCL kernel execution. This led to the introduction of a parallel set of data types (e.g.DeviceVecd
instead ofVecd
) that could be used within SYCL kernels. However, Eigen provides many algebraic methods that SYCL vectors lack, additionally the support for two different vector types would mean a less maintainable codebase. Ideally, using Eigen for both CPU and GPU execution is the option to pursue (as long as the performance gap w.r.t. SYCL vectors is not excessive). The following changes enable an initial support for Eigen data types within SYCL kernels, however many aspect are still to be considered, so I will keep this pull request as a draft for the moment being:test_2d_dambreak
is working as expected (with ca. 4% slowdown compared to SYCL vectors)test_3d_dambreak
is compiling correctly and it executes for the first second of simulation time, however it then segfaults by accessing a wrong GPU address. The simulation results are correct up until that point, and the same simulation runs fine with SYCL vectors.min
/max
) which are not supported by SYCL (https://support.codeplay.com/t/eigen-support-only-tensor-module-or-arrays-and-matrices-as-well/561/5) so those methods have to be replaced by another implementation. However, re-implementing Eigen methods is against the objective of this PR. Ultimately, a work-around to make all Eigen methods work is needed.https://gitlab.com/libeigen/eigen/-/issues/2763 This is a recently-opened discussion with additional resources and insights on SYCL support by Eigen.