From bcabf9be904b9cad969a57674a280699f9e84a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Thu, 31 Mar 2022 07:59:55 +0800 Subject: [PATCH] [eigen3] Fix usage in Linux (#23869) * [eigen3] Fix usage in Linux * version --- .../fix-vectorized-reductions-half.patch | 26 +++++++++++++++++++ ports/eigen3/portfile.cmake | 4 ++- ports/eigen3/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/e-/eigen3.json | 5 ++++ 5 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 ports/eigen3/fix-vectorized-reductions-half.patch 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