GenericPacketMath.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
5 // Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_GENERIC_PACKET_MATH_H
12 #define EIGEN_GENERIC_PACKET_MATH_H
13 
14 // IWYU pragma: private
15 #include "./InternalHeaderCheck.h"
16 
17 namespace Eigen {
18 
19 namespace internal {
20 
29 #ifndef EIGEN_DEBUG_ALIGNED_LOAD
30 #define EIGEN_DEBUG_ALIGNED_LOAD
31 #endif
32 
33 #ifndef EIGEN_DEBUG_UNALIGNED_LOAD
34 #define EIGEN_DEBUG_UNALIGNED_LOAD
35 #endif
36 
37 #ifndef EIGEN_DEBUG_ALIGNED_STORE
38 #define EIGEN_DEBUG_ALIGNED_STORE
39 #endif
40 
41 #ifndef EIGEN_DEBUG_UNALIGNED_STORE
42 #define EIGEN_DEBUG_UNALIGNED_STORE
43 #endif
44 
46  enum {
47  // Ops that are implemented for most types.
48  HasAdd = 1,
49  HasSub = 1,
50  HasShift = 1,
51  HasMul = 1,
52  HasNegate = 1,
53  HasAbs = 1,
54  HasAbs2 = 1,
55  HasMin = 1,
56  HasMax = 1,
57  HasConj = 1,
59  HasSign = 1,
60  // By default, the nearest integer functions (rint, round, floor, ceil, trunc) are enabled for all scalar and packet
61  // types
62  HasRound = 1,
63 
64  HasArg = 0,
66  HasBlend = 0,
67  // This flag is used to indicate whether packet comparison is supported.
68  // pcmp_eq, pcmp_lt and pcmp_le should be defined for it to be true.
69  HasCmp = 0,
70 
71  HasDiv = 0,
73  HasSqrt = 0,
74  HasRsqrt = 0,
75  HasExp = 0,
76  HasExpm1 = 0,
77  HasLog = 0,
78  HasLog1p = 0,
79  HasLog10 = 0,
80  HasPow = 0,
81  HasSin = 0,
82  HasCos = 0,
83  HasTan = 0,
84  HasASin = 0,
85  HasACos = 0,
86  HasATan = 0,
87  HasATanh = 0,
88  HasSinh = 0,
89  HasCosh = 0,
90  HasTanh = 0,
91  HasLGamma = 0,
93  HasZeta = 0,
95  HasErf = 0,
96  HasErfc = 0,
97  HasNdtri = 0,
98  HasBessel = 0,
99  HasIGamma = 0,
103  HasBetaInc = 0
104  };
105 };
106 
107 template <typename T>
109  typedef T type;
110  typedef T half;
111  enum {
113  size = 1,
115  };
116  enum {
117  HasAdd = 0,
118  HasSub = 0,
119  HasMul = 0,
121  HasAbs = 0,
122  HasAbs2 = 0,
123  HasMin = 0,
124  HasMax = 0,
125  HasConj = 0,
126  HasSetLinear = 0
127  };
128 };
129 
130 template <typename T>
131 struct packet_traits<const T> : packet_traits<T> {};
132 
133 template <typename T>
135  typedef T type;
136  typedef T half;
137  typedef typename numext::get_integer_by_size<sizeof(T)>::signed_type integer_packet;
138  enum {
139  size = 1,
140  alignment = alignof(T),
141  vectorizable = false,
143  masked_store_available = false
144  };
145 };
146 
147 template <typename T>
148 struct unpacket_traits<const T> : unpacket_traits<T> {};
149 
153 template <typename Packet>
154 struct is_scalar {
157 };
158 
159 // automatically and succinctly define combinations of pcast<SrcPacket,TgtPacket> when
160 // 1) the packets are the same type, or
161 // 2) the packets differ only in sign.
162 // In both of these cases, preinterpret (bit_cast) is equivalent to pcast (static_cast)
163 template <typename SrcPacket, typename TgtPacket,
165 struct is_degenerate_helper : is_same<SrcPacket, TgtPacket> {};
166 template <>
167 struct is_degenerate_helper<int8_t, uint8_t, true> : std::true_type {};
168 template <>
169 struct is_degenerate_helper<int16_t, uint16_t, true> : std::true_type {};
170 template <>
171 struct is_degenerate_helper<int32_t, uint32_t, true> : std::true_type {};
172 template <>
173 struct is_degenerate_helper<int64_t, uint64_t, true> : std::true_type {};
174 
175 template <typename SrcPacket, typename TgtPacket>
176 struct is_degenerate_helper<SrcPacket, TgtPacket, false> {
178  static constexpr int SrcSize = unpacket_traits<SrcPacket>::size;
180  static constexpr int TgtSize = unpacket_traits<TgtPacket>::size;
181  static constexpr bool value = is_degenerate_helper<SrcScalar, TgtScalar, true>::value && (SrcSize == TgtSize);
182 };
183 
184 // is_degenerate<T1,T2>::value == is_degenerate<T2,T1>::value
185 template <typename SrcPacket, typename TgtPacket>
187  static constexpr bool value =
189 };
190 
191 template <typename Packet>
192 struct is_half {
194  static constexpr int Size = unpacket_traits<Packet>::size;
197  static constexpr bool value = Size != 1 && Size < DefaultSize;
198 };
199 
200 template <typename Src, typename Tgt>
202  enum {
206  TgtCoeffRatio = 1
207  };
208 };
209 
210 // provides a succinct template to define vectorized casting traits with respect to the largest accessible packet types
211 template <typename Src, typename Tgt>
213  enum : int {
219  };
220 };
221 
224 template <typename T, int unique_id = 0>
226  EIGEN_ALWAYS_INLINE operator T&() { return m_val; }
227  EIGEN_ALWAYS_INLINE operator const T&() const { return m_val; }
231  m_val = v;
232  return *this;
233  }
234 
236 };
237 
240 
241 template <typename Target, typename Packet>
243  // the packets are not the same, attempt scalar bit_cast
245  return numext::bit_cast<Target, Packet>(a);
246  }
247 };
248 
249 template <typename Packet>
251  // the packets are the same type: do nothing
253 };
254 
256 template <typename Target, typename Packet>
259 }
260 
262  bool TgtIsHalf = is_half<TgtPacket>::value>
264 
265 template <typename SrcPacket, typename TgtPacket>
266 struct pcast_generic<SrcPacket, TgtPacket, false, false> {
267  // the packets are not degenerate: attempt scalar static_cast
268  static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket run(const SrcPacket& a) {
270  }
271 };
272 
273 template <typename Packet>
274 struct pcast_generic<Packet, Packet, true, false> {
275  // the packets are the same: do nothing
277 };
278 
279 template <typename SrcPacket, typename TgtPacket, bool TgtIsHalf>
280 struct pcast_generic<SrcPacket, TgtPacket, true, TgtIsHalf> {
281  // the packets are degenerate: preinterpret is equivalent to pcast
282  static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket run(const SrcPacket& a) { return preinterpret<TgtPacket>(a); }
283 };
284 
286 template <typename SrcPacket, typename TgtPacket>
287 EIGEN_DEVICE_FUNC inline TgtPacket pcast(const SrcPacket& a) {
289 }
290 template <typename SrcPacket, typename TgtPacket>
291 EIGEN_DEVICE_FUNC inline TgtPacket pcast(const SrcPacket& a, const SrcPacket& b) {
293 }
294 template <typename SrcPacket, typename TgtPacket>
295 EIGEN_DEVICE_FUNC inline TgtPacket pcast(const SrcPacket& a, const SrcPacket& b, const SrcPacket& c,
296  const SrcPacket& d) {
298 }
299 template <typename SrcPacket, typename TgtPacket>
300 EIGEN_DEVICE_FUNC inline TgtPacket pcast(const SrcPacket& a, const SrcPacket& b, const SrcPacket& c, const SrcPacket& d,
301  const SrcPacket& e, const SrcPacket& f, const SrcPacket& g,
302  const SrcPacket& h) {
303  return pcast_generic<SrcPacket, TgtPacket>::run(a, b, c, d, e, f, g, h);
304 }
305 
306 template <typename SrcPacket, typename TgtPacket>
307 struct pcast_generic<SrcPacket, TgtPacket, false, true> {
308  // TgtPacket is a half packet of some other type
309  // perform cast and truncate result
311  static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket run(const SrcPacket& a) {
312  return preinterpret<TgtPacket>(pcast<SrcPacket, DefaultTgtPacket>(a));
313  }
314 };
315 
317 template <typename Packet>
318 EIGEN_DEVICE_FUNC inline Packet padd(const Packet& a, const Packet& b) {
319  return a + b;
320 }
321 // Avoid compiler warning for boolean algebra.
322 template <>
323 EIGEN_DEVICE_FUNC inline bool padd(const bool& a, const bool& b) {
324  return a || b;
325 }
326 
331 template <typename Packet>
332 EIGEN_DEVICE_FUNC inline std::enable_if_t<unpacket_traits<Packet>::masked_fpops_available, Packet> padd(
333  const Packet& a, const Packet& b, typename unpacket_traits<Packet>::mask_t umask);
334 
336 template <typename Packet>
337 EIGEN_DEVICE_FUNC inline Packet psub(const Packet& a, const Packet& b) {
338  return a - b;
339 }
340 
342 template <typename Packet>
345  NEGATE IS NOT DEFINED FOR BOOLEAN TYPES)
346  return numext::negate(a);
347 }
348 
350 template <typename Packet>
352  return numext::conj(a);
353 }
354 
356 template <typename Packet>
357 EIGEN_DEVICE_FUNC inline Packet pmul(const Packet& a, const Packet& b) {
358  return a * b;
359 }
360 // Avoid compiler warning for boolean algebra.
361 template <>
362 EIGEN_DEVICE_FUNC inline bool pmul(const bool& a, const bool& b) {
363  return a && b;
364 }
365 
367 template <typename Packet>
368 EIGEN_DEVICE_FUNC inline Packet pdiv(const Packet& a, const Packet& b) {
369  return a / b;
370 }
371 
372 // In the generic case, memset to all one bits.
373 template <typename Packet, typename EnableIf = void>
374 struct ptrue_impl {
375  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& /*a*/) {
376  Packet b;
377  memset(static_cast<void*>(&b), 0xff, sizeof(Packet));
378  return b;
379  }
380 };
381 
382 // For booleans, we can only directly set a valid `bool` value to avoid UB.
383 template <>
384 struct ptrue_impl<bool, void> {
385  static EIGEN_DEVICE_FUNC inline bool run(const bool& /*a*/) { return true; }
386 };
387 
388 // For non-trivial scalars, set to Scalar(1) (i.e. a non-zero value).
389 // Although this is technically not a valid bitmask, the scalar path for pselect
390 // uses a comparison to zero, so this should still work in most cases. We don't
391 // have another option, since the scalar type requires initialization.
392 template <typename T>
393 struct ptrue_impl<T, std::enable_if_t<is_scalar<T>::value && NumTraits<T>::RequireInitialization>> {
394  static EIGEN_DEVICE_FUNC inline T run(const T& /*a*/) { return T(1); }
395 };
396 
398 template <typename Packet>
400  return ptrue_impl<Packet>::run(a);
401 }
402 
403 // In the general case, memset to zero.
404 template <typename Packet, typename EnableIf = void>
405 struct pzero_impl {
406  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& /*a*/) {
407  Packet b;
408  memset(static_cast<void*>(&b), 0x00, sizeof(Packet));
409  return b;
410  }
411 };
412 
413 // For scalars, explicitly set to Scalar(0), since the underlying representation
414 // for zero may not consist of all-zero bits.
415 template <typename T>
416 struct pzero_impl<T, std::enable_if_t<is_scalar<T>::value>> {
417  static EIGEN_DEVICE_FUNC inline T run(const T& /*a*/) { return T(0); }
418 };
419 
421 template <typename Packet>
423  return pzero_impl<Packet>::run(a);
424 }
425 
427 template <typename Packet>
428 EIGEN_DEVICE_FUNC inline Packet pcmp_le(const Packet& a, const Packet& b) {
429  return a <= b ? ptrue(a) : pzero(a);
430 }
431 
433 template <typename Packet>
434 EIGEN_DEVICE_FUNC inline Packet pcmp_lt(const Packet& a, const Packet& b) {
435  return a < b ? ptrue(a) : pzero(a);
436 }
437 
439 template <typename Packet>
440 EIGEN_DEVICE_FUNC inline Packet pcmp_eq(const Packet& a, const Packet& b) {
441  return a == b ? ptrue(a) : pzero(a);
442 }
443 
445 template <typename Packet>
447  return a >= b ? pzero(a) : ptrue(a);
448 }
449 
450 template <typename T>
451 struct bit_and {
452  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a & b; }
453 };
454 
455 template <typename T>
456 struct bit_or {
457  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a | b; }
458 };
459 
460 template <typename T>
461 struct bit_xor {
462  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T& a, const T& b) const { return a ^ b; }
463 };
464 
465 template <typename T>
466 struct bit_not {
468 };
469 
470 template <>
471 struct bit_and<bool> {
472  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const {
473  return a && b;
474  }
475 };
476 
477 template <>
478 struct bit_or<bool> {
479  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const {
480  return a || b;
481  }
482 };
483 
484 template <>
485 struct bit_xor<bool> {
486  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool& a, const bool& b) const {
487  return a != b;
488  }
489 };
490 
491 template <>
492 struct bit_not<bool> {
493  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool& a) const { return !a; }
494 };
495 
496 // Use operators &, |, ^, ~.
497 template <typename T>
499  EIGEN_DEVICE_FUNC static inline T bitwise_and(const T& a, const T& b) { return bit_and<T>()(a, b); }
500  EIGEN_DEVICE_FUNC static inline T bitwise_or(const T& a, const T& b) { return bit_or<T>()(a, b); }
501  EIGEN_DEVICE_FUNC static inline T bitwise_xor(const T& a, const T& b) { return bit_xor<T>()(a, b); }
502  EIGEN_DEVICE_FUNC static inline T bitwise_not(const T& a) { return bit_not<T>()(a); }
503 };
504 
505 // Apply binary operations byte-by-byte
506 template <typename T>
508  EIGEN_DEVICE_FUNC static inline T bitwise_and(const T& a, const T& b) {
509  return binary(a, b, bit_and<unsigned char>());
510  }
511  EIGEN_DEVICE_FUNC static inline T bitwise_or(const T& a, const T& b) { return binary(a, b, bit_or<unsigned char>()); }
512  EIGEN_DEVICE_FUNC static inline T bitwise_xor(const T& a, const T& b) {
513  return binary(a, b, bit_xor<unsigned char>());
514  }
515  EIGEN_DEVICE_FUNC static inline T bitwise_not(const T& a) { return unary(a, bit_not<unsigned char>()); }
516 
517  private:
518  template <typename Op>
519  EIGEN_DEVICE_FUNC static inline T unary(const T& a, Op op) {
520  const unsigned char* a_ptr = reinterpret_cast<const unsigned char*>(&a);
521  T c;
522  unsigned char* c_ptr = reinterpret_cast<unsigned char*>(&c);
523  for (size_t i = 0; i < sizeof(T); ++i) {
524  *c_ptr++ = op(*a_ptr++);
525  }
526  return c;
527  }
528 
529  template <typename Op>
530  EIGEN_DEVICE_FUNC static inline T binary(const T& a, const T& b, Op op) {
531  const unsigned char* a_ptr = reinterpret_cast<const unsigned char*>(&a);
532  const unsigned char* b_ptr = reinterpret_cast<const unsigned char*>(&b);
533  T c;
534  unsigned char* c_ptr = reinterpret_cast<unsigned char*>(&c);
535  for (size_t i = 0; i < sizeof(T); ++i) {
536  *c_ptr++ = op(*a_ptr++, *b_ptr++);
537  }
538  return c;
539  }
540 };
541 
542 // In the general case, use byte-by-byte manipulation.
543 template <typename T, typename EnableIf = void>
545 
546 // For integers or non-trivial scalars, use binary operators.
547 template <typename T>
548 struct bitwise_helper<T, typename std::enable_if_t<is_scalar<T>::value &&
549  (NumTraits<T>::IsInteger || NumTraits<T>::RequireInitialization)>>
550  : public operator_bitwise_helper<T> {};
551 
553 template <typename Packet>
554 EIGEN_DEVICE_FUNC inline Packet pand(const Packet& a, const Packet& b) {
556 }
557 
559 template <typename Packet>
560 EIGEN_DEVICE_FUNC inline Packet por(const Packet& a, const Packet& b) {
562 }
563 
565 template <typename Packet>
566 EIGEN_DEVICE_FUNC inline Packet pxor(const Packet& a, const Packet& b) {
568 }
569 
571 template <typename Packet>
574 }
575 
577 template <typename Packet>
578 EIGEN_DEVICE_FUNC inline Packet pandnot(const Packet& a, const Packet& b) {
579  return pand(a, pnot(b));
580 }
581 
582 // In the general case, use bitwise select.
583 template <typename Packet, typename EnableIf = void>
584 struct pselect_impl {
585  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& mask, const Packet& a, const Packet& b) {
586  return por(pand(a, mask), pandnot(b, mask));
587  }
588 };
589 
590 // For scalars, use ternary select.
591 template <typename Packet>
592 struct pselect_impl<Packet, std::enable_if_t<is_scalar<Packet>::value>> {
593  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& mask, const Packet& a, const Packet& b) {
594  return numext::equal_strict(mask, Packet(0)) ? b : a;
595  }
596 };
597 
599 template <typename Packet>
600 EIGEN_DEVICE_FUNC inline Packet pselect(const Packet& mask, const Packet& a, const Packet& b) {
601  return pselect_impl<Packet>::run(mask, a, b);
602 }
603 
604 template <>
605 EIGEN_DEVICE_FUNC inline bool pselect<bool>(const bool& cond, const bool& a, const bool& b) {
606  return cond ? a : b;
607 }
608 
611 template <int NaNPropagation>
612 struct pminmax_impl {
613  template <typename Packet, typename Op>
614  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& a, const Packet& b, Op op) {
615  return op(a, b);
616  }
617 };
618 
621 template <>
623  template <typename Packet, typename Op>
624  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& a, const Packet& b, Op op) {
625  Packet not_nan_mask_a = pcmp_eq(a, a);
626  Packet not_nan_mask_b = pcmp_eq(b, b);
627  return pselect(not_nan_mask_a, pselect(not_nan_mask_b, op(a, b), b), a);
628  }
629 };
630 
634 template <>
636  template <typename Packet, typename Op>
637  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& a, const Packet& b, Op op) {
638  Packet not_nan_mask_a = pcmp_eq(a, a);
639  Packet not_nan_mask_b = pcmp_eq(b, b);
640  return pselect(not_nan_mask_a, pselect(not_nan_mask_b, op(a, b), a), b);
641  }
642 };
643 
644 #define EIGEN_BINARY_OP_NAN_PROPAGATION(Type, Func) [](const Type& a, const Type& b) { return Func(a, b); }
645 
648 template <typename Packet>
649 EIGEN_DEVICE_FUNC inline Packet pmin(const Packet& a, const Packet& b) {
650  return numext::mini(a, b);
651 }
652 
655 template <int NaNPropagation, typename Packet>
656 EIGEN_DEVICE_FUNC inline Packet pmin(const Packet& a, const Packet& b) {
658 }
659 
662 template <typename Packet>
663 EIGEN_DEVICE_FUNC inline Packet pmax(const Packet& a, const Packet& b) {
664  return numext::maxi(a, b);
665 }
666 
669 template <int NaNPropagation, typename Packet>
670 EIGEN_DEVICE_FUNC inline Packet pmax(const Packet& a, const Packet& b) {
672 }
673 
675 template <typename Packet>
677  return numext::abs(a);
678 }
679 template <>
680 EIGEN_DEVICE_FUNC inline unsigned int pabs(const unsigned int& a) {
681  return a;
682 }
683 template <>
684 EIGEN_DEVICE_FUNC inline unsigned long pabs(const unsigned long& a) {
685  return a;
686 }
687 template <>
688 EIGEN_DEVICE_FUNC inline unsigned long long pabs(const unsigned long long& a) {
689  return a;
690 }
691 
693 template <typename Packet>
694 EIGEN_DEVICE_FUNC inline Packet paddsub(const Packet& a, const Packet& b) {
695  return pselect(peven_mask(a), padd(a, b), psub(a, b));
696 }
697 
699 template <typename Packet>
701  using numext::arg;
702  return arg(a);
703 }
704 
706 template <int N, typename T>
709 }
710 
712 template <int N, typename T>
715 }
716 
718 template <int N, typename T>
720  return numext::logical_shift_left(a, N);
721 }
722 
726 template <typename Packet>
727 EIGEN_DEVICE_FUNC inline Packet pfrexp(const Packet& a, Packet& exponent) {
728  int exp;
729  EIGEN_USING_STD(frexp);
730  Packet result = static_cast<Packet>(frexp(a, &exp));
731  exponent = static_cast<Packet>(exp);
732  return result;
733 }
734 
738 template <typename Packet>
739 EIGEN_DEVICE_FUNC inline Packet pldexp(const Packet& a, const Packet& exponent) {
740  EIGEN_USING_STD(ldexp)
741  return static_cast<Packet>(ldexp(a, static_cast<int>(exponent)));
742 }
743 
745 template <typename Packet>
746 EIGEN_DEVICE_FUNC inline Packet pabsdiff(const Packet& a, const Packet& b) {
747  return pselect(pcmp_lt(a, b), psub(b, a), psub(a, b));
748 }
749 
751 template <typename Packet>
753  return *from;
754 }
755 
760 template <typename Packet>
762  const Index offset = 0) {
763  const Index packet_size = unpacket_traits<Packet>::size;
764  eigen_assert(n + offset <= packet_size && "number of elements plus offset will read past end of packet");
765  typedef typename unpacket_traits<Packet>::type Scalar;
766  EIGEN_ALIGN_MAX Scalar elements[packet_size] = {Scalar(0)};
767  for (Index i = offset; i < numext::mini(n + offset, packet_size); i++) {
768  elements[i] = from[i - offset];
769  }
770  return pload<Packet>(elements);
771 }
772 
774 template <typename Packet>
776  return *from;
777 }
778 
781 template <typename Packet>
783  const Index offset = 0) {
784  const Index packet_size = unpacket_traits<Packet>::size;
785  eigen_assert(n + offset <= packet_size && "number of elements plus offset will read past end of packet");
786  typedef typename unpacket_traits<Packet>::type Scalar;
787  EIGEN_ALIGN_MAX Scalar elements[packet_size] = {Scalar(0)};
788  for (Index i = offset; i < numext::mini(n + offset, packet_size); i++) {
789  elements[i] = from[i - offset];
790  }
791  return pload<Packet>(elements);
792 }
793 
798 template <typename Packet>
799 EIGEN_DEVICE_FUNC inline std::enable_if_t<unpacket_traits<Packet>::masked_load_available, Packet> ploadu(
800  const typename unpacket_traits<Packet>::type* from, typename unpacket_traits<Packet>::mask_t umask);
801 
803 template <typename Packet>
805  return a;
806 }
807 
809 template <typename Packet, typename BitsType>
811 
813 template <typename Packet>
815  return pset1<Packet>(*a);
816 }
817 
823 template <typename Packet>
825  return *from;
826 }
827 
834 template <typename Packet>
836  return pload1<Packet>(from);
837 }
838 
848 template <typename Packet>
850  Packet& a2, Packet& a3) {
851  a0 = pload1<Packet>(a + 0);
852  a1 = pload1<Packet>(a + 1);
853  a2 = pload1<Packet>(a + 2);
854  a3 = pload1<Packet>(a + 3);
855 }
856 
864 template <typename Packet>
866  a0 = pload1<Packet>(a + 0);
867  a1 = pload1<Packet>(a + 1);
868 }
869 
871 template <typename Packet>
873  return a;
874 }
875 
878 template <typename Packet>
880  typedef typename unpacket_traits<Packet>::type Scalar;
881  const size_t n = unpacket_traits<Packet>::size;
882  EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) Scalar elements[n];
883  for (size_t i = 0; i < n; ++i) {
884  memset(elements + i, ((i & 1) == 0 ? 0xff : 0), sizeof(Scalar));
885  }
886  return ploadu<Packet>(elements);
887 }
888 
890 template <typename Scalar, typename Packet>
891 EIGEN_DEVICE_FUNC inline void pstore(Scalar* to, const Packet& from) {
892  (*to) = from;
893 }
894 
898 template <typename Scalar, typename Packet>
899 EIGEN_DEVICE_FUNC inline void pstore_partial(Scalar* to, const Packet& from, const Index n, const Index offset = 0) {
900  const Index packet_size = unpacket_traits<Packet>::size;
901  eigen_assert(n + offset <= packet_size && "number of elements plus offset will write past end of packet");
902  EIGEN_ALIGN_MAX Scalar elements[packet_size];
903  pstore<Scalar>(elements, from);
904  for (Index i = 0; i < numext::mini(n, packet_size - offset); i++) {
905  to[i] = elements[i + offset];
906  }
907 }
908 
910 template <typename Scalar, typename Packet>
911 EIGEN_DEVICE_FUNC inline void pstoreu(Scalar* to, const Packet& from) {
912  (*to) = from;
913 }
914 
916 template <typename Scalar, typename Packet>
917 EIGEN_DEVICE_FUNC inline void pstoreu_partial(Scalar* to, const Packet& from, const Index n, const Index offset = 0) {
918  const Index packet_size = unpacket_traits<Packet>::size;
919  eigen_assert(n + offset <= packet_size && "number of elements plus offset will write past end of packet");
920  EIGEN_ALIGN_MAX Scalar elements[packet_size];
921  pstore<Scalar>(elements, from);
922  for (Index i = 0; i < numext::mini(n, packet_size - offset); i++) {
923  to[i] = elements[i + offset];
924  }
925 }
926 
931 template <typename Scalar, typename Packet>
932 EIGEN_DEVICE_FUNC inline std::enable_if_t<unpacket_traits<Packet>::masked_store_available, void> pstoreu(
933  Scalar* to, const Packet& from, typename unpacket_traits<Packet>::mask_t umask);
934 
935 template <typename Scalar, typename Packet>
936 EIGEN_DEVICE_FUNC inline Packet pgather(const Scalar* from, Index /*stride*/) {
937  return ploadu<Packet>(from);
938 }
939 
940 template <typename Scalar, typename Packet>
941 EIGEN_DEVICE_FUNC inline Packet pgather_partial(const Scalar* from, Index stride, const Index n) {
942  const Index packet_size = unpacket_traits<Packet>::size;
943  EIGEN_ALIGN_MAX Scalar elements[packet_size] = {Scalar(0)};
944  for (Index i = 0; i < numext::mini(n, packet_size); i++) {
945  elements[i] = from[i * stride];
946  }
947  return pload<Packet>(elements);
948 }
949 
950 template <typename Scalar, typename Packet>
951 EIGEN_DEVICE_FUNC inline void pscatter(Scalar* to, const Packet& from, Index /*stride*/) {
952  pstore(to, from);
953 }
954 
955 template <typename Scalar, typename Packet>
956 EIGEN_DEVICE_FUNC inline void pscatter_partial(Scalar* to, const Packet& from, Index stride, const Index n) {
957  const Index packet_size = unpacket_traits<Packet>::size;
958  EIGEN_ALIGN_MAX Scalar elements[packet_size];
959  pstore<Scalar>(elements, from);
960  for (Index i = 0; i < numext::mini(n, packet_size); i++) {
961  to[i * stride] = elements[i];
962  }
963 }
964 
966 template <typename Scalar>
967 EIGEN_DEVICE_FUNC inline void prefetch(const Scalar* addr) {
968 #if defined(EIGEN_HIP_DEVICE_COMPILE)
969  // do nothing
970 #elif defined(EIGEN_CUDA_ARCH)
971 #if defined(__LP64__) || EIGEN_OS_WIN64
972  // 64-bit pointer operand constraint for inlined asm
973  asm(" prefetch.L1 [ %1 ];" : "=l"(addr) : "l"(addr));
974 #else
975  // 32-bit pointer operand constraint for inlined asm
976  asm(" prefetch.L1 [ %1 ];" : "=r"(addr) : "r"(addr));
977 #endif
978 #elif (!EIGEN_COMP_MSVC) && (EIGEN_COMP_GNUC || EIGEN_COMP_CLANG || EIGEN_COMP_ICC)
979  __builtin_prefetch(addr);
980 #endif
981 }
982 
984 template <typename Packet>
986  return a;
987 }
988 
990 template <typename Packet>
992  return Packet(numext::imag(a), numext::real(a));
993 }
994 
995 /**************************
996  * Special math functions
997  ***************************/
998 
1000 template <typename Packet>
1002  return pandnot(ptrue(a), pcmp_eq(a, a));
1003 }
1004 
1006 template <typename Packet>
1008  using Scalar = typename unpacket_traits<Packet>::type;
1009  constexpr Scalar inf = NumTraits<Scalar>::infinity();
1010  return pcmp_eq(pabs(a), pset1<Packet>(inf));
1011 }
1012 
1014 template <typename Packet>
1017  return sin(a);
1018 }
1019 
1021 template <typename Packet>
1024  return cos(a);
1025 }
1026 
1028 template <typename Packet>
1031  return tan(a);
1032 }
1033 
1035 template <typename Packet>
1038  return asin(a);
1039 }
1040 
1042 template <typename Packet>
1045  return acos(a);
1046 }
1047 
1049 template <typename Packet>
1052  return sinh(a);
1053 }
1054 
1056 template <typename Packet>
1059  return cosh(a);
1060 }
1061 
1063 template <typename Packet>
1066  return atan(a);
1067 }
1068 
1070 template <typename Packet>
1073  return tanh(a);
1074 }
1075 
1077 template <typename Packet>
1080  return atanh(a);
1081 }
1082 
1084 template <typename Packet>
1086  return numext::exp(a);
1087 }
1088 
1090 template <typename Packet>
1092  return numext::exp2(a);
1093 }
1094 
1096 template <typename Packet>
1098  return numext::expm1(a);
1099 }
1100 
1102 template <typename Packet>
1105  return log(a);
1106 }
1107 
1109 template <typename Packet>
1111  return numext::log1p(a);
1112 }
1113 
1115 template <typename Packet>
1118  return log10(a);
1119 }
1120 
1122 template <typename Packet>
1125  using RealScalar = typename NumTraits<Scalar>::Real;
1126  return pmul(pset1<Packet>(Scalar(RealScalar(EIGEN_LOG2E))), plog(a));
1127 }
1128 
1130 template <typename Packet>
1132  return numext::sqrt(a);
1133 }
1134 
1136 template <typename Packet>
1138  return numext::cbrt(a);
1139 }
1140 
1142  bool IsInteger = NumTraits<typename unpacket_traits<Packet>::type>::IsInteger>
1149 };
1150 
1152 template <typename Packet>
1155 }
1156 
1158 template <typename Packet>
1161 }
1162 
1165 template <typename Packet>
1168 }
1169 
1171 template <typename Packet>
1174 }
1175 
1177 template <typename Packet>
1180 }
1181 
1182 template <typename Packet, typename EnableIf = void>
1183 struct psign_impl {
1184  static EIGEN_DEVICE_FUNC inline Packet run(const Packet& a) { return numext::sign(a); }
1185 };
1186 
1188 template <typename Packet>
1190  return psign_impl<Packet>::run(a);
1191 }
1192 
1193 template <>
1194 EIGEN_DEVICE_FUNC inline bool psign(const bool& a) {
1195  return a;
1196 }
1197 
1199 template <typename Packet>
1201  return a;
1202 }
1203 
1208 template <typename Packet>
1209 EIGEN_DEVICE_FUNC inline std::conditional_t<(unpacket_traits<Packet>::size % 8) == 0,
1212  return a;
1213 }
1214 
1215 // Slow generic implementation of Packet reduction.
1216 template <typename Packet, typename Op>
1218  typedef typename unpacket_traits<Packet>::type Scalar;
1219  const size_t n = unpacket_traits<Packet>::size;
1220  EIGEN_ALIGN_TO_BOUNDARY(sizeof(Packet)) Scalar elements[n];
1221  pstoreu<Scalar>(elements, a);
1222  for (size_t k = n / 2; k > 0; k /= 2) {
1223  for (size_t i = 0; i < k; ++i) {
1224  elements[i] = op(elements[i], elements[i + k]);
1225  }
1226  }
1227  return elements[0];
1228 }
1229 
1231 template <typename Packet>
1233  return a;
1234 }
1235 
1237 template <typename Packet>
1239  typedef typename unpacket_traits<Packet>::type Scalar;
1240  return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmul<Scalar>)));
1241 }
1242 
1244 template <typename Packet>
1246  typedef typename unpacket_traits<Packet>::type Scalar;
1247  return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmin<PropagateFast, Scalar>)));
1248 }
1249 
1250 template <int NaNPropagation, typename Packet>
1252  typedef typename unpacket_traits<Packet>::type Scalar;
1253  return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmin<NaNPropagation, Scalar>)));
1254 }
1255 
1257 template <typename Packet>
1259  typedef typename unpacket_traits<Packet>::type Scalar;
1260  return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmax<PropagateFast, Scalar>)));
1261 }
1262 
1263 template <int NaNPropagation, typename Packet>
1265  typedef typename unpacket_traits<Packet>::type Scalar;
1266  return predux_helper(a, EIGEN_BINARY_OP_NAN_PROPAGATION(Scalar, (pmax<NaNPropagation, Scalar>)));
1267 }
1268 
1269 #undef EIGEN_BINARY_OP_NAN_PROPAGATION
1270 
1274 // not needed yet
1275 // template<typename Packet> EIGEN_DEVICE_FUNC inline bool predux_all(const Packet& a)
1276 // { return bool(a); }
1277 
1281 template <typename Packet>
1282 EIGEN_DEVICE_FUNC inline bool predux_any(const Packet& a) {
1283  // Dirty but generic implementation where "true" is assumed to be non 0 and all the sames.
1284  // It is expected that "true" is either:
1285  // - Scalar(1)
1286  // - bits full of ones (NaN for floats),
1287  // - or first bit equals to 1 (1 for ints, smallest denormal for floats).
1288  // For all these cases, taking the sum is just fine, and this boils down to a no-op for scalars.
1289  typedef typename unpacket_traits<Packet>::type Scalar;
1290  return numext::not_equal_strict(predux(a), Scalar(0));
1291 }
1292 
1293 /***************************************************************************
1294  * The following functions might not have to be overwritten for vectorized types
1295  ***************************************************************************/
1296 
1297 // FMA instructions.
1299 template <typename Packet>
1300 EIGEN_DEVICE_FUNC inline Packet pmadd(const Packet& a, const Packet& b, const Packet& c) {
1301  return padd(pmul(a, b), c);
1302 }
1303 
1305 template <typename Packet>
1306 EIGEN_DEVICE_FUNC inline Packet pmsub(const Packet& a, const Packet& b, const Packet& c) {
1307  return psub(pmul(a, b), c);
1308 }
1309 
1311 template <typename Packet>
1312 EIGEN_DEVICE_FUNC inline Packet pnmadd(const Packet& a, const Packet& b, const Packet& c) {
1313  return psub(c, pmul(a, b));
1314 }
1315 
1317 template <typename Packet>
1318 EIGEN_DEVICE_FUNC inline Packet pnmsub(const Packet& a, const Packet& b, const Packet& c) {
1319  return pnegate(pmadd(a, b, c));
1320 }
1321 
1324 // NOTE: this function must really be templated on the packet type (think about different packet types for the same
1325 // scalar type)
1326 template <typename Packet>
1327 inline void pstore1(typename unpacket_traits<Packet>::type* to, const typename unpacket_traits<Packet>::type& a) {
1328  pstore(to, pset1<Packet>(a));
1329 }
1330 
1333 template <typename Packet, int Alignment>
1335  if (Alignment >= unpacket_traits<Packet>::alignment)
1336  return pload<Packet>(from);
1337  else
1338  return ploadu<Packet>(from);
1339 }
1340 
1343 template <typename Packet, int Alignment>
1345  const Index n, const Index offset = 0) {
1346  if (Alignment >= unpacket_traits<Packet>::alignment)
1347  return pload_partial<Packet>(from, n, offset);
1348  else
1349  return ploadu_partial<Packet>(from, n, offset);
1350 }
1351 
1354 template <typename Scalar, typename Packet, int Alignment>
1356  if (Alignment >= unpacket_traits<Packet>::alignment)
1357  pstore(to, from);
1358  else
1359  pstoreu(to, from);
1360 }
1361 
1364 template <typename Scalar, typename Packet, int Alignment>
1366  const Index offset = 0) {
1367  if (Alignment >= unpacket_traits<Packet>::alignment)
1368  pstore_partial(to, from, n, offset);
1369  else
1370  pstoreu_partial(to, from, n, offset);
1371 }
1372 
1378 template <typename Packet, int LoadMode>
1380  return ploadt<Packet, LoadMode>(from);
1381 }
1382 
1383 /***************************************************************************
1384  * Fast complex products (GCC generates a function call which is very slow)
1385  ***************************************************************************/
1386 
1387 // Eigen+CUDA does not support complexes.
1388 #if !defined(EIGEN_GPUCC)
1389 
1390 template <>
1391 inline std::complex<float> pmul(const std::complex<float>& a, const std::complex<float>& b) {
1392  return std::complex<float>(a.real() * b.real() - a.imag() * b.imag(), a.imag() * b.real() + a.real() * b.imag());
1393 }
1394 
1395 template <>
1396 inline std::complex<double> pmul(const std::complex<double>& a, const std::complex<double>& b) {
1397  return std::complex<double>(a.real() * b.real() - a.imag() * b.imag(), a.imag() * b.real() + a.real() * b.imag());
1398 }
1399 
1400 #endif
1401 
1402 /***************************************************************************
1403  * PacketBlock, that is a collection of N packets where the number of words
1404  * in the packet is a multiple of N.
1405  ***************************************************************************/
1407 struct PacketBlock {
1409 };
1410 
1411 template <typename Packet>
1413  // Nothing to do in the scalar case, i.e. a 1x1 matrix.
1414 }
1415 
1416 /***************************************************************************
1417  * Selector, i.e. vector of N boolean values used to select (i.e. blend)
1418  * words from 2 packets.
1419  ***************************************************************************/
1420 template <size_t N>
1421 struct Selector {
1422  bool select[N];
1423 };
1424 
1425 template <typename Packet>
1427  const Packet& thenPacket, const Packet& elsePacket) {
1428  return ifPacket.select[0] ? thenPacket : elsePacket;
1429 }
1430 
1432 template <typename Packet>
1434  using Scalar = typename unpacket_traits<Packet>::type;
1435  return pdiv(pset1<Packet>(Scalar(1)), a);
1436 }
1437 
1439 template <typename Packet>
1441  return preciprocal<Packet>(psqrt(a));
1442 }
1443 
1445  bool IsInteger = NumTraits<typename unpacket_traits<Packet>::type>::IsInteger>
1447 template <typename Packet, bool IsInteger>
1448 struct psignbit_impl<Packet, true, IsInteger> {
1450 };
1451 template <typename Packet>
1452 struct psignbit_impl<Packet, false, false> {
1453  // generic implementation if not specialized in PacketMath.h
1454  // slower than arithmetic shift
1457  const Packet cst_pos_one = pset1<Packet>(Scalar(1));
1458  const Packet cst_neg_one = pset1<Packet>(Scalar(-1));
1459  return pcmp_eq(por(pand(a, cst_neg_one), cst_pos_one), cst_neg_one);
1460  }
1461 };
1462 template <typename Packet>
1463 struct psignbit_impl<Packet, false, true> {
1464  // generic implementation for integer packets
1465  EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static constexpr Packet run(const Packet& a) { return pcmp_lt(a, pzero(a)); }
1466 };
1468 template <typename Packet>
1470  return psignbit_impl<Packet>::run(a);
1471 }
1472 
1476  return numext::atan2(y, x);
1477 }
1478 
1483 
1484  // See https://en.cppreference.com/w/cpp/numeric/math/atan2
1485  // for how corner cases are supposed to be handled according to the
1486  // IEEE floating-point standard (IEC 60559).
1487  const Packet kSignMask = pset1<Packet>(-Scalar(0));
1488  const Packet kZero = pzero(x);
1489  const Packet kOne = pset1<Packet>(Scalar(1));
1490  const Packet kPi = pset1<Packet>(Scalar(EIGEN_PI));
1491 
1492  const Packet x_has_signbit = psignbit(x);
1493  const Packet y_signmask = pand(y, kSignMask);
1494  const Packet x_signmask = pand(x, kSignMask);
1495  const Packet result_signmask = pxor(y_signmask, x_signmask);
1496  const Packet shift = por(pand(x_has_signbit, kPi), y_signmask);
1497 
1498  const Packet x_and_y_are_same = pcmp_eq(pabs(x), pabs(y));
1499  const Packet x_and_y_are_zero = pcmp_eq(por(x, y), kZero);
1500 
1501  Packet arg = pdiv(y, x);
1502  arg = pselect(x_and_y_are_same, por(kOne, result_signmask), arg);
1503  arg = pselect(x_and_y_are_zero, result_signmask, arg);
1504 
1505  Packet result = patan(arg);
1506  result = padd(result, shift);
1507  return result;
1508 }
1509 
1513  return Packet(numext::arg(a));
1514 }
1515 
1520  THIS METHOD IS FOR COMPLEX TYPES ONLY)
1521  using RealPacket = typename unpacket_traits<Packet>::as_real;
1522  // a // r i r i ...
1523  RealPacket aflip = pcplxflip(a).v; // i r i r ...
1524  RealPacket result = patan2(aflip, a.v); // atan2 crap atan2 crap ...
1525  return (Packet)pand(result, peven_mask(result)); // atan2 0 atan2 0 ...
1526 }
1527 
1528 } // end namespace internal
1529 
1530 } // end namespace Eigen
1531 
1532 #endif // EIGEN_GENERIC_PACKET_MATH_H
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar acos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:138
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
AnnoyingScalar conj(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:133
AnnoyingScalar imag(const AnnoyingScalar &)
Definition: AnnoyingScalar.h:132
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
#define EIGEN_ALIGN_MAX
Definition: ConfigureVectorization.h:146
#define EIGEN_ALIGN_TO_BOUNDARY(n)
Definition: ConfigureVectorization.h:37
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Eigen::Triplet< double > T
Definition: EigenUnitTest.cpp:11
#define EIGEN_BINARY_OP_NAN_PROPAGATION(Type, Func)
Definition: GenericPacketMath.h:644
#define EIGEN_ALWAYS_INLINE
Definition: Macros.h:845
#define EIGEN_USING_STD(FUNC)
Definition: Macros.h:1090
#define EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
Definition: Macros.h:899
#define EIGEN_CONSTEXPR
Definition: Macros.h:758
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
#define EIGEN_LOG2E
Definition: MathFunctions.h:17
#define EIGEN_PI
Definition: MathFunctions.h:16
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
Scalar * b
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
internal::packet_traits< Scalar >::type Packet
Definition: benchmark-blocking-sizes.cpp:54
@ IsComplex
Definition: common.h:73
@ N
Definition: constructor.cpp:22
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
float real
Definition: datatypes.h:10
@ PropagateNaN
Definition: Constants.h:342
@ PropagateNumbers
Definition: Constants.h:344
const Scalar * a
Definition: level2_cplx_impl.h:32
char char char int int * k
Definition: level2_impl.h:374
char char * op
Definition: level2_impl.h:374
@ Target
Definition: Constants.h:495
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 tanh(const bfloat16 &a)
Definition: BFloat16.h:639
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 cosh(const bfloat16 &a)
Definition: BFloat16.h:638
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 atanh(const bfloat16 &a)
Definition: BFloat16.h:642
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 asin(const bfloat16 &a)
Definition: BFloat16.h:634
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 log10(const bfloat16 &a)
Definition: BFloat16.h:620
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 atan(const bfloat16 &a)
Definition: BFloat16.h:636
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 exp(const bfloat16 &a)
Definition: BFloat16.h:615
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 expm1(const bfloat16 &a)
Definition: BFloat16.h:617
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 log(const bfloat16 &a)
Definition: BFloat16.h:618
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 sinh(const bfloat16 &a)
Definition: BFloat16.h:637
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 tan(const bfloat16 &a)
Definition: BFloat16.h:633
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 log1p(const bfloat16 &a)
Definition: BFloat16.h:619
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexpm1(const Packet &a)
Definition: GenericPacketMath.h:1097
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
Definition: AltiVec/Complex.h:268
EIGEN_DEVICE_FUNC TgtPacket pcast(const SrcPacket &a)
Definition: GenericPacketMath.h:287
EIGEN_DEVICE_FUNC void pstore_partial(Scalar *to, const Packet &from, const Index n, const Index offset=0)
Definition: GenericPacketMath.h:899
EIGEN_DEVICE_FUNC Packet padd(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:318
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog10(const Packet &a)
Definition: GenericPacketMath.h:1116
EIGEN_STRONG_INLINE Packet8f pzero(const Packet8f &)
Definition: AVX/PacketMath.h:774
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet ptrunc(const Packet &a)
Definition: GenericPacketMath.h:1178
EIGEN_STRONG_INLINE Packet8f pisnan(const Packet8f &a)
Definition: AVX/PacketMath.h:1034
EIGEN_DEVICE_FUNC Packet parg(const Packet &a)
Definition: GenericPacketMath.h:700
constexpr int plain_enum_max(A a, B b)
Definition: Meta.h:656
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet print(const Packet &a)
Definition: GenericPacketMath.h:1166
EIGEN_STRONG_INLINE Packet16h ploadquad(const Eigen::half *from)
Definition: AVX512/PacketMath.h:2250
EIGEN_DEVICE_FUNC Packet pload_partial(const typename unpacket_traits< Packet >::type *from, const Index n, const Index offset=0)
Definition: GenericPacketMath.h:761
EIGEN_DEVICE_FUNC void pbroadcast4(const typename unpacket_traits< Packet >::type *a, Packet &a0, Packet &a1, Packet &a2, Packet &a3)
Definition: GenericPacketMath.h:849
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
Definition: AltiVec/Complex.h:339
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog2(const Packet &a)
Definition: GenericPacketMath.h:1123
const Scalar & y
Definition: RandomImpl.h:36
EIGEN_DEVICE_FUNC Packet pset1frombits(BitsType a)
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog(const Packet &a)
Definition: GenericPacketMath.h:1103
EIGEN_STRONG_INLINE bool predux_any(const Packet4f &x)
Definition: AltiVec/PacketMath.h:2751
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcbrt(const Packet &a)
Definition: GenericPacketMath.h:1137
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_helper(const Packet &a, Op op)
Definition: GenericPacketMath.h:1217
EIGEN_DEVICE_FUNC Packet pgather_partial(const Scalar *from, Index stride, const Index n)
Definition: GenericPacketMath.h:941
EIGEN_DEVICE_FUNC Packet pdiv(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:368
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_max(const Packet &a)
Definition: GenericPacketMath.h:1258
EIGEN_STRONG_INLINE Packet4i plogical_shift_left(const Packet4i &a)
Definition: AltiVec/PacketMath.h:1983
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcos(const Packet &a)
Definition: GenericPacketMath.h:1022
EIGEN_DEVICE_FUNC void prefetch(const Scalar *addr)
Definition: GenericPacketMath.h:967
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet patan2(const Packet &y, const Packet &x)
Definition: GenericPacketMath.h:1475
EIGEN_DEVICE_FUNC Packet ploadu(const typename unpacket_traits< Packet >::type *from)
Definition: GenericPacketMath.h:775
EIGEN_DEVICE_FUNC Packet pmax(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:663
EIGEN_STRONG_INLINE Packet4i pblend(const Selector< 4 > &ifPacket, const Packet4i &thenPacket, const Packet4i &elsePacket)
Definition: AltiVec/PacketMath.h:3075
EIGEN_DEVICE_FUNC Packet pnot(const Packet &a)
Definition: GenericPacketMath.h:572
EIGEN_STRONG_INLINE Packet4f pcmp_le(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1314
EIGEN_STRONG_INLINE Packet4i plogical_shift_right(const Packet4i &a)
Definition: AltiVec/PacketMath.h:1979
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet pcarg(const Packet &a)
Definition: GenericPacketMath.h:1512
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psin(const Packet &a)
Definition: GenericPacketMath.h:1015
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pacos(const Packet &a)
Definition: GenericPacketMath.h:1043
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_min(const Packet &a)
Definition: GenericPacketMath.h:1245
EIGEN_DEVICE_FUNC Target preinterpret(const Packet &a)
Definition: GenericPacketMath.h:257
EIGEN_DEVICE_FUNC bool pselect< bool >(const bool &cond, const bool &a, const bool &b)
Definition: GenericPacketMath.h:605
EIGEN_STRONG_INLINE Packet8h por(const Packet8h &a, const Packet8h &b)
Definition: AVX/PacketMath.h:2309
EIGEN_STRONG_INLINE Packet4i pcmp_lt(const Packet4i &a, const Packet4i &b)
Definition: AltiVec/PacketMath.h:1341
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
Definition: AltiVec/Complex.h:303
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet ptan(const Packet &a)
Definition: GenericPacketMath.h:1029
EIGEN_STRONG_INLINE Packet4f pmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition: AltiVec/PacketMath.h:1218
EIGEN_STRONG_INLINE Packet2cf pcplxflip(const Packet2cf &x)
Definition: LSX/Complex.h:218
EIGEN_STRONG_INLINE Packet4cf pmul(const Packet4cf &a, const Packet4cf &b)
Definition: AVX/Complex.h:88
EIGEN_DEVICE_FUNC Packet preciprocal(const Packet &a)
Definition: GenericPacketMath.h:1433
EIGEN_STRONG_INLINE Packet8h ptrue(const Packet8h &a)
Definition: AVX/PacketMath.h:2263
EIGEN_DEVICE_FUNC Packet pgather(const Packet &src, const Scalar *from, Index stride, typename unpacket_traits< Packet >::mask_t umask)
EIGEN_DEVICE_FUNC Packet pmin(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:649
EIGEN_STRONG_INLINE Packet8h pandnot(const Packet8h &a, const Packet8h &b)
Definition: AVX/PacketMath.h:2323
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pcosh(const Packet &a)
Definition: GenericPacketMath.h:1057
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
Definition: AltiVec/Complex.h:264
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet ptanh(const Packet &a)
Definition: GenericPacketMath.h:1071
EIGEN_STRONG_INLINE Packet4i parithmetic_shift_right(const Packet4i &a)
Definition: AltiVec/PacketMath.h:1975
EIGEN_DEVICE_FUNC Packet pisinf(const Packet &a)
Definition: GenericPacketMath.h:1007
EIGEN_DEVICE_FUNC Packet paddsub(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:694
EIGEN_DEVICE_FUNC void pstoreu_partial(Scalar *to, const Packet &from, const Index n, const Index offset=0)
Definition: GenericPacketMath.h:917
EIGEN_STRONG_INLINE Packet4f pceil(const Packet4f &a)
Definition: LSX/PacketMath.h:2546
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pstoret(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:1355
EIGEN_STRONG_INLINE Packet8bf psignbit(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:1966
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexp2(const Packet &a)
Definition: GenericPacketMath.h:1091
EIGEN_DEVICE_FUNC Packet pabsdiff(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:746
EIGEN_STRONG_INLINE Packet4f pabs(const Packet4f &a)
Definition: AltiVec/PacketMath.h:1936
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog1p(const Packet &a)
Definition: GenericPacketMath.h:1110
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet ploaddup(const typename unpacket_traits< Packet >::type *from)
Definition: GenericPacketMath.h:824
EIGEN_STRONG_INLINE Packet8f peven_mask(const Packet8f &)
Definition: AVX/PacketMath.h:791
EIGEN_STRONG_INLINE bfloat16 pfirst(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2418
EIGEN_DEVICE_FUNC void pscatter(Scalar *to, const Packet &from, Index stride, typename unpacket_traits< Packet >::mask_t umask)
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:891
EIGEN_STRONG_INLINE Packet4f pnmsub(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition: LSX/PacketMath.h:835
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux(const Packet &a)
Definition: GenericPacketMath.h:1232
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet4c predux_half_dowto4(const Packet8c &a)
Definition: NEON/PacketMath.h:3635
EIGEN_STRONG_INLINE Packet4f psqrt(const Packet4f &a)
Definition: LSX/PacketMath.h:2176
EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:353
EIGEN_STRONG_INLINE Packet8h pldexp(const Packet8h &a, const Packet8h &exponent)
Definition: arch/AVX/MathFunctions.h:80
EIGEN_STRONG_INLINE Packet4f pmsub(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition: LSX/PacketMath.h:819
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:911
EIGEN_STRONG_INLINE Packet8h pand(const Packet8h &a, const Packet8h &b)
Definition: AVX/PacketMath.h:2319
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet ploadt(const typename unpacket_traits< Packet >::type *from)
Definition: GenericPacketMath.h:1334
EIGEN_STRONG_INLINE Packet8h pxor(const Packet8h &a, const Packet8h &b)
Definition: AVX/PacketMath.h:2315
EIGEN_DEVICE_FUNC void pbroadcast2(const typename unpacket_traits< Packet >::type *a, Packet &a0, Packet &a1)
Definition: GenericPacketMath.h:865
EIGEN_STRONG_INLINE Packet4f pnmadd(const Packet4f &a, const Packet4f &b, const Packet4f &c)
Definition: LSX/PacketMath.h:827
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet psinh(const Packet &a)
Definition: GenericPacketMath.h:1050
EIGEN_STRONG_INLINE Packet4f pselect(const Packet4f &mask, const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1474
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pasin(const Packet &a)
Definition: GenericPacketMath.h:1036
EIGEN_DEVICE_FUNC Packet psub(const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:337
EIGEN_DEVICE_FUNC void pscatter_partial(Scalar *to, const Packet &from, Index stride, const Index n)
Definition: GenericPacketMath.h:956
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet plset(const typename unpacket_traits< Packet >::type &a)
Returns a packet with coefficients (a,a+1,...,a+packet_size-1).
Definition: GenericPacketMath.h:872
EIGEN_STRONG_INLINE Packet4f pround(const Packet4f &a)
Definition: LSX/PacketMath.h:2555
EIGEN_STRONG_INLINE Packet8h pfrexp(const Packet8h &a, Packet8h &exponent)
Definition: arch/AVX/MathFunctions.h:72
EIGEN_STRONG_INLINE Packet4f pfloor(const Packet4f &a)
Definition: LSX/PacketMath.h:2537
EIGEN_DEVICE_FUNC Packet pload1(const typename unpacket_traits< Packet >::type *a)
Definition: GenericPacketMath.h:814
void pstore1(typename unpacket_traits< Packet >::type *to, const typename unpacket_traits< Packet >::type &a)
Definition: GenericPacketMath.h:1327
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet ploadt_ro(const typename unpacket_traits< Packet >::type *from)
Definition: GenericPacketMath.h:1379
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Packet ploadt_partial(const typename unpacket_traits< Packet >::type *from, const Index n, const Index offset=0)
Definition: GenericPacketMath.h:1344
EIGEN_DEVICE_FUNC Packet pload(const typename unpacket_traits< Packet >::type *from)
Definition: GenericPacketMath.h:752
EIGEN_STRONG_INLINE Packet4f prsqrt(const Packet4f &a)
Definition: LSX/PacketMath.h:2528
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet patanh(const Packet &a)
Definition: GenericPacketMath.h:1078
EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet patan(const Packet &a)
Definition: GenericPacketMath.h:1064
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void pstoret_partial(Scalar *to, const Packet &from, const Index n, const Index offset=0)
Definition: GenericPacketMath.h:1365
EIGEN_STRONG_INLINE Packet4f pcmp_lt_or_nan(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1329
EIGEN_DEVICE_FUNC Packet psign(const Packet &a)
Definition: GenericPacketMath.h:1189
EIGEN_STRONG_INLINE Packet4f pexp(const Packet4f &_x)
Definition: LSX/PacketMath.h:2663
EIGEN_DEVICE_FUNC Packet pset1(const typename unpacket_traits< Packet >::type &a)
Definition: GenericPacketMath.h:804
EIGEN_DEVICE_FUNC unpacket_traits< Packet >::type predux_mul(const Packet &a)
Definition: GenericPacketMath.h:1238
EIGEN_DEVICE_FUNC Packet ploadu_partial(const typename unpacket_traits< Packet >::type *from, const Index n, const Index offset=0)
Definition: GenericPacketMath.h:782
std::int32_t int32_t
Definition: Meta.h:41
std::int8_t int8_t
Definition: Meta.h:37
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar round(const Scalar &x)
Definition: MathFunctions.h:1195
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar() trunc(const Scalar &x)
Definition: MathFunctions.h:1210
std::uint8_t uint8_t
Definition: Meta.h:36
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool equal_strict(const X &x, const Y &y)
Definition: Meta.h:571
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)
Definition: MathFunctions.h:926
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE std::enable_if_t< NumTraits< T >::IsSigned||NumTraits< T >::IsComplex, typename NumTraits< T >::Real > abs(const T &x)
Definition: MathFunctions.h:1355
std::int16_t int16_t
Definition: Meta.h:39
std::int64_t int64_t
Definition: Meta.h:43
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool not_equal_strict(const X &x, const Y &y)
Definition: Meta.h:606
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar logical_shift_left(const Scalar &a, int n)
Definition: MathFunctions.h:1827
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar rint(const Scalar &x)
Definition: MathFunctions.h:1190
std::uint16_t uint16_t
Definition: Meta.h:38
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T cbrt(const T &x)
Definition: MathFunctions.h:1320
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T exp(const T &x)
Definition: MathFunctions.h:1424
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar() floor(const Scalar &x)
Definition: MathFunctions.h:1200
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar arithmetic_shift_right(const Scalar &a, int n)
Definition: MathFunctions.h:1838
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE float sqrt(const float &x)
Definition: arch/SSE/MathFunctions.h:69
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar() ceil(const Scalar &x)
Definition: MathFunctions.h:1205
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition: MathFunctions.h:920
std::uint32_t uint32_t
Definition: Meta.h:40
std::uint64_t uint64_t
Definition: Meta.h:42
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar logical_shift_right(const Scalar &a, int n)
Definition: MathFunctions.h:1832
EIGEN_DEVICE_FUNC static constexpr EIGEN_ALWAYS_INLINE Scalar signbit(const Scalar &x)
Definition: MathFunctions.h:1419
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T exp2(const T &x)
Definition: MathFunctions.h:1481
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T atan2(const T &y, const T &x)
Definition: MathFunctions.h:1689
T negate(const T &x)
Definition: packetmath_test_shared.h:26
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
squared absolute value
Definition: GlobalFunctions.h:87
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
T sign(T x)
Definition: cxx11_tensor_builtins_sycl.cpp:172
int c
Definition: calibrate.py:100
const Mdouble inf
Definition: GeneralDefine.h:23
Definition: Eigen_Colamd.h:49
list x
Definition: plotDoE.py:28
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
Packet4f v
Definition: AltiVec/Complex.h:78
Definition: GenericPacketMath.h:1407
Packet packet[N]
Definition: GenericPacketMath.h:1408
Definition: GenericPacketMath.h:1421
bool select[N]
Definition: GenericPacketMath.h:1422
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool &a, const bool &b) const
Definition: GenericPacketMath.h:472
Definition: GenericPacketMath.h:451
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T &a, const T &b) const
Definition: GenericPacketMath.h:452
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool &a) const
Definition: GenericPacketMath.h:493
Definition: GenericPacketMath.h:466
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T &a) const
Definition: GenericPacketMath.h:467
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool &a, const bool &b) const
Definition: GenericPacketMath.h:479
Definition: GenericPacketMath.h:456
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T &a, const T &b) const
Definition: GenericPacketMath.h:457
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE bool operator()(const bool &a, const bool &b) const
Definition: GenericPacketMath.h:486
Definition: GenericPacketMath.h:461
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_ALWAYS_INLINE T operator()(const T &a, const T &b) const
Definition: GenericPacketMath.h:462
Definition: GenericPacketMath.h:544
Definition: GenericPacketMath.h:507
static EIGEN_DEVICE_FUNC T bitwise_xor(const T &a, const T &b)
Definition: GenericPacketMath.h:512
static EIGEN_DEVICE_FUNC T bitwise_not(const T &a)
Definition: GenericPacketMath.h:515
static EIGEN_DEVICE_FUNC T unary(const T &a, Op op)
Definition: GenericPacketMath.h:519
static EIGEN_DEVICE_FUNC T bitwise_and(const T &a, const T &b)
Definition: GenericPacketMath.h:508
static EIGEN_DEVICE_FUNC T binary(const T &a, const T &b, Op op)
Definition: GenericPacketMath.h:530
static EIGEN_DEVICE_FUNC T bitwise_or(const T &a, const T &b)
Definition: GenericPacketMath.h:511
static EIGEN_DEVICE_FUNC NewType run(const OldType &x)
Definition: MathFunctions.h:340
Definition: GenericPacketMath.h:45
@ HasSign
Definition: GenericPacketMath.h:59
@ HasZeta
Definition: GenericPacketMath.h:93
@ HasASin
Definition: GenericPacketMath.h:84
@ HasIGamma
Definition: GenericPacketMath.h:99
@ HasATanh
Definition: GenericPacketMath.h:87
@ HasSub
Definition: GenericPacketMath.h:49
@ HasRsqrt
Definition: GenericPacketMath.h:74
@ HasSin
Definition: GenericPacketMath.h:81
@ HasBlend
Definition: GenericPacketMath.h:66
@ HasLog10
Definition: GenericPacketMath.h:79
@ HasTan
Definition: GenericPacketMath.h:83
@ HasErfc
Definition: GenericPacketMath.h:96
@ HasACos
Definition: GenericPacketMath.h:85
@ HasAbsDiff
Definition: GenericPacketMath.h:65
@ HasMin
Definition: GenericPacketMath.h:55
@ HasArg
Definition: GenericPacketMath.h:64
@ HasNdtri
Definition: GenericPacketMath.h:97
@ HasCos
Definition: GenericPacketMath.h:82
@ HasSinh
Definition: GenericPacketMath.h:88
@ HasPolygamma
Definition: GenericPacketMath.h:94
@ HasCmp
Definition: GenericPacketMath.h:69
@ HasDiGamma
Definition: GenericPacketMath.h:92
@ HasConj
Definition: GenericPacketMath.h:57
@ HasSetLinear
Definition: GenericPacketMath.h:58
@ HasReciprocal
Definition: GenericPacketMath.h:72
@ HasShift
Definition: GenericPacketMath.h:50
@ HasLog1p
Definition: GenericPacketMath.h:78
@ HasMax
Definition: GenericPacketMath.h:56
@ HasPow
Definition: GenericPacketMath.h:80
@ HasIGammac
Definition: GenericPacketMath.h:102
@ HasNegate
Definition: GenericPacketMath.h:52
@ HasAdd
Definition: GenericPacketMath.h:48
@ HasExp
Definition: GenericPacketMath.h:75
@ HasRound
Definition: GenericPacketMath.h:62
@ HasBetaInc
Definition: GenericPacketMath.h:103
@ HasSqrt
Definition: GenericPacketMath.h:73
@ HasLGamma
Definition: GenericPacketMath.h:91
@ HasErf
Definition: GenericPacketMath.h:95
@ HasBessel
Definition: GenericPacketMath.h:98
@ HasAbs
Definition: GenericPacketMath.h:53
@ HasCosh
Definition: GenericPacketMath.h:89
@ HasExpm1
Definition: GenericPacketMath.h:76
@ HasLog
Definition: GenericPacketMath.h:77
@ HasTanh
Definition: GenericPacketMath.h:90
@ HasMul
Definition: GenericPacketMath.h:51
@ HasAbs2
Definition: GenericPacketMath.h:54
@ HasGammaSampleDerAlpha
Definition: GenericPacketMath.h:101
@ HasIGammaDerA
Definition: GenericPacketMath.h:100
@ HasATan
Definition: GenericPacketMath.h:86
@ HasDiv
Definition: GenericPacketMath.h:71
Definition: GenericPacketMath.h:225
EIGEN_ALWAYS_INLINE eigen_packet_wrapper & operator=(const T &v)
Definition: GenericPacketMath.h:230
EIGEN_ALWAYS_INLINE eigen_packet_wrapper()=default
EIGEN_ALWAYS_INLINE eigen_packet_wrapper(const T &v)
Definition: GenericPacketMath.h:229
T m_val
Definition: GenericPacketMath.h:235
typename unpacket_traits< SrcPacket >::type SrcScalar
Definition: GenericPacketMath.h:177
typename unpacket_traits< TgtPacket >::type TgtScalar
Definition: GenericPacketMath.h:179
Definition: GenericPacketMath.h:165
Definition: GenericPacketMath.h:186
static constexpr bool value
Definition: GenericPacketMath.h:187
Definition: GenericPacketMath.h:192
static constexpr int Size
Definition: GenericPacketMath.h:194
typename packet_traits< Scalar >::type DefaultPacket
Definition: GenericPacketMath.h:195
typename unpacket_traits< Packet >::type Scalar
Definition: GenericPacketMath.h:193
static constexpr int DefaultSize
Definition: GenericPacketMath.h:196
static constexpr bool value
Definition: GenericPacketMath.h:197
Definition: Meta.h:205
Definition: GenericPacketMath.h:154
@ value
Definition: GenericPacketMath.h:156
typename unpacket_traits< Packet >::type Scalar
Definition: GenericPacketMath.h:155
Definition: GenericPacketMath.h:1143
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet run_ceil(const Packet &x)
Definition: GenericPacketMath.h:1145
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet run_floor(const Packet &x)
Definition: GenericPacketMath.h:1144
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet run_trunc(const Packet &x)
Definition: GenericPacketMath.h:1148
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet run_round(const Packet &x)
Definition: GenericPacketMath.h:1147
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet run_rint(const Packet &x)
Definition: GenericPacketMath.h:1146
Definition: GenericPacketMath.h:498
static EIGEN_DEVICE_FUNC T bitwise_not(const T &a)
Definition: GenericPacketMath.h:502
static EIGEN_DEVICE_FUNC T bitwise_xor(const T &a, const T &b)
Definition: GenericPacketMath.h:501
static EIGEN_DEVICE_FUNC T bitwise_and(const T &a, const T &b)
Definition: GenericPacketMath.h:499
static EIGEN_DEVICE_FUNC T bitwise_or(const T &a, const T &b)
Definition: GenericPacketMath.h:500
Definition: GenericPacketMath.h:108
T type
Definition: GenericPacketMath.h:109
@ size
Definition: GenericPacketMath.h:113
@ AlignedOnScalar
Definition: GenericPacketMath.h:114
@ Vectorizable
Definition: GenericPacketMath.h:112
T half
Definition: GenericPacketMath.h:110
@ HasSub
Definition: GenericPacketMath.h:118
@ HasMax
Definition: GenericPacketMath.h:124
@ HasNegate
Definition: GenericPacketMath.h:120
@ HasMul
Definition: GenericPacketMath.h:119
@ HasAdd
Definition: GenericPacketMath.h:117
@ HasSetLinear
Definition: GenericPacketMath.h:126
@ HasMin
Definition: GenericPacketMath.h:123
@ HasConj
Definition: GenericPacketMath.h:125
@ HasAbs2
Definition: GenericPacketMath.h:122
@ HasAbs
Definition: GenericPacketMath.h:121
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet run(const Packet &a)
Definition: GenericPacketMath.h:276
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket run(const SrcPacket &a)
Definition: GenericPacketMath.h:268
typename is_half< TgtPacket >::DefaultPacket DefaultTgtPacket
Definition: GenericPacketMath.h:310
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket run(const SrcPacket &a)
Definition: GenericPacketMath.h:311
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TgtPacket run(const SrcPacket &a)
Definition: GenericPacketMath.h:282
Definition: GenericPacketMath.h:263
static EIGEN_DEVICE_FUNC Packet run(const Packet &a, const Packet &b, Op op)
Definition: GenericPacketMath.h:624
static EIGEN_DEVICE_FUNC Packet run(const Packet &a, const Packet &b, Op op)
Definition: GenericPacketMath.h:637
Definition: GenericPacketMath.h:612
static EIGEN_DEVICE_FUNC Packet run(const Packet &a, const Packet &b, Op op)
Definition: GenericPacketMath.h:614
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet run(const Packet &a)
Definition: GenericPacketMath.h:252
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Target run(const Packet &a)
Definition: GenericPacketMath.h:244
Definition: GenericPacketMath.h:239
static EIGEN_DEVICE_FUNC Packet run(const Packet &mask, const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:593
Definition: GenericPacketMath.h:584
static EIGEN_DEVICE_FUNC Packet run(const Packet &mask, const Packet &a, const Packet &b)
Definition: GenericPacketMath.h:585
Definition: GenericPacketMath.h:1183
static EIGEN_DEVICE_FUNC Packet run(const Packet &a)
Definition: GenericPacketMath.h:1184
EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE Packet run(const Packet &a)
Definition: GenericPacketMath.h:1456
unpacket_traits< Packet >::type Scalar
Definition: GenericPacketMath.h:1455
EIGEN_DEVICE_FUNC static constexpr EIGEN_ALWAYS_INLINE Packet run(const Packet &a)
Definition: GenericPacketMath.h:1465
EIGEN_DEVICE_FUNC static constexpr EIGEN_ALWAYS_INLINE Packet run(const Packet &a)
Definition: GenericPacketMath.h:1449
Definition: GenericPacketMath.h:1446
static EIGEN_DEVICE_FUNC bool run(const bool &)
Definition: GenericPacketMath.h:385
Definition: GenericPacketMath.h:374
static EIGEN_DEVICE_FUNC Packet run(const Packet &)
Definition: GenericPacketMath.h:375
static EIGEN_DEVICE_FUNC T run(const T &)
Definition: GenericPacketMath.h:417
Definition: GenericPacketMath.h:405
static EIGEN_DEVICE_FUNC Packet run(const Packet &)
Definition: GenericPacketMath.h:406
Definition: GenericPacketMath.h:201
@ TgtCoeffRatio
Definition: GenericPacketMath.h:206
@ VectorizedCast
Definition: GenericPacketMath.h:203
@ SrcCoeffRatio
Definition: GenericPacketMath.h:205
Definition: GenericPacketMath.h:134
numext::get_integer_by_size< sizeof(T)>::signed_type integer_packet
Definition: GenericPacketMath.h:137
T type
Definition: GenericPacketMath.h:135
T half
Definition: GenericPacketMath.h:136
@ masked_load_available
Definition: GenericPacketMath.h:142
@ size
Definition: GenericPacketMath.h:139
@ masked_store_available
Definition: GenericPacketMath.h:143
@ vectorizable
Definition: GenericPacketMath.h:141
@ alignment
Definition: GenericPacketMath.h:140
Definition: GenericPacketMath.h:212
@ DefaultSrcPacketSize
Definition: GenericPacketMath.h:214
@ VectorizedCast
Definition: GenericPacketMath.h:216
@ SrcCoeffRatio
Definition: GenericPacketMath.h:217
@ TgtCoeffRatio
Definition: GenericPacketMath.h:218
@ DefaultTgtPacketSize
Definition: GenericPacketMath.h:215
void run(const string &dir_name, LinearSolver *linear_solver_pt, const unsigned nel_1d, bool mess_up_order)
Definition: two_d_poisson_compare_solvers.cc:317
Definition: ZVector/PacketMath.h:50