ZVector/Complex.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) 2010 Gael Guennebaud <gael.guennebaud@inria.fr>
5 // Copyright (C) 2016 Konstantinos Margaritis <markos@freevec.org>
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_COMPLEX32_ZVECTOR_H
12 #define EIGEN_COMPLEX32_ZVECTOR_H
13 
14 // IWYU pragma: private
15 #include "../../InternalHeaderCheck.h"
16 
17 namespace Eigen {
18 
19 namespace internal {
20 
21 #if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ >= 12)
22 static Packet4ui p4ui_CONJ_XOR = {0x00000000, 0x80000000, 0x00000000,
23  0x80000000}; // vec_mergeh((Packet4ui)p4i_ZERO, (Packet4ui)p4f_MZERO);
24 #endif
25 
27  (Packet2ul)vec_sld((Packet4ui)p2d_ZERO_, (Packet4ui)p2l_ZERO, 8); //{ 0x8000000000000000, 0x0000000000000000 };
29  (Packet2ul)vec_sld((Packet4ui)p2l_ZERO, (Packet4ui)p2d_ZERO_, 8); //{ 0x8000000000000000, 0x0000000000000000 };
30 
31 struct Packet1cd {
33  EIGEN_STRONG_INLINE explicit Packet1cd(const Packet2d& a) : v(a) {}
34  Packet2d v;
35 };
36 
37 struct Packet2cf {
39  EIGEN_STRONG_INLINE explicit Packet2cf(const Packet4f& a) : v(a) {}
40 #if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ < 12)
41  union {
42  Packet4f v;
44  };
45 #else
46  Packet4f v;
47 #endif
48 };
49 
50 template <>
51 struct packet_traits<std::complex<float> > : default_packet_traits {
52  typedef Packet2cf type;
53  typedef Packet2cf half;
54  enum {
55  Vectorizable = 1,
56  AlignedOnScalar = 1,
57  size = 2,
58 
59  HasAdd = 1,
60  HasSub = 1,
61  HasMul = 1,
62  HasDiv = 1,
63  HasLog = 1,
64  HasExp = 1,
65  HasNegate = 1,
66  HasAbs = 0,
67  HasAbs2 = 0,
68  HasMin = 0,
69  HasMax = 0,
70  HasBlend = 1,
71  HasSetLinear = 0
72  };
73 };
74 
75 template <>
76 struct packet_traits<std::complex<double> > : default_packet_traits {
77  typedef Packet1cd type;
78  typedef Packet1cd half;
79  enum {
80  Vectorizable = 1,
81  AlignedOnScalar = 1,
82  size = 1,
83 
84  HasAdd = 1,
85  HasSub = 1,
86  HasMul = 1,
87  HasDiv = 1,
88  HasLog = 1,
89  HasNegate = 1,
90  HasAbs = 0,
91  HasAbs2 = 0,
92  HasMin = 0,
93  HasMax = 0,
94  HasSetLinear = 0
95  };
96 };
97 
98 template <>
99 struct unpacket_traits<Packet2cf> {
100  typedef std::complex<float> type;
101  enum {
102  size = 2,
104  vectorizable = true,
105  masked_load_available = false,
106  masked_store_available = false
107  };
108  typedef Packet2cf half;
109  typedef Packet4f as_real;
110 };
111 template <>
112 struct unpacket_traits<Packet1cd> {
113  typedef std::complex<double> type;
114  enum {
115  size = 1,
117  vectorizable = true,
118  masked_load_available = false,
119  masked_store_available = false
120  };
121  typedef Packet1cd half;
122  typedef Packet2d as_real;
123 };
124 
125 /* Forward declaration */
127 
128 /* complex<double> first */
129 template <>
130 EIGEN_STRONG_INLINE Packet1cd pload<Packet1cd>(const std::complex<double>* from) {
131  EIGEN_DEBUG_ALIGNED_LOAD return Packet1cd(pload<Packet2d>((const double*)from));
132 }
133 template <>
134 EIGEN_STRONG_INLINE Packet1cd ploadu<Packet1cd>(const std::complex<double>* from) {
135  EIGEN_DEBUG_UNALIGNED_LOAD return Packet1cd(ploadu<Packet2d>((const double*)from));
136 }
137 template <>
138 EIGEN_STRONG_INLINE void pstore<std::complex<double> >(std::complex<double>* to, const Packet1cd& from) {
139  EIGEN_DEBUG_ALIGNED_STORE pstore((double*)to, from.v);
140 }
141 template <>
142 EIGEN_STRONG_INLINE void pstoreu<std::complex<double> >(std::complex<double>* to, const Packet1cd& from) {
143  EIGEN_DEBUG_UNALIGNED_STORE pstoreu((double*)to, from.v);
144 }
145 
146 template <>
147 EIGEN_STRONG_INLINE Packet1cd
148 pset1<Packet1cd>(const std::complex<double>& from) { /* here we really have to use unaligned loads :( */
149  return ploadu<Packet1cd>(&from);
150 }
151 
152 template <>
153 EIGEN_DEVICE_FUNC inline Packet1cd pgather<std::complex<double>, Packet1cd>(const std::complex<double>* from,
154  Index stride EIGEN_UNUSED) {
155  return pload<Packet1cd>(from);
156 }
157 template <>
158 EIGEN_DEVICE_FUNC inline void pscatter<std::complex<double>, Packet1cd>(std::complex<double>* to, const Packet1cd& from,
159  Index stride EIGEN_UNUSED) {
160  pstore<std::complex<double> >(to, from);
161 }
162 template <>
163 EIGEN_STRONG_INLINE Packet1cd padd<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
164  return Packet1cd(a.v + b.v);
165 }
166 template <>
167 EIGEN_STRONG_INLINE Packet1cd psub<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
168  return Packet1cd(a.v - b.v);
169 }
170 template <>
171 EIGEN_STRONG_INLINE Packet1cd pnegate(const Packet1cd& a) {
172  return Packet1cd(pnegate(Packet2d(a.v)));
173 }
174 template <>
175 EIGEN_STRONG_INLINE Packet1cd pconj(const Packet1cd& a) {
176  return Packet1cd((Packet2d)vec_xor((Packet2d)a.v, (Packet2d)p2ul_CONJ_XOR2));
177 }
178 template <>
179 EIGEN_STRONG_INLINE Packet1cd pmul<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
180  Packet2d a_re, a_im, v1, v2;
181 
182  // Permute and multiply the real parts of a and b
183  a_re = vec_perm(a.v, a.v, p16uc_PSET64_HI);
184  // Get the imaginary parts of a
185  a_im = vec_perm(a.v, a.v, p16uc_PSET64_LO);
186  // multiply a_re * b
187  v1 = vec_madd(a_re, b.v, p2d_ZERO);
188  // multiply a_im * b and get the conjugate result
189  v2 = vec_madd(a_im, b.v, p2d_ZERO);
190  v2 = (Packet2d)vec_sld((Packet4ui)v2, (Packet4ui)v2, 8);
191  v2 = (Packet2d)vec_xor((Packet2d)v2, (Packet2d)p2ul_CONJ_XOR1);
192 
193  return Packet1cd(v1 + v2);
194 }
195 template <>
196 EIGEN_STRONG_INLINE Packet1cd pand<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
197  return Packet1cd(vec_and(a.v, b.v));
198 }
199 template <>
200 EIGEN_STRONG_INLINE Packet1cd por<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
201  return Packet1cd(vec_or(a.v, b.v));
202 }
203 template <>
204 EIGEN_STRONG_INLINE Packet1cd pxor<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
205  return Packet1cd(vec_xor(a.v, b.v));
206 }
207 template <>
208 EIGEN_STRONG_INLINE Packet1cd pandnot<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
209  return Packet1cd(vec_and(a.v, vec_nor(b.v, b.v)));
210 }
211 template <>
212 EIGEN_STRONG_INLINE Packet1cd ploaddup<Packet1cd>(const std::complex<double>* from) {
213  return pset1<Packet1cd>(*from);
214 }
215 template <>
216 EIGEN_STRONG_INLINE Packet1cd pcmp_eq(const Packet1cd& a, const Packet1cd& b) {
217  Packet2d eq = vec_cmpeq(a.v, b.v);
218  Packet2d tmp = {eq[1], eq[0]};
219  return (Packet1cd)pand<Packet2d>(eq, tmp);
220 }
221 
222 template <>
223 EIGEN_STRONG_INLINE void prefetch<std::complex<double> >(const std::complex<double>* addr) {
225 }
226 
227 template <>
228 EIGEN_STRONG_INLINE std::complex<double> pfirst<Packet1cd>(const Packet1cd& a) {
229  EIGEN_ALIGN16 std::complex<double> res;
230  pstore<std::complex<double> >(&res, a);
231 
232  return res;
233 }
234 
235 template <>
236 EIGEN_STRONG_INLINE Packet1cd preverse(const Packet1cd& a) {
237  return a;
238 }
239 template <>
240 EIGEN_STRONG_INLINE std::complex<double> predux<Packet1cd>(const Packet1cd& a) {
241  return pfirst(a);
242 }
243 template <>
244 EIGEN_STRONG_INLINE std::complex<double> predux_mul<Packet1cd>(const Packet1cd& a) {
245  return pfirst(a);
246 }
248 
249 template <>
250 EIGEN_STRONG_INLINE Packet1cd pdiv<Packet1cd>(const Packet1cd& a, const Packet1cd& b) {
251  return pdiv_complex(a, b);
252 }
253 
254 template <>
256  return plog_complex(a, b);
257 }
258 
259 EIGEN_STRONG_INLINE Packet1cd pcplxflip /*<Packet1cd>*/ (const Packet1cd& x) {
260  return Packet1cd(preverse(Packet2d(x.v)));
261 }
262 
263 EIGEN_STRONG_INLINE void ptranspose(PacketBlock<Packet1cd, 2>& kernel) {
264  Packet2d tmp = vec_perm(kernel.packet[0].v, kernel.packet[1].v, p16uc_TRANSPOSE64_HI);
265  kernel.packet[1].v = vec_perm(kernel.packet[0].v, kernel.packet[1].v, p16uc_TRANSPOSE64_LO);
266  kernel.packet[0].v = tmp;
267 }
268 
269 /* complex<float> follows */
270 template <>
271 EIGEN_STRONG_INLINE Packet2cf pload<Packet2cf>(const std::complex<float>* from) {
272  EIGEN_DEBUG_ALIGNED_LOAD return Packet2cf(pload<Packet4f>((const float*)from));
273 }
274 template <>
275 EIGEN_STRONG_INLINE Packet2cf ploadu<Packet2cf>(const std::complex<float>* from) {
276  EIGEN_DEBUG_UNALIGNED_LOAD return Packet2cf(ploadu<Packet4f>((const float*)from));
277 }
278 template <>
279 EIGEN_STRONG_INLINE void pstore<std::complex<float> >(std::complex<float>* to, const Packet2cf& from) {
280  EIGEN_DEBUG_ALIGNED_STORE pstore((float*)to, from.v);
281 }
282 template <>
283 EIGEN_STRONG_INLINE void pstoreu<std::complex<float> >(std::complex<float>* to, const Packet2cf& from) {
284  EIGEN_DEBUG_UNALIGNED_STORE pstoreu((float*)to, from.v);
285 }
286 
287 template <>
288 EIGEN_STRONG_INLINE std::complex<float> pfirst<Packet2cf>(const Packet2cf& a) {
289  EIGEN_ALIGN16 std::complex<float> res[2];
290  pstore<std::complex<float> >(res, a);
291 
292  return res[0];
293 }
294 
295 #if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ < 12)
296 template <>
297 EIGEN_STRONG_INLINE Packet2cf pset1<Packet2cf>(const std::complex<float>& from) {
298  Packet2cf res;
299  res.cd[0] = Packet1cd(vec_ld2f((const float*)&from));
300  res.cd[1] = res.cd[0];
301  return res;
302 }
303 #else
304 template <>
305 EIGEN_STRONG_INLINE Packet2cf pset1<Packet2cf>(const std::complex<float>& from) {
306  Packet2cf res;
307  if ((std::ptrdiff_t(&from) % 16) == 0)
308  res.v = pload<Packet4f>((const float*)&from);
309  else
310  res.v = ploadu<Packet4f>((const float*)&from);
311  res.v = vec_perm(res.v, res.v, p16uc_PSET64_HI);
312  return res;
313 }
314 #endif
315 
316 template <>
317 EIGEN_DEVICE_FUNC inline Packet2cf pgather<std::complex<float>, Packet2cf>(const std::complex<float>* from,
318  Index stride) {
319  EIGEN_ALIGN16 std::complex<float> af[2];
320  af[0] = from[0 * stride];
321  af[1] = from[1 * stride];
322  return pload<Packet2cf>(af);
323 }
324 template <>
325 EIGEN_DEVICE_FUNC inline void pscatter<std::complex<float>, Packet2cf>(std::complex<float>* to, const Packet2cf& from,
326  Index stride) {
327  EIGEN_ALIGN16 std::complex<float> af[2];
328  pstore<std::complex<float> >((std::complex<float>*)af, from);
329  to[0 * stride] = af[0];
330  to[1 * stride] = af[1];
331 }
332 
333 template <>
334 EIGEN_STRONG_INLINE Packet2cf padd<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
335  return Packet2cf(padd<Packet4f>(a.v, b.v));
336 }
337 template <>
338 EIGEN_STRONG_INLINE Packet2cf psub<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
339  return Packet2cf(psub<Packet4f>(a.v, b.v));
340 }
341 template <>
342 EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf& a) {
343  return Packet2cf(pnegate(Packet4f(a.v)));
344 }
345 
346 template <>
347 EIGEN_STRONG_INLINE Packet2cf pand<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
348  return Packet2cf(pand<Packet4f>(a.v, b.v));
349 }
350 template <>
351 EIGEN_STRONG_INLINE Packet2cf por<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
352  return Packet2cf(por<Packet4f>(a.v, b.v));
353 }
354 template <>
355 EIGEN_STRONG_INLINE Packet2cf pxor<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
356  return Packet2cf(pxor<Packet4f>(a.v, b.v));
357 }
358 template <>
359 EIGEN_STRONG_INLINE Packet2cf pandnot<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
360  return Packet2cf(pandnot<Packet4f>(a.v, b.v));
361 }
362 
363 template <>
364 EIGEN_STRONG_INLINE Packet2cf ploaddup<Packet2cf>(const std::complex<float>* from) {
365  return pset1<Packet2cf>(*from);
366 }
367 
368 template <>
369 EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(const std::complex<float>* addr) {
371 }
372 
373 #if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ < 12)
374 
375 template <>
376 EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf& a, const Packet2cf& b) {
377  Packet4f eq = pcmp_eq<Packet4f>(a.v, b.v);
378  Packet2cf res;
379  Packet2d tmp1 = {eq.v4f[0][1], eq.v4f[0][0]};
380  Packet2d tmp2 = {eq.v4f[1][1], eq.v4f[1][0]};
381  res.v.v4f[0] = pand<Packet2d>(eq.v4f[0], tmp1);
382  res.v.v4f[1] = pand<Packet2d>(eq.v4f[1], tmp2);
383  return res;
384 }
385 
386 template <>
387 EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf& a) {
388  Packet2cf res;
389  res.v.v4f[0] = pconj(Packet1cd(reinterpret_cast<Packet2d>(a.v.v4f[0]))).v;
390  res.v.v4f[1] = pconj(Packet1cd(reinterpret_cast<Packet2d>(a.v.v4f[1]))).v;
391  return res;
392 }
393 
394 template <>
395 EIGEN_STRONG_INLINE Packet2cf pmul<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
396  Packet2cf res;
397  res.v.v4f[0] =
398  pmul(Packet1cd(reinterpret_cast<Packet2d>(a.v.v4f[0])), Packet1cd(reinterpret_cast<Packet2d>(b.v.v4f[0]))).v;
399  res.v.v4f[1] =
400  pmul(Packet1cd(reinterpret_cast<Packet2d>(a.v.v4f[1])), Packet1cd(reinterpret_cast<Packet2d>(b.v.v4f[1]))).v;
401  return res;
402 }
403 
404 template <>
405 EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf& a) {
406  Packet2cf res;
407  res.cd[0] = a.cd[1];
408  res.cd[1] = a.cd[0];
409  return res;
410 }
411 
412 template <>
413 EIGEN_STRONG_INLINE std::complex<float> predux<Packet2cf>(const Packet2cf& a) {
414  std::complex<float> res;
415  Packet1cd b = padd<Packet1cd>(a.cd[0], a.cd[1]);
416  vec_st2f(b.v, (float*)&res);
417  return res;
418 }
419 
420 template <>
421 EIGEN_STRONG_INLINE std::complex<float> predux_mul<Packet2cf>(const Packet2cf& a) {
422  std::complex<float> res;
423  Packet1cd b = pmul<Packet1cd>(a.cd[0], a.cd[1]);
424  vec_st2f(b.v, (float*)&res);
425  return res;
426 }
427 
429 
430 template <>
431 EIGEN_STRONG_INLINE Packet2cf pdiv<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
432  return pdiv_complex(a, b);
433 }
434 
435 template <>
437  return plog_complex(a, b);
438 }
439 
440 template <>
442  return pexp_complex(a, b);
443 }
444 
445 EIGEN_STRONG_INLINE Packet2cf pcplxflip /*<Packet2cf>*/ (const Packet2cf& x) {
446  Packet2cf res;
447  res.cd[0] = pcplxflip(x.cd[0]);
448  res.cd[1] = pcplxflip(x.cd[1]);
449  return res;
450 }
451 
452 EIGEN_STRONG_INLINE void ptranspose(PacketBlock<Packet2cf, 2>& kernel) {
453  Packet1cd tmp = kernel.packet[0].cd[1];
454  kernel.packet[0].cd[1] = kernel.packet[1].cd[0];
455  kernel.packet[1].cd[0] = tmp;
456 }
457 
458 template <>
459 EIGEN_STRONG_INLINE Packet2cf pblend(const Selector<2>& ifPacket, const Packet2cf& thenPacket,
460  const Packet2cf& elsePacket) {
461  Packet2cf result;
462  const Selector<4> ifPacket4 = {ifPacket.select[0], ifPacket.select[0], ifPacket.select[1], ifPacket.select[1]};
463  result.v = pblend<Packet4f>(ifPacket4, thenPacket.v, elsePacket.v);
464  return result;
465 }
466 #else
467 template <>
468 EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf& a, const Packet2cf& b) {
469  Packet4f eq = vec_cmpeq(a.v, b.v);
470  Packet4f tmp = {eq[1], eq[0], eq[3], eq[2]};
471  return (Packet2cf)pand<Packet4f>(eq, tmp);
472 }
473 template <>
474 EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf& a) {
475  return Packet2cf(pxor<Packet4f>(a.v, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR)));
476 }
477 template <>
478 EIGEN_STRONG_INLINE Packet2cf pmul<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
479  Packet4f a_re, a_im, prod, prod_im;
480 
481  // Permute and multiply the real parts of a and b
482  a_re = vec_perm(a.v, a.v, p16uc_PSET32_WODD);
483 
484  // Get the imaginary parts of a
485  a_im = vec_perm(a.v, a.v, p16uc_PSET32_WEVEN);
486 
487  // multiply a_im * b and get the conjugate result
488  prod_im = a_im * b.v;
489  prod_im = pxor<Packet4f>(prod_im, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR));
490  // permute back to a proper order
491  prod_im = vec_perm(prod_im, prod_im, p16uc_COMPLEX32_REV);
492 
493  // multiply a_re * b, add prod_im
494  prod = pmadd<Packet4f>(a_re, b.v, prod_im);
495 
496  return Packet2cf(prod);
497 }
498 
499 template <>
500 EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf& a) {
501  Packet4f rev_a;
502  rev_a = vec_perm(a.v, a.v, p16uc_COMPLEX32_REV2);
503  return Packet2cf(rev_a);
504 }
505 
506 template <>
507 EIGEN_STRONG_INLINE std::complex<float> predux<Packet2cf>(const Packet2cf& a) {
508  Packet4f b;
509  b = vec_sld(a.v, a.v, 8);
510  b = padd<Packet4f>(a.v, b);
511  return pfirst<Packet2cf>(Packet2cf(b));
512 }
513 
514 template <>
515 EIGEN_STRONG_INLINE std::complex<float> predux_mul<Packet2cf>(const Packet2cf& a) {
516  Packet4f b;
517  Packet2cf prod;
518  b = vec_sld(a.v, a.v, 8);
519  prod = pmul<Packet2cf>(a, Packet2cf(b));
520 
521  return pfirst<Packet2cf>(prod);
522 }
523 
525 
526 template <>
527 EIGEN_STRONG_INLINE Packet2cf pdiv<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
528  return pdiv_complex(a, b);
529 }
530 
531 template <>
532 EIGEN_STRONG_INLINE Packet2cf pcplxflip<Packet2cf>(const Packet2cf& x) {
533  return Packet2cf(vec_perm(x.v, x.v, p16uc_COMPLEX32_REV));
534 }
535 
536 EIGEN_STRONG_INLINE void ptranspose(PacketBlock<Packet2cf, 2>& kernel) {
537  Packet4f tmp = vec_perm(kernel.packet[0].v, kernel.packet[1].v, p16uc_TRANSPOSE64_HI);
538  kernel.packet[1].v = vec_perm(kernel.packet[0].v, kernel.packet[1].v, p16uc_TRANSPOSE64_LO);
539  kernel.packet[0].v = tmp;
540 }
541 
542 template <>
543 EIGEN_STRONG_INLINE Packet2cf pblend(const Selector<2>& ifPacket, const Packet2cf& thenPacket,
544  const Packet2cf& elsePacket) {
545  Packet2cf result;
546  result.v = reinterpret_cast<Packet4f>(
547  pblend<Packet2d>(ifPacket, reinterpret_cast<Packet2d>(thenPacket.v), reinterpret_cast<Packet2d>(elsePacket.v)));
548  return result;
549 }
550 #endif
551 
552 } // end namespace internal
553 
554 } // end namespace Eigen
555 
556 #endif // EIGEN_COMPLEX32_ZVECTOR_H
#define EIGEN_ALIGN16
Definition: ConfigureVectorization.h:142
#define EIGEN_MAKE_CONJ_HELPER_CPLX_REAL(PACKET_CPLX, PACKET_REAL)
Definition: ConjHelper.h:14
#define EIGEN_DEBUG_ALIGNED_STORE
Definition: GenericPacketMath.h:38
#define EIGEN_DEBUG_ALIGNED_LOAD
Definition: GenericPacketMath.h:30
#define EIGEN_DEBUG_UNALIGNED_STORE
Definition: GenericPacketMath.h:42
#define EIGEN_DEBUG_UNALIGNED_LOAD
Definition: GenericPacketMath.h:34
#define EIGEN_UNUSED
Definition: Macros.h:940
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
Map< RowVectorXf > v2(M2.data(), M2.size())
M1<< 1, 2, 3, 4, 5, 6, 7, 8, 9;Map< RowVectorXf > v1(M1.data(), M1.size())
#define EIGEN_ZVECTOR_PREFETCH(ADDR)
Definition: ZVector/PacketMath.h:154
Scalar * b
Definition: benchVecAdd.cpp:17
EIGEN_STRONG_INLINE PacketScalar packet(Index rowId, Index colId) const
Definition: PlainObjectBase.h:247
@ Aligned16
Definition: Constants.h:237
const Scalar * a
Definition: level2_cplx_impl.h:32
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365
EIGEN_STRONG_INLINE Packet4f pandnot< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1465
__m128d Packet2d
Definition: LSX/PacketMath.h:36
static Packet2ul p2ul_CONJ_XOR2
Definition: ZVector/Complex.h:28
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf &a)
Definition: AltiVec/Complex.h:268
EIGEN_STRONG_INLINE std::complex< float > predux_mul< Packet2cf >(const Packet2cf &a)
Definition: AltiVec/Complex.h:318
EIGEN_STRONG_INLINE std::complex< float > predux< Packet2cf >(const Packet2cf &a)
Definition: AltiVec/Complex.h:310
EIGEN_STRONG_INLINE Packet4f padd< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1066
EIGEN_STRONG_INLINE Packet4f pcmp_eq< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: LSX/PacketMath.h:1131
EIGEN_STRONG_INLINE std::complex< double > predux_mul< Packet1cd >(const Packet1cd &a)
Definition: LSX/Complex.h:420
EIGEN_STRONG_INLINE Packet2cf pandnot< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:285
EIGEN_STRONG_INLINE Packet2d pand< Packet2d >(const Packet2d &a, const Packet2d &b)
Definition: LSX/PacketMath.h:880
EIGEN_STRONG_INLINE void ptranspose(PacketBlock< Packet2cf, 2 > &kernel)
Definition: AltiVec/Complex.h:339
EIGEN_STRONG_INLINE Packet1cd plog< Packet1cd >(const Packet1cd &a)
Definition: LSX/Complex.h:472
EIGEN_STRONG_INLINE Packet2cf ploaddup< Packet2cf >(const std::complex< float > *from)
Definition: AltiVec/Complex.h:162
static Packet16uc p16uc_TRANSPOSE64_LO
Definition: AltiVec/PacketMath.h:145
EIGEN_STRONG_INLINE Packet2cf pmul< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: LSX/Complex.h:95
EIGEN_STRONG_INLINE Packet4f por< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1427
static Packet16uc p16uc_PSET32_WEVEN
Definition: AltiVec/PacketMath.h:132
EIGEN_STRONG_INLINE Packet4i pblend(const Selector< 4 > &ifPacket, const Packet4i &thenPacket, const Packet4i &elsePacket)
Definition: AltiVec/PacketMath.h:3075
EIGEN_STRONG_INLINE Packet1cd pmul< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:327
EIGEN_STRONG_INLINE std::complex< float > pfirst< Packet2cf >(const Packet2cf &a)
Definition: AltiVec/Complex.h:295
EIGEN_STRONG_INLINE Packet4f pload< Packet4f >(const float *from)
Definition: AltiVec/PacketMath.h:492
EIGEN_STRONG_INLINE Packet1cd ploadu< Packet1cd >(const std::complex< double > *from)
Definition: LSX/Complex.h:373
EIGEN_STRONG_INLINE Packet2cf por< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:277
EIGEN_STRONG_INLINE Packet2cf pset1< Packet2cf >(const std::complex< float > &from)
Definition: AltiVec/Complex.h:125
__vector unsigned int Packet4ui
Definition: AltiVec/PacketMath.h:35
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet plog_complex(const Packet &x)
Definition: GenericPacketMathFunctions.h:1338
EIGEN_STRONG_INLINE Packet2cf preverse(const Packet2cf &a)
Definition: AltiVec/Complex.h:303
static Packet4ui p4ui_CONJ_XOR
Definition: AltiVec/Complex.h:21
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_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pexp_complex(const Packet &a)
Definition: GenericPacketMathFunctions.h:1366
static Packet2ul p2ul_CONJ_XOR1
Definition: ZVector/Complex.h:26
EIGEN_STRONG_INLINE Packet2d pload< Packet2d >(const double *from)
Definition: LSX/PacketMath.h:1407
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS Packet pdiv_complex(const Packet &x, const Packet &y)
Definition: GenericPacketMathFunctions.h:1318
EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf &a)
Definition: AltiVec/Complex.h:264
EIGEN_STRONG_INLINE Packet1cd pxor< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:355
EIGEN_STRONG_INLINE Packet2cf pdiv< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:330
EIGEN_STRONG_INLINE Packet1cd padd< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:305
EIGEN_STRONG_INLINE Packet2cf ploadu< Packet2cf >(const std::complex< float > *from)
Definition: AltiVec/Complex.h:148
static Packet2d p2d_ZERO_
Definition: ZVector/PacketMath.h:91
EIGEN_STRONG_INLINE Packet1cd ploaddup< Packet1cd >(const std::complex< double > *from)
Definition: LSX/Complex.h:383
EIGEN_STRONG_INLINE Packet2cf pload< Packet2cf >(const std::complex< float > *from)
Definition: AltiVec/Complex.h:144
EIGEN_STRONG_INLINE bfloat16 pfirst(const Packet8bf &a)
Definition: AltiVec/PacketMath.h:2418
EIGEN_STRONG_INLINE std::complex< double > predux< Packet1cd >(const Packet1cd &a)
Definition: LSX/Complex.h:415
EIGEN_DEVICE_FUNC void pstore(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:891
static Packet16uc p16uc_PSET64_HI
Definition: AltiVec/PacketMath.h:139
EIGEN_STRONG_INLINE Packet2d ploadu< Packet2d >(const double *from)
Definition: LSX/PacketMath.h:1448
EIGEN_STRONG_INLINE Packet4f pxor< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1448
EIGEN_STRONG_INLINE Packet1cd pload< Packet1cd >(const std::complex< double > *from)
Definition: LSX/Complex.h:369
EIGEN_STRONG_INLINE Packet2cf pcplxflip< Packet2cf >(const Packet2cf &x)
Definition: AltiVec/Complex.h:335
EIGEN_STRONG_INLINE Packet1cd pand< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:343
EIGEN_STRONG_INLINE Packet2cf pand< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:273
EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:353
EIGEN_STRONG_INLINE Packet2cf pexp< Packet2cf >(const Packet2cf &a)
Definition: AltiVec/Complex.h:380
EIGEN_STRONG_INLINE Packet1cd pandnot< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:361
EIGEN_DEVICE_FUNC void pstoreu(Scalar *to, const Packet &from)
Definition: GenericPacketMath.h:911
EIGEN_STRONG_INLINE Packet2cf pxor< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:281
EIGEN_STRONG_INLINE Packet4f ploadu< Packet4f >(const float *from)
Definition: AltiVec/PacketMath.h:1533
EIGEN_STRONG_INLINE Packet2cf psub< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:260
EIGEN_STRONG_INLINE Packet4f pand< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1406
static Packet16uc p16uc_PSET32_WODD
Definition: AltiVec/PacketMath.h:129
static Packet16uc p16uc_PSET64_LO
Definition: AltiVec/PacketMath.h:141
EIGEN_STRONG_INLINE Packet2cf plog< Packet2cf >(const Packet2cf &a)
Definition: AltiVec/Complex.h:375
static Packet16uc p16uc_COMPLEX32_REV
Definition: AltiVec/PacketMath.h:148
EIGEN_STRONG_INLINE Packet2cf padd< Packet2cf >(const Packet2cf &a, const Packet2cf &b)
Definition: AltiVec/Complex.h:256
EIGEN_STRONG_INLINE Packet1cd por< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:349
__vector float Packet4f
Definition: AltiVec/PacketMath.h:33
EIGEN_STRONG_INLINE Packet4f psub< Packet4f >(const Packet4f &a, const Packet4f &b)
Definition: AltiVec/PacketMath.h:1095
EIGEN_STRONG_INLINE Packet1cd pset1< Packet1cd >(const std::complex< double > &from)
Definition: LSX/Complex.h:378
EIGEN_STRONG_INLINE std::complex< double > pfirst< Packet1cd >(const Packet1cd &a)
Definition: LSX/Complex.h:403
static Packet16uc p16uc_COMPLEX32_REV2
Definition: ZVector/PacketMath.h:148
EIGEN_STRONG_INLINE Packet1cd pdiv< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:427
eigen_packet_wrapper< __m128i, 7 > Packet2ul
Definition: LSX/PacketMath.h:45
EIGEN_STRONG_INLINE Packet1cd psub< Packet1cd >(const Packet1cd &a, const Packet1cd &b)
Definition: LSX/Complex.h:309
static Packet16uc p16uc_TRANSPOSE64_HI
Definition: AltiVec/PacketMath.h:143
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
const Product< Lhs, Rhs > prod(const Lhs &lhs, const Rhs &rhs)
Definition: evaluators.cpp:7
Definition: Eigen_Colamd.h:49
list x
Definition: plotDoE.py:28
Definition: LSX/Complex.h:260
EIGEN_STRONG_INLINE Packet1cd(const Packet2d &a)
Definition: ZVector/Complex.h:33
EIGEN_STRONG_INLINE Packet1cd()
Definition: ZVector/Complex.h:32
Packet2d v
Definition: LSX/Complex.h:263
Definition: AltiVec/Complex.h:38
Packet4f v
Definition: AltiVec/Complex.h:78
EIGEN_STRONG_INLINE Packet2cf()
Definition: ZVector/Complex.h:38
Packet1cd cd[2]
Definition: ZVector/Complex.h:43
EIGEN_STRONG_INLINE Packet2cf(const Packet4f &a)
Definition: ZVector/Complex.h:39
__m256 v
Definition: AVX/Complex.h:24
Definition: GenericPacketMath.h:1407
@ HasBlend
Definition: GenericPacketMath.h:66
@ HasExp
Definition: GenericPacketMath.h:75
@ HasLog
Definition: GenericPacketMath.h:77
@ HasDiv
Definition: GenericPacketMath.h:71
Packet1cd half
Definition: ZVector/Complex.h:78
Packet1cd type
Definition: ZVector/Complex.h:77
Packet2cf half
Definition: ZVector/Complex.h:53
Packet2cf type
Definition: ZVector/Complex.h:52
@ size
Definition: GenericPacketMath.h:113
@ AlignedOnScalar
Definition: GenericPacketMath.h:114
@ Vectorizable
Definition: GenericPacketMath.h:112
@ 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
@ HasAbs2
Definition: GenericPacketMath.h:122
@ HasAbs
Definition: GenericPacketMath.h:121
Packet2d as_real
Definition: ZVector/Complex.h:122
Packet1cd half
Definition: ZVector/Complex.h:121
std::complex< double > type
Definition: ZVector/Complex.h:113
std::complex< float > type
Definition: ZVector/Complex.h:100
Packet4f as_real
Definition: ZVector/Complex.h:109
Packet2cf half
Definition: ZVector/Complex.h:108
Definition: GenericPacketMath.h:134
@ 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: datatypes.h:12