0
0
mirror of https://gitlab.com/libeigen/eigen.git synced 2026-01-18 17:31:19 +01:00
Commit Graph

12909 Commits

Author SHA1 Message Date
Chip Kerchner
3ff3d03783 Merge remote-tracking branch 'origin2/master' 2025-11-20 17:43:17 +00:00
Chip Kerchner
49623d0c4e This patch adds support for RISCV's vector extension RVV1.0.
libeigen/eigen!2030
2025-11-20 16:28:07 +00:00
Chip Kerchner
196eed3d62 Merge branch 'master' of https://gitlab.com/libeigen/eigen 2025-11-20 15:45:06 +00:00
Rasmus Munk Larsen
8eb6551a8a Add support for complex numbers in the generic clang backend
libeigen/eigen!2078

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
2025-11-20 00:26:37 +00:00
Chip Kerchner
1242d948dd Merge remote-tracking branch 'origin2/master' 2025-11-18 12:59:58 +00:00
Joseph Prince Mathew
8401a241cb Add summary to lldb pretty printing of Eigen::Matrix
libeigen/eigen!2016

Co-authored-by: Joseph Prince Mathew <jmathew@dbuoy.com>
2025-11-17 17:24:03 +00:00
Eric A. Borisch
e75c29fd9d EigenTesting.cmake: Quote argument to separate_arguments.
libeigen/eigen!2077

Closes #3005 and #2866
2025-11-17 17:22:44 +00:00
Chip Kerchner
38e2b94367 Merge remote-tracking branch 'origin' 2025-11-14 00:00:35 +00:00
Yu You
dcbaf2d608 Switch the inline hint to EIGEN_ALWAYS_INLINE for a few functions
libeigen/eigen!2076

Closes #2993
2025-11-13 03:58:53 +00:00
Rasmus Munk Larsen
a7674b70d3 Improve packet op test coverage for IEEE special values.
libeigen/eigen!2075

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
2025-11-12 22:19:50 +00:00
Chip Kerchner
26dc851a72 Merge remote-tracking branch 'origin' 2025-11-12 15:08:17 +00:00
Charles Schlosser
72bfca3d82 cxx11_tensor_expr.cpp: delete extraneous semicolon
libeigen/eigen!2074
2025-11-11 01:39:38 +00:00
Rasmus Munk Larsen
9b511fe4fe Fix cxx11_tensor_expr.cpp 2025-11-10 19:11:35 +00:00
Chaofan Qiu
943fdc71c6 Use more FMA in reciprocal iteration for precision
libeigen/eigen!2073
2025-11-10 18:36:11 +00:00
Charles Schlosser
1133aa82c7 fix various compiler warnings
libeigen/eigen!2072
2025-11-10 17:14:35 +00:00
Charles Schlosser
8ae3b1aaa5 Fix loongarch unsigned pabsdiff
libeigen/eigen!2071
2025-11-09 19:19:43 +00:00
Rasmus Munk Larsen
035cf68498 Fix build of realview.cpp 2025-11-08 23:19:54 +00:00
Rasmus Munk Larsen
23a5482fc0 Misc. packet math cleanups.
libeigen/eigen!2070

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
2025-11-08 21:57:20 +00:00
Antonio Sánchez
4cb0776f8e Add 5.0.1 release notes and a few unreleased features.
libeigen/eigen!2069
2025-11-08 20:51:44 +00:00
Charles Schlosser
8b85f5933a Fix realview
libeigen/eigen!2062
2025-11-08 13:36:43 +00:00
Rasmus Munk Larsen
ffcd7bdbd6 Avoid breaking the build on older compilers.
See merge request libeigen/eigen!2068

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
2025-11-07 21:25:09 +00:00
Antonio Sánchez
da867c31c9 Fix defines in AVX512 custom TRSM kernel.
<!-- 
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->

Broken at head by !2063.

See merge request libeigen/eigen!2066
2025-11-07 20:14:24 +00:00
Rasmus Munk Larsen
8a9bfb72d7 Rename preduce_half for HVX. 2025-11-07 16:52:07 +00:00
Chip Kerchner
332bfa95c4 Merge remote-tracking branch 'origin/master' 2025-11-07 14:51:14 +00:00
Antonio Sánchez
ed989c7504 Enable generic clang backend tests.
<!-- 
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->

Enable generic clang backend tests.

Added an AVX512 job using the generic clang backend.

Also fixed up some guards in the custom AVX512 gemm/trsm kernels so they don't
start defining things if they aren't used.

See merge request libeigen/eigen!2063
2025-11-07 01:37:12 +00:00
Rasmus Munk Larsen
3368ac6c69 Don't set platform-specific vectorization macros for generic backend.
See merge request libeigen/eigen!2065

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
2025-11-06 23:12:54 +00:00
Rasmus Munk Larsen
fecfa7f27e Fixes to make generic backend build with AVX512
See merge request libeigen/eigen!2064

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
2025-11-06 22:50:32 +00:00
Rasmus Munk Larsen
ec93a6d098 Add a generic Eigen backend based on clang vector extensions
The goal of this MR is to implement a generic SIMD backend (packet ops) for Eigen that uses clang vector extensions instead of platform-dependent intrinsics. Ideally, this should make it possible to build Eigen and achieve reasonable speed on any platform that has a recent clang compiler, without having to write any inline assembly or intrinsics.

Caveats:

* The current implementation is a proof of concept and supports vectorization for float, double, int32_t, and int64_t using fixed-size 512-bit vectors (a somewhat arbitrary choice). I have not done much to tune this for speed yet.
* For now, there is no way to enable this other than setting -DEIGEN_VECTORIZE_GENERIC on the command line.
* This only compiles with newer versions of clang. I have tested that it compiles and all tests pass with clang 19.1.7.

https://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors

Closes #2998 and #2997

See merge request libeigen/eigen!2051

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
Co-authored-by: Antonio Sánchez <cantonios@google.com>
2025-11-06 21:52:19 +00:00
Rasmus Munk Larsen
7c7d84735e Align temporary array in TensorSelectOp packet evaluator. nightly 2025-11-05 19:44:47 +00:00
Antonio Sánchez
142caf889c Fix MKL enum conversion warning.
<!-- 
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->

Fix MKL enum conversion warning.

### Reference issue
<!--
You can link to a specific issue using the gitlab syntax #<issue number>. 
If the MR fixes an issue, write "Fixes #<issue number>" to have the issue automatically closed on merge.
-->
Fixes #2999.

Closes #2999

See merge request libeigen/eigen!2061
2025-11-05 18:03:22 +00:00
Antonio Sánchez
9e5714b93b Remove deprecated CUDA device properties.
<!-- 
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->

Remove deprecated CUDA device properties.

### Reference issue
<!--
You can link to a specific issue using the gitlab syntax #<issue number>. 
If the MR fixes an issue, write "Fixes #<issue number>" to have the issue automatically closed on merge.
-->
Fixes #3000.

Closes #3000

See merge request libeigen/eigen!2060
2025-11-05 17:12:33 +00:00
Tyler Veness
06f5cb4878 Use wrapper macro for multidimensional subscript feature test
See merge request libeigen/eigen!2059
2025-11-04 22:26:27 +00:00
Rasmus Munk Larsen
63fc0bc8c1 Make TernarySelectOp immune to const differences.
See merge request libeigen/eigen!2058

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
2025-11-04 21:42:32 +00:00
Rasmus Munk Larsen
71703a9816 Make assume_aligned a no-op on ARM & ARM64 when msan is used, to work around a missing linker symbol. 2025-11-04 20:26:36 +00:00
Tyler Veness
f95b4698fc Add support for C++23 multidimensional subscript operator
I'm not sure where to put tests for this, assuming they're needed. They also wouldn't run in CI anyway since CI only exercises the C++17 codepaths.

See merge request libeigen/eigen!2053
2025-11-04 07:03:04 +00:00
Rasmus Munk Larsen
b6fcddccfc Get rid of pblend packet op.
There was only a single code path left in TensorEvaluator using pblend. We can replace that with a call to the more general TernarySelectOp and get rid of pblend entirely from Core.

Closes #2998

See merge request libeigen/eigen!2056

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
2025-11-03 23:27:50 +00:00
Rasmus Munk Larsen
ed9a0e59ba Fix more bugs in !2052
Fixes #2998

Closes #2998

See merge request libeigen/eigen!2057

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
2025-11-03 20:26:17 +00:00
Rasmus Munk Larsen
a20fc40e4e Revert "simplify squaredNorm"
This causes some subtle alignment-related bugs, which @chuckyschluz is currently investigating.

See merge request libeigen/eigen!2055
2025-11-03 18:59:51 +00:00
Antonio Sánchez
04eb06b354 Fix doc references for nullary expressions.
<!-- 
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->

Fix doc references for nullary expressions.

### Reference issue
<!--
You can link to a specific issue using the gitlab syntax #<issue number>. 
If the MR fixes an issue, write "Fixes #<issue number>" to have the issue automatically closed on merge.
-->

Fixes #2997.

### Additional information
<!--Any additional information you think is important.-->

Closes #2997

See merge request libeigen/eigen!2054
2025-11-03 18:47:04 +00:00
Rasmus Munk Larsen
bfdbc031c2 Fixes #2998. 2025-11-02 23:58:16 +00:00
Rasmus Munk Larsen
8716f109e4 Implement assume_aligned using the standard API
This implements `Eigen::internal::assume_aligned` to match the API for C++20 standard as best as possible using either `std::assume_aligned` or `__builtin_assume_aligned` if available. If neither is available, the function is a no-op.

The override macro `EIGEN_ASSUME_ALIGNED` was changed to a `EIGEN_DONT_ASSUME_ALIGNED`, which now forces the function to be a no-op.

See merge request libeigen/eigen!2052
2025-11-01 12:04:19 +00:00
Rasmus Munk Larsen
ce70a507c0 Enable more generic packet ops for double.
See merge request libeigen/eigen!2050
2025-10-30 19:14:43 +00:00
Charles Schlosser
fb5bb3e98f simplify squaredNorm
<!-- 
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->
My review of https://gitlab.com/libeigen/eigen/-/merge_requests/2048 reminded me there was a much easier and better way of doing this for complex arrays.


### Reference issue
<!--
You can link to a specific issue using the gitlab syntax #<issue number>. 
If the MR fixes an issue, write "Fixes #<issue number>" to have the issue automatically closed on merge.
-->

### Additional information
<!--Any additional information you think is important.-->

See merge request libeigen/eigen!2049
2025-10-30 02:51:15 +00:00
Rasmus Munk Larsen
ece9a4c0b6 Always vectorize abs2() for non-complex types.
For several packet types, `abs2` was not vectorized even if it only requires `pmul`. Get rid of the confusing and redundant `HasAbs2` enum and instead check `HasMul` in addition to making sure the scalar type is not complex.

See merge request libeigen/eigen!2048
2025-10-30 02:42:56 +00:00
Antonio Sánchez
60122df698 Allow user to configure if free is allowed at runtime.
<!-- 
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->

Allow user to configure if `free` is allowed at runtime.

Reverts to Eigen 3.4 behavior by default, where `free(...)` is allowed if `EIGEN_RUNTIME_NO_MALLOC` is defined but `set_is_malloc_allowed(true)`.  Adds a separate `set_is_free_allowed(...)` to explicitly control use of `std::free`.

### Reference issue
<!--
You can link to a specific issue using the gitlab syntax #<issue number>. 
If the MR fixes an issue, write "Fixes #<issue number>" to have the issue automatically closed on merge.
-->

Fixes #2983.

### Additional information
<!--Any additional information you think is important.-->

Closes #2983

See merge request libeigen/eigen!2047
2025-10-28 22:29:00 +00:00
Chip Kerchner
add5e76204 Merge remote-tracking branch 'origin2/master' 2025-10-28 20:26:26 +00:00
Tyler Veness
9234883914 Fix SparseVector::insert(Index) assigning int to Scalar
Scalar doesn't necessarily support implicit construction from int or
assignment from int.

Here's the error message I got without this fix:
```
/home/tav/git/Sleipnir/build/_deps/eigen3-src/Eigen/src/SparseCore/SparseVector.h:180:25: error: no match for ‘operator=’ (operand types are ‘Eigen::internal::CompressedStorage<ExplicitDouble, int>::Scalar’ {aka ‘ExplicitDouble’} and ‘int’)
  180 |     m_data.value(p + 1) = 0;
      |     ~~~~~~~~~~~~~~~~~~~~^~~
```

See merge request libeigen/eigen!2046
2025-10-27 22:06:59 +00:00
Tyler Veness
be56fff1ff Fix ambiguous sqrt() overload caused by ADL
Here's the compiler error:
```
/home/tav/git/Sleipnir/build/_deps/eigen3-src/Eigen/src/Householder/Householder.h:82:16: error: call of overloaded ‘sqrt(boost::decimal::decimal64_t)’ is ambiguous
   82 |     beta = sqrt(numext::abs2(c0) + tailSqNorm);
      |            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tav/git/Sleipnir/build/_deps/eigen3-src/Eigen/src/Householder/Householder.h:82:16: note: there are 2 candidates
In file included from /home/tav/git/Sleipnir/build/_deps/eigen3-src/Eigen/Core:198,
                 from /home/tav/git/Sleipnir/test/src/optimization/cart_pole_problem_test.cpp:8:
/home/tav/git/Sleipnir/build/_deps/eigen3-src/Eigen/src/Core/MathFunctions.h:1384:75: note: candidate 1: ‘typename Eigen::internal::sqrt_retval<typename Eigen::internal::global_math_functions_filtering_base<Scalar>::type>::type Eigen::numext::sqrt(const Scalar&) [with Scalar = boost::decimal::decimal64_t; typename Eigen::internal::sqrt_retval<typename Eigen::internal::global_math_functions_filtering_base<Scalar>::type>::type = boost::decimal::decimal64_t; typename Eigen::internal::global_math_functions_filtering_base<Scalar>::type = boost::decimal::decimal64_t]’
 1384 | EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_MATHFUNC_RETVAL(sqrt, Scalar) sqrt(const Scalar& x) {
      |                                                                           ^~~~
In file included from /home/tav/git/Sleipnir/build/_deps/decimal-src/include/boost/decimal/detail/cmath/ellint_1.hpp:16,
                 from /home/tav/git/Sleipnir/build/_deps/decimal-src/include/boost/decimal/cmath.hpp:18,
                 from /home/tav/git/Sleipnir/build/_deps/decimal-src/include/boost/decimal.hpp:33,
                 from /home/tav/git/Sleipnir/test/include/scalar_types_under_test.hpp:6,
                 from /home/tav/git/Sleipnir/test/src/optimization/cart_pole_problem_test.cpp:19:
/home/tav/git/Sleipnir/build/_deps/decimal-src/include/boost/decimal/detail/cmath/sqrt.hpp:167:16: note: candidate 2: ‘constexpr T boost::decimal::sqrt(T) requires  is_decimal_floating_point_v<T> [with T = decimal64_t]’
  167 | constexpr auto sqrt(const T val) noexcept
      |                ^~~~
```

Calling a function via its unqualified name invokes argument-dependent lookup. In this case, since `using numext::sqrt;` was used, both `numext::sqrt()` and `boost::decimal::sqrt()` participated in overload resolution. Since only `numext::sqrt()` was intended, the fix is to call that overload directly instead.

See merge request libeigen/eigen!2044
2025-10-26 02:03:22 +00:00
Rasmus Munk Larsen
2e91853adf Fix a benign bug in ComplexQZ
ComplexQZ would try to apply a Jacobi rotation to an empty block, which triggers a warning in static analyzers, since the corresponding `Eigen::Map` object will contain a `nullptr`.

See merge request libeigen/eigen!2043
2025-10-24 20:54:54 +00:00
Antonio Sánchez
1a5eecd45e Clarify range spanning major versions only works with 3.4.1.
<!-- 
Thanks for contributing a merge request!

We recommend that first-time contributors read our [contribution guidelines](https://eigen.tuxfamily.org/index.php?title=Contributing_to_Eigen).

Before submitting the MR, please complete the following checks:
- Create one PR per feature or bugfix,
- Run the test suite to verify your changes.
  See our [test guidelines](https://eigen.tuxfamily.org/index.php?title=Tests).
- Add tests to cover the bug addressed or any new feature.
- Document new features.  If it is a substantial change, add it to the [Changelog](https://gitlab.com/libeigen/eigen/-/blob/master/CHANGELOG.md).
- Leave the following box checked when submitting: `Allow commits from members who can merge to the target branch`.
  This allows us to rebase and merge your change.

Note that we are a team of volunteers; we appreciate your patience during the review process.
-->

### Description
<!--Please explain your changes.-->

Clarify range spanning major versions only works with 3.4.1.

### Reference issue
<!--
You can link to a specific issue using the gitlab syntax #<issue number>. 
If the MR fixes an issue, write "Fixes #<issue number>" to have the issue automatically closed on merge.
-->

Fixes #2994.

Closes #2994

See merge request libeigen/eigen!2042
2025-10-24 19:54:27 +00:00