mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-01 01:29:08 +08:00
bcabf9be90
* [eigen3] Fix usage in Linux * version
27 lines
1.1 KiB
Diff
27 lines
1.1 KiB
Diff
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<typename PacketType,typename Func>
|
|
EIGEN_DEVICE_FUNC
|
|
-PacketType packetwise_redux_empty_value(const Func& ) { return pset1<PacketType>(0); }
|
|
+PacketType packetwise_redux_empty_value(const Func& ) {
|
|
+ const typename unpacket_traits<PacketType>::type zero(0);
|
|
+ return pset1<PacketType>(zero);
|
|
+}
|
|
+
|
|
|
|
/* For products the default is 1 */
|
|
template<typename PacketType,typename Scalar>
|
|
EIGEN_DEVICE_FUNC
|
|
-PacketType packetwise_redux_empty_value(const scalar_product_op<Scalar,Scalar>& ) { return pset1<PacketType>(1); }
|
|
+PacketType packetwise_redux_empty_value(const scalar_product_op<Scalar,Scalar>& ) {
|
|
+ return pset1<PacketType>(Scalar(1));
|
|
+}
|
|
+
|
|
|
|
/* Perform the actual reduction */
|
|
template<typename Func, typename Evaluator,
|