mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
fix 2828
This commit is contained in:
@@ -580,7 +580,7 @@ EIGEN_DEVICE_FUNC inline Packet pandnot(const Packet& a, const Packet& b) {
|
||||
}
|
||||
|
||||
// In the general case, use bitwise select.
|
||||
template <typename Packet, typename EnableIf = void>
|
||||
template <typename Packet, bool is_scalar = is_scalar<Packet>::value>
|
||||
struct pselect_impl {
|
||||
static EIGEN_DEVICE_FUNC inline Packet run(const Packet& mask, const Packet& a, const Packet& b) {
|
||||
return por(pand(a, mask), pandnot(b, mask));
|
||||
@@ -589,9 +589,9 @@ struct pselect_impl {
|
||||
|
||||
// For scalars, use ternary select.
|
||||
template <typename Packet>
|
||||
struct pselect_impl<Packet, std::enable_if_t<is_scalar<Packet>::value>> {
|
||||
struct pselect_impl<Packet, true> {
|
||||
static EIGEN_DEVICE_FUNC inline Packet run(const Packet& mask, const Packet& a, const Packet& b) {
|
||||
return numext::equal_strict(mask, Packet(0)) ? b : a;
|
||||
return numext::select(mask, a, b);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user