Make TernarySelectOp immune to const differences.

See merge request libeigen/eigen!2058

Co-authored-by: Rasmus Munk Larsen <rmlarsen@google.com>
This commit is contained in:
Rasmus Munk Larsen
2025-11-04 21:42:32 +00:00
parent 71703a9816
commit 63fc0bc8c1
2 changed files with 3 additions and 2 deletions

View File

@@ -789,7 +789,7 @@ struct TensorEvaluator<const TensorSelectOp<IfArgType, ThenArgType, ElseArgType>
template <int LoadMode, bool UseTernary = TernaryPacketAccess, std::enable_if_t<!UseTernary, bool> = true>
EIGEN_DEVICE_FUNC PacketReturnType packet(Index index) const {
Scalar arr[PacketSize];
std::remove_const_t<Scalar> arr[PacketSize];
EIGEN_UNROLL_LOOP
for (Index i = 0; i < PacketSize; ++i) {
arr[i] = m_condImpl.coeff(index + i) ? Scalar(-1) : Scalar(0);