aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/arch/SSE/PacketMath.h
diff options
context:
space:
mode:
authorGravatar Antonio Sanchez <cantonios@google.com>2020-11-19 10:22:42 -0800
committerGravatar Rasmus Munk Larsen <rmlarsen@google.com>2020-11-24 20:20:36 +0000
commit22f67b59585805fedf86759f7013b2b670f83386 (patch)
tree6da38b27b7610b85afb6a3de1affba89d01eb249 /Eigen/src/Core/arch/SSE/PacketMath.h
parenta3b300f1af7b2bb646c9e64162630ac164802ec8 (diff)
Fix boolean float conversion and product warnings.
This fixes some gcc warnings such as: ``` Eigen/src/Core/GenericPacketMath.h:655:63: warning: implicit conversion turns floating-point number into bool: 'typename __gnu_cxx::__enable_if<__is_integer<bool>::__value, double>::__type' (aka 'double') to 'bool' [-Wimplicit-conversion-floating-point-to-bool] Packet psqrt(const Packet& a) { EIGEN_USING_STD(sqrt); return sqrt(a); } ``` Details: - Added `scalar_sqrt_op<bool>` (`-Wimplicit-conversion-floating-point-to-bool`). - Added `scalar_square_op<bool>` and `scalar_cube_op<bool>` specializations (`-Wint-in-bool-context`) - Deprecated above specialized ops for bool. - Modified `cxx11_tensor_block_eval` to specialize generator for booleans (`-Wint-in-bool-context`) and to use `abs` instead of `square` to avoid deprecated bool ops.
Diffstat (limited to 'Eigen/src/Core/arch/SSE/PacketMath.h')
-rwxr-xr-xEigen/src/Core/arch/SSE/PacketMath.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Eigen/src/Core/arch/SSE/PacketMath.h b/Eigen/src/Core/arch/SSE/PacketMath.h
index 4db701491..ef77ab6fa 100755
--- a/Eigen/src/Core/arch/SSE/PacketMath.h
+++ b/Eigen/src/Core/arch/SSE/PacketMath.h
@@ -218,7 +218,8 @@ template<> struct packet_traits<bool> : default_packet_traits
HasAbs2 = 0,
HasMin = 0,
HasMax = 0,
- HasConj = 0
+ HasConj = 0,
+ HasSqrt = 1
};
};