|Summary:||Vectorize .reverse() and .reverseInPlace()|
|Product:||Eigen||Reporter:||Christoph Hertzberg <chtz>|
|Component:||Core - vectorization||Assignee:||Nobody <eigen.nobody>|
|Severity:||Optimization||CC:||chtz, gael.guennebaud, jacob.benoit.1, markos|
|Hardware:||x86 - AVX|
Description Christoph Hertzberg 2019-02-22 10:38:08 UTC
While exposing a bug in LLVM, Bug 1684 also demonstrated that many reverse operations could be nicely vectorized, especially with AVX or AVX512. E.g., a rowwise vectorization of a Matrix4f with AVX would be possible using two vperm2f128 instructions with AVX or one vpermps instruction with AVX512F. Similar optimizations are possible with SSE for matrices with 2 rows or (slightly more complicated) 4*n+2 rows. Low priority/JuniorJob. If someone wants to try this, but does not want to dig into the internals of Eigen, provide solutions like: template<int rows, int cols> void rowwise_reverse(float* out, float const* in); template<int rows, int cols> void colwise_reverseInPlace(float* in_out); (Or with a templated Scalar instead of float) It is also ok to provide solutions just for some cases at first (but avoid writing too much boiler plate code).
Comment 1 Nobody 2019-12-04 18:31:21 UTC
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1685.