16 #ifndef EIGEN_BFLOAT16_H 17 #define EIGEN_BFLOAT16_H 19 #define BF16_PACKET_FUNCTION(PACKET_F, PACKET_BF16, METHOD) \ 21 EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED \ 22 PACKET_BF16 METHOD<PACKET_BF16>(const PACKET_BF16& _x) { \ 23 return F32ToBf16(METHOD<PACKET_F>(Bf16ToF32(_x))); \ 30 namespace bfloat16_impl {
33 struct __bfloat16_raw {
34 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR __bfloat16_raw() : value(0) {}
35 explicit EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR __bfloat16_raw(
unsigned short raw) : value(raw) {}
39 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR __bfloat16_raw raw_uint16_to_bfloat16(
unsigned short value);
40 template <
bool AssumeArgumentIsNormalOrInfinityOrZero>
41 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC __bfloat16_raw float_to_bfloat16_rtne(
float ff);
45 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC __bfloat16_raw float_to_bfloat16_rtne<false>(
float ff);
47 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC __bfloat16_raw float_to_bfloat16_rtne<true>(
float ff);
48 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
float bfloat16_to_float(__bfloat16_raw h);
50 struct bfloat16_base :
public __bfloat16_raw {
51 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bfloat16_base() {}
52 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bfloat16_base(
const __bfloat16_raw& h) : __bfloat16_raw(h) {}
58 struct bfloat16 :
public bfloat16_impl::bfloat16_base {
60 typedef bfloat16_impl::__bfloat16_raw __bfloat16_raw;
62 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bfloat16() {}
64 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bfloat16(
const __bfloat16_raw& h) : bfloat16_impl::bfloat16_base(h) {}
66 explicit EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bfloat16(
bool b)
67 : bfloat16_impl::bfloat16_base(bfloat16_impl::raw_uint16_to_bfloat16(b ? 0x3f80 : 0)) {}
70 explicit EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bfloat16(T val)
71 : bfloat16_impl::bfloat16_base(bfloat16_impl::float_to_bfloat16_rtne<
internal::is_integral<T>::value>(static_cast<float>(val))) {}
73 explicit EIGEN_DEVICE_FUNC bfloat16(
float f)
74 : bfloat16_impl::bfloat16_base(bfloat16_impl::float_to_bfloat16_rtne<false>(f)) {}
78 template<
typename RealScalar>
79 explicit EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bfloat16(
const std::complex<RealScalar>& val)
80 : bfloat16_impl::bfloat16_base(bfloat16_impl::float_to_bfloat16_rtne<false>(static_cast<float>(val.
real()))) {}
82 EIGEN_DEVICE_FUNC
operator float()
const {
83 return bfloat16_impl::bfloat16_to_float(*
this);
90 struct numeric_limits<
Eigen::bfloat16> {
91 static const bool is_specialized =
true;
92 static const bool is_signed =
true;
93 static const bool is_integer =
false;
94 static const bool is_exact =
false;
95 static const bool has_infinity =
true;
96 static const bool has_quiet_NaN =
true;
97 static const bool has_signaling_NaN =
true;
98 static const float_denorm_style has_denorm = std::denorm_absent;
99 static const bool has_denorm_loss =
false;
100 static const std::float_round_style round_style = numeric_limits<float>::round_style;
101 static const bool is_iec559 =
false;
102 static const bool is_bounded =
true;
103 static const bool is_modulo =
false;
104 static const int digits = 8;
105 static const int digits10 = 2;
106 static const int max_digits10 = 4;
107 static const int radix = 2;
108 static const int min_exponent = numeric_limits<float>::min_exponent;
109 static const int min_exponent10 = numeric_limits<float>::min_exponent10;
110 static const int max_exponent = numeric_limits<float>::max_exponent;
111 static const int max_exponent10 = numeric_limits<float>::max_exponent10;
112 static const bool traps = numeric_limits<float>::traps;
113 static const bool tinyness_before = numeric_limits<float>::tinyness_before;
115 static Eigen::bfloat16 (min)() {
return Eigen::bfloat16_impl::raw_uint16_to_bfloat16(0x0080); }
116 static Eigen::bfloat16 lowest() {
return Eigen::bfloat16_impl::raw_uint16_to_bfloat16(0xff7f); }
117 static Eigen::bfloat16 (max)() {
return Eigen::bfloat16_impl::raw_uint16_to_bfloat16(0x7f7f); }
118 static Eigen::bfloat16 epsilon() {
return Eigen::bfloat16_impl::raw_uint16_to_bfloat16(0x3c00); }
119 static Eigen::bfloat16 round_error() {
return Eigen::bfloat16(0x3f00); }
120 static Eigen::bfloat16 infinity() {
return Eigen::bfloat16_impl::raw_uint16_to_bfloat16(0x7f80); }
121 static Eigen::bfloat16 quiet_NaN() {
return Eigen::bfloat16_impl::raw_uint16_to_bfloat16(0x7fc0); }
122 static Eigen::bfloat16 signaling_NaN() {
return Eigen::bfloat16_impl::raw_uint16_to_bfloat16(0x7f81); }
123 static Eigen::bfloat16 denorm_min() {
return Eigen::bfloat16_impl::raw_uint16_to_bfloat16(0x0001); }
131 struct numeric_limits<const
Eigen::bfloat16> : numeric_limits<Eigen::bfloat16> {};
133 struct numeric_limits<volatile Eigen::bfloat16> : numeric_limits<Eigen::bfloat16> {};
135 struct numeric_limits<const volatile Eigen::bfloat16> : numeric_limits<Eigen::bfloat16> {};
140 namespace bfloat16_impl {
145 #if !defined(EIGEN_HAS_NATIVE_BF16) || (EIGEN_COMP_CLANG && !EIGEN_COMP_NVCC) // Emulate support for bfloat16 floats 147 #if EIGEN_COMP_CLANG && defined(EIGEN_CUDACC) 149 #pragma push_macro("EIGEN_DEVICE_FUNC") 150 #undef EIGEN_DEVICE_FUNC 151 #if defined(EIGEN_HAS_CUDA_BF16) && defined(EIGEN_HAS_NATIVE_BF16) 152 #define EIGEN_DEVICE_FUNC __host__ 153 #else // both host and device need emulated ops. 154 #define EIGEN_DEVICE_FUNC __host__ __device__ 161 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator + (
const bfloat16& a,
const bfloat16& b) {
162 return bfloat16(
float(a) +
float(b));
164 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator + (
const bfloat16& a,
const int& b) {
165 return bfloat16(
float(a) + static_cast<float>(b));
167 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator + (
const int& a,
const bfloat16& b) {
168 return bfloat16(static_cast<float>(a) +
float(b));
170 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
operator * (
const bfloat16& a,
const bfloat16& b) {
171 return bfloat16(
float(a) *
float(b));
173 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator - (
const bfloat16& a,
const bfloat16& b) {
174 return bfloat16(
float(a) -
float(b));
176 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator / (
const bfloat16& a,
const bfloat16& b) {
177 return bfloat16(
float(a) /
float(b));
179 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator - (
const bfloat16& a) {
181 result.value = a.value ^ 0x8000;
184 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16& operator += (bfloat16& a,
const bfloat16& b) {
185 a = bfloat16(
float(a) +
float(b));
188 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16& operator *= (bfloat16& a,
const bfloat16& b) {
189 a = bfloat16(
float(a) *
float(b));
192 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16& operator -= (bfloat16& a,
const bfloat16& b) {
193 a = bfloat16(
float(a) -
float(b));
196 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16& operator /= (bfloat16& a,
const bfloat16& b) {
197 a = bfloat16(
float(a) /
float(b));
200 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator++(bfloat16& a) {
204 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator--(bfloat16& a) {
208 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator++(bfloat16& a,
int) {
209 bfloat16 original_value = a;
211 return original_value;
213 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator--(bfloat16& a,
int) {
214 bfloat16 original_value = a;
216 return original_value;
218 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
bool operator == (
const bfloat16& a,
const bfloat16& b) {
219 return numext::equal_strict(
float(a),
float(b));
221 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
bool operator != (
const bfloat16& a,
const bfloat16& b) {
222 return numext::not_equal_strict(
float(a),
float(b));
224 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
bool operator < (
const bfloat16& a,
const bfloat16& b) {
225 return float(a) < float(b);
227 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
bool operator <= (
const bfloat16& a,
const bfloat16& b) {
228 return float(a) <= float(b);
230 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
bool operator > (
const bfloat16& a,
const bfloat16& b) {
231 return float(a) > float(b);
233 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
bool operator >= (
const bfloat16& a,
const bfloat16& b) {
234 return float(a) >= float(b);
237 #if EIGEN_COMP_CLANG && defined(EIGEN_CUDACC) 238 #pragma pop_macro("EIGEN_DEVICE_FUNC") 240 #endif // Emulate support for bfloat16 floats 244 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 operator / (
const bfloat16& a,
Index b) {
245 return bfloat16(static_cast<float>(a) / static_cast<float>(b));
248 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC __bfloat16_raw truncate_to_bfloat16(
const float v) {
249 __bfloat16_raw output;
250 if (Eigen::numext::isnan EIGEN_NOT_A_MACRO(v)) {
251 output.value = std::signbit(v) ? 0xFFC0: 0x7FC0;
254 const uint16_t* p =
reinterpret_cast<const uint16_t*
>(&v);
255 #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ 263 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR __bfloat16_raw raw_uint16_to_bfloat16(numext::uint16_t value) {
264 return __bfloat16_raw(value);
267 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR numext::uint16_t raw_bfloat16_as_uint16(
const __bfloat16_raw& bf) {
274 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC __bfloat16_raw float_to_bfloat16_rtne<false>(
float ff) {
275 #if (defined(EIGEN_HAS_CUDA_BF16) && defined(EIGEN_HAS_HIP_BF16)) 278 __bfloat16_raw output;
280 if (Eigen::numext::isnan EIGEN_NOT_A_MACRO(ff)) {
286 output.value = std::signbit(ff) ? 0xFFC0: 0x7FC0;
437 output = float_to_bfloat16_rtne<true>(ff);
448 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC __bfloat16_raw float_to_bfloat16_rtne<true>(
float ff) {
449 #if (defined(EIGEN_HAS_CUDA_BF16) && defined(EIGEN_HAS_HIP_BF16)) 452 numext::uint32_t input = numext::bit_cast<numext::uint32_t>(ff);
453 __bfloat16_raw output;
456 numext::uint32_t lsb = (input >> 16) & 1;
457 numext::uint32_t rounding_bias = 0x7fff + lsb;
458 input += rounding_bias;
459 output.value =
static_cast<numext::uint16_t
>(input >> 16);
464 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
float bfloat16_to_float(__bfloat16_raw h) {
466 unsigned short* q =
reinterpret_cast<unsigned short*
>(&result);
467 #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ 476 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool (
isinf)(
const bfloat16& a) {
477 EIGEN_USING_STD(
isinf);
478 return (
isinf)(float(a));
480 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool (
isnan)(
const bfloat16& a) {
481 EIGEN_USING_STD(
isnan);
482 return (
isnan)(float(a));
484 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool (
isfinite)(
const bfloat16& a) {
485 return !(
isinf EIGEN_NOT_A_MACRO (a)) && !(
isnan EIGEN_NOT_A_MACRO (a));
488 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
abs(
const bfloat16& a) {
490 result.value = a.value & 0x7FFF;
493 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
exp(
const bfloat16& a) {
494 return bfloat16(::expf(
float(a)));
496 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
expm1(
const bfloat16& a) {
497 return bfloat16(numext::expm1(
float(a)));
499 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
log(
const bfloat16& a) {
500 return bfloat16(::logf(
float(a)));
502 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
log1p(
const bfloat16& a) {
503 return bfloat16(numext::log1p(
float(a)));
505 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
log10(
const bfloat16& a) {
506 return bfloat16(::log10f(
float(a)));
508 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
log2(
const bfloat16& a) {
509 return bfloat16(static_cast<float>(EIGEN_LOG2E) * ::logf(
float(a)));
511 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
sqrt(
const bfloat16& a) {
512 return bfloat16(::sqrtf(
float(a)));
514 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(
const bfloat16& a,
const bfloat16& b) {
515 return bfloat16(::powf(
float(a),
float(b)));
517 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
sin(
const bfloat16& a) {
518 return bfloat16(::sinf(
float(a)));
520 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
cos(
const bfloat16& a) {
521 return bfloat16(::cosf(
float(a)));
523 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
tan(
const bfloat16& a) {
524 return bfloat16(::tanf(
float(a)));
526 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
asin(
const bfloat16& a) {
527 return bfloat16(::asinf(
float(a)));
529 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
acos(
const bfloat16& a) {
530 return bfloat16(::acosf(
float(a)));
532 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
atan(
const bfloat16& a) {
533 return bfloat16(::atanf(
float(a)));
535 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
sinh(
const bfloat16& a) {
536 return bfloat16(::sinhf(
float(a)));
538 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
cosh(
const bfloat16& a) {
539 return bfloat16(::coshf(
float(a)));
541 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
tanh(
const bfloat16& a) {
542 return bfloat16(::tanhf(
float(a)));
544 #if EIGEN_HAS_CXX11_MATH 545 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
asinh(
const bfloat16& a) {
546 return bfloat16(::asinhf(
float(a)));
548 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
acosh(
const bfloat16& a) {
549 return bfloat16(::acoshf(
float(a)));
551 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
atanh(
const bfloat16& a) {
552 return bfloat16(::atanhf(
float(a)));
555 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
floor(
const bfloat16& a) {
556 return bfloat16(::floorf(
float(a)));
558 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
ceil(
const bfloat16& a) {
559 return bfloat16(::ceilf(
float(a)));
561 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
rint(
const bfloat16& a) {
562 return bfloat16(::rintf(
float(a)));
564 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16
round(
const bfloat16& a) {
565 return bfloat16(::roundf(
float(a)));
567 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 fmod(
const bfloat16& a,
const bfloat16& b) {
568 return bfloat16(::fmodf(
float(a),
float(b)));
571 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 (min)(
const bfloat16& a,
const bfloat16& b) {
572 const float f1 =
static_cast<float>(a);
573 const float f2 =
static_cast<float>(b);
574 return f2 < f1 ? b : a;
576 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 (max)(
const bfloat16& a,
const bfloat16& b) {
577 const float f1 =
static_cast<float>(a);
578 const float f2 =
static_cast<float>(b);
579 return f1 < f2 ? b : a;
582 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 fmin(
const bfloat16& a,
const bfloat16& b) {
583 const float f1 =
static_cast<float>(a);
584 const float f2 =
static_cast<float>(b);
585 return bfloat16(::fminf(f1, f2));
587 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 fmax(
const bfloat16& a,
const bfloat16& b) {
588 const float f1 =
static_cast<float>(a);
589 const float f2 =
static_cast<float>(b);
590 return bfloat16(::fmaxf(f1, f2));
594 EIGEN_ALWAYS_INLINE std::ostream& operator << (std::ostream& os,
const bfloat16& v) {
595 os << static_cast<float>(v);
605 struct random_default_impl<bfloat16, false, false>
607 static inline bfloat16 run(
const bfloat16& x,
const bfloat16& y)
609 return x + (y-x) * bfloat16(
float(std::rand()) / float(RAND_MAX));
611 static inline bfloat16 run()
613 return run(bfloat16(-1.f), bfloat16(1.f));
617 template<>
struct is_arithmetic<bfloat16> {
enum { value =
true }; };
621 template<>
struct NumTraits<
Eigen::bfloat16>
622 : GenericNumTraits<Eigen::bfloat16>
628 RequireInitialization =
false 631 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static EIGEN_STRONG_INLINE Eigen::bfloat16 epsilon() {
632 return bfloat16_impl::raw_uint16_to_bfloat16(0x3c00);
634 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static EIGEN_STRONG_INLINE Eigen::bfloat16 dummy_precision() {
635 return bfloat16_impl::raw_uint16_to_bfloat16(0x3D4D);
638 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static EIGEN_STRONG_INLINE Eigen::bfloat16 highest() {
639 return bfloat16_impl::raw_uint16_to_bfloat16(0x7F7F);
641 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static EIGEN_STRONG_INLINE Eigen::bfloat16 lowest() {
642 return bfloat16_impl::raw_uint16_to_bfloat16(0xFF7F);
644 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static EIGEN_STRONG_INLINE Eigen::bfloat16 infinity() {
645 return bfloat16_impl::raw_uint16_to_bfloat16(0x7f80);
647 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static EIGEN_STRONG_INLINE Eigen::bfloat16 quiet_NaN() {
648 return bfloat16_impl::raw_uint16_to_bfloat16(0x7fc0);
658 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
659 bool (
isnan)(
const Eigen::bfloat16& h) {
660 return (bfloat16_impl::isnan)(h);
664 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
665 bool (
isinf)(
const Eigen::bfloat16& h) {
666 return (bfloat16_impl::isinf)(h);
670 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
671 bool (
isfinite)(
const Eigen::bfloat16& h) {
672 return (bfloat16_impl::isfinite)(h);
676 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::bfloat16 bit_cast<Eigen::bfloat16, uint16_t>(
const uint16_t& src) {
677 return Eigen::bfloat16(Eigen::bfloat16_impl::raw_uint16_to_bfloat16(src));
681 EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC uint16_t bit_cast<uint16_t, Eigen::bfloat16>(
const Eigen::bfloat16& src) {
682 return Eigen::bfloat16_impl::raw_bfloat16_as_uint16(src);
688 #if EIGEN_HAS_STD_HASH 691 struct hash<
Eigen::bfloat16> {
692 EIGEN_STRONG_INLINE std::size_t operator()(
const Eigen::bfloat16& a)
const {
693 return static_cast<std::size_t
>(Eigen::numext::bit_cast<Eigen::numext::uint16_t>(a));
700 #endif // EIGEN_BFLOAT16_H const Eigen::CwiseUnaryOp< Eigen::internal::scalar_tanh_op< typename Derived::Scalar >, const Derived > tanh(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sinh_op< typename Derived::Scalar >, const Derived > sinh(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_isfinite_op< typename Derived::Scalar >, const Derived > isfinite(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sqrt_op< typename Derived::Scalar >, const Derived > sqrt(const Eigen::ArrayBase< Derived > &x)
Namespace containing all symbols from the Eigen library.
Definition: Core:141
Definition: BFloat16.h:88
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_ceil_op< typename Derived::Scalar >, const Derived > ceil(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_asin_op< typename Derived::Scalar >, const Derived > asin(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_acos_op< typename Derived::Scalar >, const Derived > acos(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_isnan_op< typename Derived::Scalar >, const Derived > isnan(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_cos_op< typename Derived::Scalar >, const Derived > cos(const Eigen::ArrayBase< Derived > &x)
const Product< MatrixDerived, PermutationDerived, AliasFreeProduct > operator*(const MatrixBase< MatrixDerived > &matrix, const PermutationBase< PermutationDerived > &permutation)
Definition: PermutationMatrix.h:515
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_round_op< typename Derived::Scalar >, const Derived > round(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_rint_op< typename Derived::Scalar >, const Derived > rint(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_floor_op< typename Derived::Scalar >, const Derived > floor(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_log1p_op< typename Derived::Scalar >, const Derived > log1p(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_isinf_op< typename Derived::Scalar >, const Derived > isinf(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_real_op< typename Derived::Scalar >, const Derived > real(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_abs_op< typename Derived::Scalar >, const Derived > abs(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_cosh_op< typename Derived::Scalar >, const Derived > cosh(const Eigen::ArrayBase< Derived > &x)
Definition: Eigen_Colamd.h:50
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_log_op< typename Derived::Scalar >, const Derived > log(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_tan_op< typename Derived::Scalar >, const Derived > tan(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_expm1_op< typename Derived::Scalar >, const Derived > expm1(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_atanh_op< typename Derived::Scalar >, const Derived > atanh(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_log2_op< typename Derived::Scalar >, const Derived > log2(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_atan_op< typename Derived::Scalar >, const Derived > atan(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sin_op< typename Derived::Scalar >, const Derived > sin(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_exp_op< typename Derived::Scalar >, const Derived > exp(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_log10_op< typename Derived::Scalar >, const Derived > log10(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_acosh_op< typename Derived::Scalar >, const Derived > acosh(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_asinh_op< typename Derived::Scalar >, const Derived > asinh(const Eigen::ArrayBase< Derived > &x)