mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Clean up packetmath tests and fix various bugs to make bfloat16 pass (almost) all packetmath tests with SSE, AVX, and AVX512.
This commit is contained in:
@@ -1626,8 +1626,6 @@ template <> struct is_arithmetic<Packet16bf> { enum { value = true }; };
|
||||
template <>
|
||||
struct packet_traits<bfloat16> : default_packet_traits {
|
||||
typedef Packet16bf type;
|
||||
// There is no half-size packet for current Packet16bf.
|
||||
// TODO: support as SSE path.
|
||||
typedef Packet8bf half;
|
||||
enum {
|
||||
Vectorizable = 1,
|
||||
@@ -1883,6 +1881,11 @@ EIGEN_STRONG_INLINE Packet16bf pmax<Packet16bf>(const Packet16bf& a,
|
||||
return F32ToBf16(pmax<Packet16f>(Bf16ToF32(a), Bf16ToF32(b)));
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet16bf plset<Packet16bf>(const bfloat16& a) {
|
||||
return F32ToBf16(plset<Packet16f>(static_cast<float>(a)));
|
||||
}
|
||||
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet8bf predux_half_dowto4<Packet16bf>(const Packet16bf& a) {
|
||||
Packet8bf lane0 = _mm256_extractf128_si256(a, 0);
|
||||
|
||||
Reference in New Issue
Block a user