aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/arch/Default/Half.h
diff options
context:
space:
mode:
authorGravatar Antonio Sanchez <cantonios@google.com>2020-11-23 16:11:01 -0800
committerGravatar Antonio Sánchez <cantonios@google.com>2020-11-24 16:46:41 +0000
commita3b300f1af7b2bb646c9e64162630ac164802ec8 (patch)
treeb7bb7c74e3f6350ff767172345fc4e089b062ef8 /Eigen/src/Core/arch/Default/Half.h
parent38abf2be4289a8da5db2d5b1db759f26800ae1d3 (diff)
Implement missing AVX half ops.
Minimal implementation of AVX `Eigen::half` ops to bring in line with `bfloat16`. Allows `packetmath_13` to pass. Also adjusted `bfloat16` packet traits to match the supported set of ops (e.g. Bessel is not actually implemented).
Diffstat (limited to 'Eigen/src/Core/arch/Default/Half.h')
-rw-r--r--Eigen/src/Core/arch/Default/Half.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Eigen/src/Core/arch/Default/Half.h b/Eigen/src/Core/arch/Default/Half.h
index d6ddff59c..5166f54c7 100644
--- a/Eigen/src/Core/arch/Default/Half.h
+++ b/Eigen/src/Core/arch/Default/Half.h
@@ -56,6 +56,13 @@
#define EIGEN_CONSTEXPR
#endif
+#define F16_PACKET_FUNCTION(PACKET_F, PACKET_F16, METHOD) \
+ template <> \
+ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED \
+ PACKET_F16 METHOD<PACKET_F16>(const PACKET_F16& _x) { \
+ return float2half(METHOD<PACKET_F>(half2float(_x))); \
+ }
+
namespace Eigen {
struct half;