diff --git a/ports/eigen3/fix-vectorized-reductions-half.patch b/ports/eigen3/fix-vectorized-reductions-half.patch new file mode 100644 index 0000000000..1c5e592db5 --- /dev/null +++ b/ports/eigen3/fix-vectorized-reductions-half.patch @@ -0,0 +1,26 @@ +diff --git a/Eigen/src/Core/PartialReduxEvaluator.h b/Eigen/src/Core/PartialReduxEvaluator.h +index 29abf35..4051fcf 100644 +--- a/Eigen/src/Core/PartialReduxEvaluator.h ++++ b/Eigen/src/Core/PartialReduxEvaluator.h +@@ -54,12 +54,19 @@ struct packetwise_redux_traits + /* Value to be returned when size==0 , by default let's return 0 */ + template + EIGEN_DEVICE_FUNC +-PacketType packetwise_redux_empty_value(const Func& ) { return pset1(0); } ++PacketType packetwise_redux_empty_value(const Func& ) { ++ const typename unpacket_traits::type zero(0); ++ return pset1(zero); ++} ++ + + /* For products the default is 1 */ + template + EIGEN_DEVICE_FUNC +-PacketType packetwise_redux_empty_value(const scalar_product_op& ) { return pset1(1); } ++PacketType packetwise_redux_empty_value(const scalar_product_op& ) { ++ return pset1(Scalar(1)); ++} ++ + + /* Perform the actual reduction */ + template