AssignEvaluator.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) 2011 Benoit Jacob <jacob.benoit.1@gmail.com>
5 // Copyright (C) 2011-2014 Gael Guennebaud <gael.guennebaud@inria.fr>
6 // Copyright (C) 2011-2012 Jitse Niesen <jitse@maths.leeds.ac.uk>
7 //
8 // This Source Code Form is subject to the terms of the Mozilla
9 // Public License v. 2.0. If a copy of the MPL was not distributed
10 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 
12 #ifndef EIGEN_ASSIGN_EVALUATOR_H
13 #define EIGEN_ASSIGN_EVALUATOR_H
14 
15 // IWYU pragma: private
16 #include "./InternalHeaderCheck.h"
17 
18 namespace Eigen {
19 
20 // This implementation is based on Assign.h
21 
22 namespace internal {
23 
24 /***************************************************************************
25  * Part 1 : the logic deciding a strategy for traversal and unrolling *
26  ***************************************************************************/
27 
28 // copy_using_evaluator_traits is based on assign_traits
29 
30 template <typename DstEvaluator, typename SrcEvaluator, typename AssignFunc, int MaxPacketSize = -1>
32  typedef typename DstEvaluator::XprType Dst;
33  typedef typename Dst::Scalar DstScalar;
34 
35  enum { DstFlags = DstEvaluator::Flags, SrcFlags = SrcEvaluator::Flags };
36 
37  public:
38  enum {
39  DstAlignment = DstEvaluator::Alignment,
40  SrcAlignment = SrcEvaluator::Alignment,
43  };
44 
45  private:
46  enum {
47  InnerSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::SizeAtCompileTime)
48  : int(DstFlags) & RowMajorBit ? int(Dst::ColsAtCompileTime)
49  : int(Dst::RowsAtCompileTime),
50  InnerMaxSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::MaxSizeAtCompileTime)
51  : int(DstFlags) & RowMajorBit ? int(Dst::MaxColsAtCompileTime)
52  : int(Dst::MaxRowsAtCompileTime),
54  RestrictedLinearSize = min_size_prefer_fixed(Dst::SizeAtCompileTime, MaxPacketSize),
56  MaxSizeAtCompileTime = Dst::SizeAtCompileTime
57  };
58 
59  // TODO distinguish between linear traversal and inner-traversals
62 
63  enum {
66  };
67 
68  public:
69  enum {
72  };
73 
74  private:
75  enum {
88  /* If the destination isn't aligned, we have to do runtime checks and we don't unroll,
89  so it's only good for large enough sizes. */
91  (int(InnerMaxSize) == Dynamic ||
93  /* slice vectorization can be slow, so we only want it if the slices are big, which is
94  indicated by InnerMaxSize rather than InnerSize, think of the case of a dynamic block
95  in a fixed-size matrix
96  However, with EIGEN_UNALIGNED_VECTORIZE and unrolling, slice vectorization is still worth it */
97  };
98 
99  public:
100  enum {
101  Traversal = int(Dst::SizeAtCompileTime) == 0
102  ? int(AllAtOnceTraversal) // If compile-size is zero, traversing will fail at compile-time.
111  };
112 
114 
115  private:
116  enum {
119  : 1,
121  MayUnrollCompletely =
122  int(Dst::SizeAtCompileTime) != Dynamic &&
123  int(Dst::SizeAtCompileTime) * (int(DstEvaluator::CoeffReadCost) + int(SrcEvaluator::CoeffReadCost)) <=
124  int(UnrollingLimit),
125  MayUnrollInner =
126  int(InnerSize) != Dynamic &&
127  int(InnerSize) * (int(DstEvaluator::CoeffReadCost) + int(SrcEvaluator::CoeffReadCost)) <= int(UnrollingLimit)
128  };
129 
130  public:
131  enum {
133  ? (int(MayUnrollCompletely) ? int(CompleteUnrolling)
134  : int(MayUnrollInner) ? int(InnerUnrolling)
135  : int(NoUnrolling))
137  ? (bool(MayUnrollCompletely) &&
140  : int(NoUnrolling))
141  : int(Traversal) == int(LinearTraversal)
142  ? (bool(MayUnrollCompletely) ? int(CompleteUnrolling) : int(NoUnrolling))
145  ? (bool(MayUnrollInner) ? int(InnerUnrolling) : int(NoUnrolling))
146 #endif
147  : int(NoUnrolling)
148  };
149 
150 #ifdef EIGEN_DEBUG_ASSIGN
151  static void debug() {
152  std::cerr << "DstXpr: " << typeid(typename DstEvaluator::XprType).name() << std::endl;
153  std::cerr << "SrcXpr: " << typeid(typename SrcEvaluator::XprType).name() << std::endl;
154  std::cerr.setf(std::ios::hex, std::ios::basefield);
155  std::cerr << "DstFlags"
156  << " = " << DstFlags << " (" << demangle_flags(DstFlags) << " )" << std::endl;
157  std::cerr << "SrcFlags"
158  << " = " << SrcFlags << " (" << demangle_flags(SrcFlags) << " )" << std::endl;
159  std::cerr.unsetf(std::ios::hex);
176  std::cerr << "Traversal"
177  << " = " << Traversal << " (" << demangle_traversal(Traversal) << ")" << std::endl;
178  EIGEN_DEBUG_VAR(SrcEvaluator::CoeffReadCost)
179  EIGEN_DEBUG_VAR(DstEvaluator::CoeffReadCost)
180  EIGEN_DEBUG_VAR(Dst::SizeAtCompileTime)
182  EIGEN_DEBUG_VAR(MayUnrollCompletely)
183  EIGEN_DEBUG_VAR(MayUnrollInner)
184  std::cerr << "Unrolling"
185  << " = " << Unrolling << " (" << demangle_unrolling(Unrolling) << ")" << std::endl;
186  std::cerr << std::endl;
187  }
188 #endif
189 };
190 
191 /***************************************************************************
192  * Part 2 : meta-unrollers
193  ***************************************************************************/
194 
195 /************************
196 *** Default traversal ***
197 ************************/
198 
199 template <typename Kernel, int Index, int Stop>
201  // FIXME: this is not very clean, perhaps this information should be provided by the kernel?
202  typedef typename Kernel::DstEvaluatorType DstEvaluatorType;
204 
205  enum { outer = Index / DstXprType::InnerSizeAtCompileTime, inner = Index % DstXprType::InnerSizeAtCompileTime };
206 
208  kernel.assignCoeffByOuterInner(outer, inner);
210  }
211 };
212 
213 template <typename Kernel, int Stop>
216 };
217 
218 template <typename Kernel, int Index_, int Stop>
220  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel& kernel, Index outer) {
221  kernel.assignCoeffByOuterInner(outer, Index_);
223  }
224 };
225 
226 template <typename Kernel, int Stop>
229 };
230 
231 /***********************
232 *** Linear traversal ***
233 ***********************/
234 
235 template <typename Kernel, int Index, int Stop>
238  kernel.assignCoeff(Index);
240  }
241 };
242 
243 template <typename Kernel, int Stop>
246 };
247 
248 /**************************
249 *** Inner vectorization ***
250 **************************/
251 
252 template <typename Kernel, int Index, int Stop>
254  // FIXME: this is not very clean, perhaps this information should be provided by the kernel?
255  typedef typename Kernel::DstEvaluatorType DstEvaluatorType;
257  typedef typename Kernel::PacketType PacketType;
258 
259  enum {
260  outer = Index / DstXprType::InnerSizeAtCompileTime,
261  inner = Index % DstXprType::InnerSizeAtCompileTime,
262  SrcAlignment = Kernel::AssignmentTraits::SrcAlignment,
263  DstAlignment = Kernel::AssignmentTraits::DstAlignment
264  };
265 
267  kernel.template assignPacketByOuterInner<DstAlignment, SrcAlignment, PacketType>(outer, inner);
268  enum { NextIndex = Index + unpacket_traits<PacketType>::size };
270  }
271 };
272 
273 template <typename Kernel, int Stop>
276 };
277 
278 template <typename Kernel, int Index_, int Stop, int SrcAlignment, int DstAlignment>
280  typedef typename Kernel::PacketType PacketType;
281  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel& kernel, Index outer) {
282  kernel.template assignPacketByOuterInner<DstAlignment, SrcAlignment, PacketType>(outer, Index_);
283  enum { NextIndex = Index_ + unpacket_traits<PacketType>::size };
285  outer);
286  }
287 };
288 
289 template <typename Kernel, int Stop, int SrcAlignment, int DstAlignment>
292 };
293 
294 /***************************************************************************
295  * Part 3 : implementation of all cases
296  ***************************************************************************/
297 
298 // dense_assignment_loop is based on assign_impl
299 
300 template <typename Kernel, int Traversal = Kernel::AssignmentTraits::Traversal,
301  int Unrolling = Kernel::AssignmentTraits::Unrolling>
303 
304 /************************
305 ***** Special Cases *****
306 ************************/
307 
308 // Zero-sized assignment is a no-op.
309 template <typename Kernel, int Unrolling>
312  EIGEN_STATIC_ASSERT(int(Kernel::DstEvaluatorType::XprType::SizeAtCompileTime) == 0,
313  EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT)
314  }
315 };
316 
317 /************************
318 *** Default traversal ***
319 ************************/
320 
321 template <typename Kernel>
324  for (Index outer = 0; outer < kernel.outerSize(); ++outer) {
325  for (Index inner = 0; inner < kernel.innerSize(); ++inner) {
326  kernel.assignCoeffByOuterInner(outer, inner);
327  }
328  }
329  }
330 };
331 
332 template <typename Kernel>
335  typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
337  }
338 };
339 
340 template <typename Kernel>
343  typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
344 
345  const Index outerSize = kernel.outerSize();
346  for (Index outer = 0; outer < outerSize; ++outer)
348  outer);
349  }
350 };
351 
352 /***************************
353 *** Linear vectorization ***
354 ***************************/
355 
356 // The goal of unaligned_dense_assignment_loop is simply to factorize the handling
357 // of the non vectorizable beginning and ending parts
358 
359 template <bool IsAligned = false>
361  // if IsAligned = true, then do nothing
362  template <typename Kernel>
364 };
365 
366 template <>
368  // MSVC must not inline this functions. If it does, it fails to optimize the
369  // packet access path.
370  // FIXME check which version exhibits this issue
371 #if EIGEN_COMP_MSVC
372  template <typename Kernel>
373  static EIGEN_DONT_INLINE void run(Kernel& kernel, Index start, Index end)
374 #else
375  template <typename Kernel>
377 #endif
378  {
379  for (Index index = start; index < end; ++index) kernel.assignCoeff(index);
380  }
381 };
382 
383 template <typename Kernel, int Index, int Stop>
385  // FIXME: this is not very clean, perhaps this information should be provided by the kernel?
386  typedef typename Kernel::DstEvaluatorType DstEvaluatorType;
388  typedef typename Kernel::PacketType PacketType;
389 
390  enum { SrcAlignment = Kernel::AssignmentTraits::SrcAlignment, DstAlignment = Kernel::AssignmentTraits::DstAlignment };
391 
393  kernel.template assignPacket<DstAlignment, SrcAlignment, PacketType>(Index);
394  enum { NextIndex = Index + unpacket_traits<PacketType>::size };
396  }
397 };
398 
399 template <typename Kernel, int Stop>
402 };
403 
404 template <typename Kernel>
407  const Index size = kernel.size();
408  typedef typename Kernel::Scalar Scalar;
409  typedef typename Kernel::PacketType PacketType;
410  enum {
411  requestedAlignment = Kernel::AssignmentTraits::LinearRequiredAlignment,
413  dstIsAligned = int(Kernel::AssignmentTraits::DstAlignment) >= int(requestedAlignment),
414  dstAlignment = packet_traits<Scalar>::AlignedOnScalar ? int(requestedAlignment)
415  : int(Kernel::AssignmentTraits::DstAlignment),
416  srcAlignment = Kernel::AssignmentTraits::JointAlignment
417  };
418  const Index alignedStart =
419  dstIsAligned ? 0 : internal::first_aligned<requestedAlignment>(kernel.dstDataPtr(), size);
420  const Index alignedEnd = alignedStart + ((size - alignedStart) / packetSize) * packetSize;
421 
423 
424  for (Index index = alignedStart; index < alignedEnd; index += packetSize)
425  kernel.template assignPacket<dstAlignment, srcAlignment, PacketType>(index);
426 
427  unaligned_dense_assignment_loop<>::run(kernel, alignedEnd, size);
428  }
429 };
430 
431 template <typename Kernel>
434  typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
435  typedef typename Kernel::PacketType PacketType;
436 
437  enum {
438  size = DstXprType::SizeAtCompileTime,
440  alignedSize = (int(size) / packetSize) * packetSize
441  };
442 
445  }
446 };
447 
448 /**************************
449 *** Inner vectorization ***
450 **************************/
451 
452 template <typename Kernel>
454  typedef typename Kernel::PacketType PacketType;
455  enum { SrcAlignment = Kernel::AssignmentTraits::SrcAlignment, DstAlignment = Kernel::AssignmentTraits::DstAlignment };
457  const Index innerSize = kernel.innerSize();
458  const Index outerSize = kernel.outerSize();
459  const Index packetSize = unpacket_traits<PacketType>::size;
460  for (Index outer = 0; outer < outerSize; ++outer)
461  for (Index inner = 0; inner < innerSize; inner += packetSize)
462  kernel.template assignPacketByOuterInner<DstAlignment, SrcAlignment, PacketType>(outer, inner);
463  }
464 };
465 
466 template <typename Kernel>
469  typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
471  }
472 };
473 
474 template <typename Kernel>
477  typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
478  typedef typename Kernel::AssignmentTraits Traits;
479  const Index outerSize = kernel.outerSize();
480  for (Index outer = 0; outer < outerSize; ++outer)
481  copy_using_evaluator_innervec_InnerUnrolling<Kernel, 0, DstXprType::InnerSizeAtCompileTime, Traits::SrcAlignment,
482  Traits::DstAlignment>::run(kernel, outer);
483  }
484 };
485 
486 /***********************
487 *** Linear traversal ***
488 ***********************/
489 
490 template <typename Kernel>
493  const Index size = kernel.size();
494  for (Index i = 0; i < size; ++i) kernel.assignCoeff(i);
495  }
496 };
497 
498 template <typename Kernel>
501  typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
503  }
504 };
505 
506 /**************************
507 *** Slice vectorization ***
508 ***************************/
509 
510 template <typename Kernel>
513  typedef typename Kernel::Scalar Scalar;
514  typedef typename Kernel::PacketType PacketType;
515  enum {
517  requestedAlignment = int(Kernel::AssignmentTraits::InnerRequiredAlignment),
518  alignable =
519  packet_traits<Scalar>::AlignedOnScalar || int(Kernel::AssignmentTraits::DstAlignment) >= sizeof(Scalar),
520  dstIsAligned = int(Kernel::AssignmentTraits::DstAlignment) >= int(requestedAlignment),
521  dstAlignment = alignable ? int(requestedAlignment) : int(Kernel::AssignmentTraits::DstAlignment)
522  };
523  const Scalar* dst_ptr = kernel.dstDataPtr();
524  if ((!bool(dstIsAligned)) && (std::uintptr_t(dst_ptr) % sizeof(Scalar)) > 0) {
525  // the pointer is not aligned-on scalar, so alignment is not possible
527  }
528  const Index packetAlignedMask = packetSize - 1;
529  const Index innerSize = kernel.innerSize();
530  const Index outerSize = kernel.outerSize();
531  const Index alignedStep = alignable ? (packetSize - kernel.outerStride() % packetSize) & packetAlignedMask : 0;
532  Index alignedStart =
533  ((!alignable) || bool(dstIsAligned)) ? 0 : internal::first_aligned<requestedAlignment>(dst_ptr, innerSize);
534 
535  for (Index outer = 0; outer < outerSize; ++outer) {
536  const Index alignedEnd = alignedStart + ((innerSize - alignedStart) & ~packetAlignedMask);
537  // do the non-vectorizable part of the assignment
538  for (Index inner = 0; inner < alignedStart; ++inner) kernel.assignCoeffByOuterInner(outer, inner);
539 
540  // do the vectorizable part of the assignment
541  for (Index inner = alignedStart; inner < alignedEnd; inner += packetSize)
542  kernel.template assignPacketByOuterInner<dstAlignment, Unaligned, PacketType>(outer, inner);
543 
544  // do the non-vectorizable part of the assignment
545  for (Index inner = alignedEnd; inner < innerSize; ++inner) kernel.assignCoeffByOuterInner(outer, inner);
546 
547  alignedStart = numext::mini((alignedStart + alignedStep) % packetSize, innerSize);
548  }
549  }
550 };
551 
552 #if EIGEN_UNALIGNED_VECTORIZE
553 template <typename Kernel>
554 struct dense_assignment_loop<Kernel, SliceVectorizedTraversal, InnerUnrolling> {
556  typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
557  typedef typename Kernel::PacketType PacketType;
558 
559  enum {
560  innerSize = DstXprType::InnerSizeAtCompileTime,
562  vectorizableSize = (int(innerSize) / int(packetSize)) * int(packetSize),
563  size = DstXprType::SizeAtCompileTime
564  };
565 
566  for (Index outer = 0; outer < kernel.outerSize(); ++outer) {
569  }
570  }
571 };
572 #endif
573 
574 /***************************************************************************
575  * Part 4 : Generic dense assignment kernel
576  ***************************************************************************/
577 
578 // This class generalize the assignment of a coefficient (or packet) from one dense evaluator
579 // to another dense writable evaluator.
580 // It is parametrized by the two evaluators, and the actual assignment functor.
581 // This abstraction level permits to keep the evaluation loops as simple and as generic as possible.
582 // One can customize the assignment using this generic dense_assignment_kernel with different
583 // functors, or by completely overloading it, by-passing a functor.
584 template <typename DstEvaluatorTypeT, typename SrcEvaluatorTypeT, typename Functor, int Version = Specialized>
586  protected:
589 
590  public:
591  typedef DstEvaluatorTypeT DstEvaluatorType;
592  typedef SrcEvaluatorTypeT SrcEvaluatorType;
596 
598  const SrcEvaluatorType& src,
599  const Functor& func, DstXprType& dstExpr)
600  : m_dst(dst), m_src(src), m_functor(func), m_dstExpr(dstExpr) {
601 #ifdef EIGEN_DEBUG_ASSIGN
602  AssignmentTraits::debug();
603 #endif
604  }
605 
606  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT { return m_dstExpr.size(); }
607  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerSize() const EIGEN_NOEXCEPT { return m_dstExpr.innerSize(); }
608  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerSize() const EIGEN_NOEXCEPT { return m_dstExpr.outerSize(); }
609  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_dstExpr.rows(); }
610  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_dstExpr.cols(); }
611  EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT { return m_dstExpr.outerStride(); }
612 
615 
618  m_functor.assignCoeff(m_dst.coeffRef(row, col), m_src.coeff(row, col));
619  }
620 
623  m_functor.assignCoeff(m_dst.coeffRef(index), m_src.coeff(index));
624  }
625 
628  Index row = rowIndexByOuterInner(outer, inner);
629  Index col = colIndexByOuterInner(outer, inner);
630  assignCoeff(row, col);
631  }
632 
633  template <int StoreMode, int LoadMode, typename Packet>
635  m_functor.template assignPacket<StoreMode>(&m_dst.coeffRef(row, col),
636  m_src.template packet<LoadMode, Packet>(row, col));
637  }
638 
639  template <int StoreMode, int LoadMode, typename Packet>
641  m_functor.template assignPacket<StoreMode>(&m_dst.coeffRef(index), m_src.template packet<LoadMode, Packet>(index));
642  }
643 
644  template <int StoreMode, int LoadMode, typename Packet>
646  Index row = rowIndexByOuterInner(outer, inner);
647  Index col = colIndexByOuterInner(outer, inner);
648  assignPacket<StoreMode, LoadMode, Packet>(row, col);
649  }
650 
652  typedef typename DstEvaluatorType::ExpressionTraits Traits;
653  return int(Traits::RowsAtCompileTime) == 1 ? 0
654  : int(Traits::ColsAtCompileTime) == 1 ? inner
655  : int(DstEvaluatorType::Flags) & RowMajorBit ? outer
656  : inner;
657  }
658 
660  typedef typename DstEvaluatorType::ExpressionTraits Traits;
661  return int(Traits::ColsAtCompileTime) == 1 ? 0
662  : int(Traits::RowsAtCompileTime) == 1 ? inner
663  : int(DstEvaluatorType::Flags) & RowMajorBit ? inner
664  : outer;
665  }
666 
667  EIGEN_DEVICE_FUNC const Scalar* dstDataPtr() const { return m_dstExpr.data(); }
668 
669  protected:
673  // TODO find a way to avoid the needs of the original expression
675 };
676 
677 // Special kernel used when computing small products whose operands have dynamic dimensions. It ensures that the
678 // PacketSize used is no larger than 4, thereby increasing the chance that vectorized instructions will be used
679 // when computing the product.
680 
681 template <typename DstEvaluatorTypeT, typename SrcEvaluatorTypeT, typename Functor>
683  : public generic_dense_assignment_kernel<DstEvaluatorTypeT, SrcEvaluatorTypeT, Functor, BuiltIn> {
684  protected:
686 
687  public:
688  typedef typename Base::Scalar Scalar;
689  typedef typename Base::DstXprType DstXprType;
692 
693  EIGEN_DEVICE_FUNC restricted_packet_dense_assignment_kernel(DstEvaluatorTypeT& dst, const SrcEvaluatorTypeT& src,
694  const Functor& func, DstXprType& dstExpr)
695  : Base(dst, src, func, dstExpr) {}
696 };
697 
698 /***************************************************************************
699  * Part 5 : Entry point for dense rectangular assignment
700  ***************************************************************************/
701 
702 template <typename DstXprType, typename SrcXprType, typename Functor>
703 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize_if_allowed(DstXprType& dst, const SrcXprType& src,
704  const Functor& /*func*/) {
707  eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
708 }
709 
710 template <typename DstXprType, typename SrcXprType, typename T1, typename T2>
711 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize_if_allowed(DstXprType& dst, const SrcXprType& src,
712  const internal::assign_op<T1, T2>& /*func*/) {
713  Index dstRows = src.rows();
714  Index dstCols = src.cols();
715  if (((dst.rows() != dstRows) || (dst.cols() != dstCols))) dst.resize(dstRows, dstCols);
716  eigen_assert(dst.rows() == dstRows && dst.cols() == dstCols);
717 }
718 
719 template <typename DstXprType, typename SrcXprType, typename Functor>
721  const SrcXprType& src,
722  const Functor& func) {
723  typedef evaluator<DstXprType> DstEvaluatorType;
724  typedef evaluator<SrcXprType> SrcEvaluatorType;
725 
726  SrcEvaluatorType srcEvaluator(src);
727 
728  // NOTE To properly handle A = (A*A.transpose())/s with A rectangular,
729  // we need to resize the destination after the source evaluator has been created.
730  resize_if_allowed(dst, src, func);
731 
732  DstEvaluatorType dstEvaluator(dst);
733 
735  Kernel kernel(dstEvaluator, srcEvaluator, func, dst.const_cast_derived());
736 
738 }
739 
740 template <typename DstXprType, typename SrcXprType>
741 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_dense_assignment_loop(DstXprType& dst, const SrcXprType& src) {
743 }
744 
745 /***************************************************************************
746  * Part 6 : Generic assignment
747  ***************************************************************************/
748 
749 // Based on the respective shapes of the destination and source,
750 // the class AssignmentKind determine the kind of assignment mechanism.
751 // AssignmentKind must define a Kind typedef.
752 template <typename DstShape, typename SrcShape>
753 struct AssignmentKind;
754 
755 // Assignment kind defined in this file:
756 struct Dense2Dense {};
758 
759 template <typename, typename>
762 };
763 template <>
765  typedef Dense2Dense Kind;
766 };
767 
768 // This is the main assignment class
769 template <typename DstXprType, typename SrcXprType, typename Functor,
771  typename evaluator_traits<SrcXprType>::Shape>::Kind,
772  typename EnableIf = void>
773 struct Assignment;
774 
775 // The only purpose of this call_assignment() function is to deal with noalias() / "assume-aliasing" and automatic
776 // transposition. Indeed, I (Gael) think that this concept of "assume-aliasing" was a mistake, and it makes thing quite
777 // complicated. So this intermediate function removes everything related to "assume-aliasing" such that Assignment does
778 // not has to bother about these annoying details.
779 
780 template <typename Dst, typename Src>
783 }
784 template <typename Dst, typename Src>
785 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(const Dst& dst, const Src& src) {
787 }
788 
789 // Deal with "assume-aliasing"
790 template <typename Dst, typename Src, typename Func>
792  Dst& dst, const Src& src, const Func& func, std::enable_if_t<evaluator_assume_aliasing<Src>::value, void*> = 0) {
793  typename plain_matrix_type<Src>::type tmp(src);
795 }
796 
797 template <typename Dst, typename Src, typename Func>
799  Dst& dst, const Src& src, const Func& func, std::enable_if_t<!evaluator_assume_aliasing<Src>::value, void*> = 0) {
800  call_assignment_no_alias(dst, src, func);
801 }
802 
803 // by-pass "assume-aliasing"
804 // When there is no aliasing, we require that 'dst' has been properly resized
805 template <typename Dst, template <typename> class StorageBase, typename Src, typename Func>
807  const Src& src, const Func& func) {
809 }
810 
811 template <typename Dst, typename Src, typename Func>
813  const Func& func) {
814  enum {
815  NeedToTranspose = ((int(Dst::RowsAtCompileTime) == 1 && int(Src::ColsAtCompileTime) == 1) ||
816  (int(Dst::ColsAtCompileTime) == 1 && int(Src::RowsAtCompileTime) == 1)) &&
817  int(Dst::SizeAtCompileTime) != 1
818  };
819 
820  typedef std::conditional_t<NeedToTranspose, Transpose<Dst>, Dst> ActualDstTypeCleaned;
821  typedef std::conditional_t<NeedToTranspose, Transpose<Dst>, Dst&> ActualDstType;
822  ActualDstType actualDst(dst);
823 
824  // TODO check whether this is the right place to perform these checks:
826  EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(ActualDstTypeCleaned, Src)
828 
830 }
831 
832 template <typename Dst, typename Src, typename Func>
834  const Func& func) {
835  typedef evaluator<Dst> DstEvaluatorType;
836  typedef evaluator<Src> SrcEvaluatorType;
838 
840  EIGEN_CHECK_BINARY_COMPATIBILIY(Func, typename Dst::Scalar, typename Src::Scalar);
841 
842  SrcEvaluatorType srcEvaluator(src);
843  resize_if_allowed(dst, src, func);
844 
845  DstEvaluatorType dstEvaluator(dst);
846  Kernel kernel(dstEvaluator, srcEvaluator, func, dst.const_cast_derived());
847 
849 }
850 
851 template <typename Dst, typename Src>
854 }
855 
856 template <typename Dst, typename Src, typename Func>
858  const Src& src,
859  const Func& func) {
860  // TODO check whether this is the right place to perform these checks:
863  EIGEN_CHECK_BINARY_COMPATIBILIY(Func, typename Dst::Scalar, typename Src::Scalar);
864 
866 }
867 template <typename Dst, typename Src>
869  const Src& src) {
871 }
872 
873 // forward declaration
874 template <typename Dst, typename Src>
875 EIGEN_DEVICE_FUNC void check_for_aliasing(const Dst& dst, const Src& src);
876 
877 // Generic Dense to Dense assignment
878 // Note that the last template argument "Weak" is needed to make it possible to perform
879 // both partial specialization+SFINAE without ambiguous specialization
880 template <typename DstXprType, typename SrcXprType, typename Functor, typename Weak>
881 struct Assignment<DstXprType, SrcXprType, Functor, Dense2Dense, Weak> {
882  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(DstXprType& dst, const SrcXprType& src, const Functor& func) {
883 #ifndef EIGEN_NO_DEBUG
885 #endif
886 
887  call_dense_assignment_loop(dst, src, func);
888  }
889 };
890 
891 template <typename DstXprType, typename SrcPlainObject, typename Weak>
892 struct Assignment<DstXprType, CwiseNullaryOp<scalar_constant_op<typename DstXprType::Scalar>, SrcPlainObject>,
893  assign_op<typename DstXprType::Scalar, typename DstXprType::Scalar>, Dense2Dense, Weak> {
894  using Scalar = typename DstXprType::Scalar;
898  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(DstXprType& dst, const SrcXprType& src,
899  const Functor& /*func*/) {
901  }
902 };
903 
904 template <typename DstXprType, typename SrcPlainObject, typename Weak>
905 struct Assignment<DstXprType, CwiseNullaryOp<scalar_zero_op<typename DstXprType::Scalar>, SrcPlainObject>,
906  assign_op<typename DstXprType::Scalar, typename DstXprType::Scalar>, Dense2Dense, Weak> {
907  using Scalar = typename DstXprType::Scalar;
911  EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(DstXprType& dst, const SrcXprType& src,
912  const Functor& /*func*/) {
914  }
915 };
916 
917 // Generic assignment through evalTo.
918 // TODO: not sure we have to keep that one, but it helps porting current code to new evaluator mechanism.
919 // Note that the last template argument "Weak" is needed to make it possible to perform
920 // both partial specialization+SFINAE without ambiguous specialization
921 template <typename DstXprType, typename SrcXprType, typename Functor, typename Weak>
922 struct Assignment<DstXprType, SrcXprType, Functor, EigenBase2EigenBase, Weak> {
924  DstXprType& dst, const SrcXprType& src,
926  Index dstRows = src.rows();
927  Index dstCols = src.cols();
928  if ((dst.rows() != dstRows) || (dst.cols() != dstCols)) dst.resize(dstRows, dstCols);
929 
930  eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
931  src.evalTo(dst);
932  }
933 
934  // NOTE The following two functions are templated to avoid their instantiation if not needed
935  // This is needed because some expressions supports evalTo only and/or have 'void' as scalar type.
936  template <typename SrcScalarType>
938  DstXprType& dst, const SrcXprType& src,
940  Index dstRows = src.rows();
941  Index dstCols = src.cols();
942  if ((dst.rows() != dstRows) || (dst.cols() != dstCols)) dst.resize(dstRows, dstCols);
943 
944  eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
945  src.addTo(dst);
946  }
947 
948  template <typename SrcScalarType>
950  DstXprType& dst, const SrcXprType& src,
952  Index dstRows = src.rows();
953  Index dstCols = src.cols();
954  if ((dst.rows() != dstRows) || (dst.cols() != dstCols)) dst.resize(dstRows, dstCols);
955 
956  eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols());
957  src.subTo(dst);
958  }
959 };
960 
961 } // namespace internal
962 
963 } // end namespace Eigen
964 
965 #endif // EIGEN_ASSIGN_EVALUATOR_H
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_UNALIGNED_VECTORIZE
Definition: ConfigureVectorization.h:173
#define EIGEN_NOEXCEPT
Definition: Macros.h:1267
#define EIGEN_DEBUG_VAR(x)
Definition: Macros.h:815
#define EIGEN_CONSTEXPR
Definition: Macros.h:758
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define EIGEN_DONT_INLINE
Definition: Macros.h:853
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition: Macros.h:922
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
m col(1)
m row(1)
#define EIGEN_UNROLLING_LIMIT
Definition: Settings.h:23
#define EIGEN_STATIC_ASSERT_LVALUE(Derived)
Definition: StaticAssert.h:87
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
#define EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(TYPE0, TYPE1)
Definition: StaticAssert.h:79
#define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP, LHS, RHS)
Definition: XprHelper.h:1082
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:64
Pseudo expression providing an operator = assuming no aliasing.
Definition: NoAlias.h:34
EIGEN_DEVICE_FUNC ExpressionType & expression() const
Definition: NoAlias.h:61
Convenience specialization of Stride to specify only an outer stride See class Map for some examples.
Definition: Stride.h:104
Definition: AssignEvaluator.h:585
DstXprType & m_dstExpr
Definition: AssignEvaluator.h:674
EIGEN_DEVICE_FUNC const Scalar * dstDataPtr() const
Definition: AssignEvaluator.h:667
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignPacket(Index index)
Definition: AssignEvaluator.h:640
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
Definition: AssignEvaluator.h:606
EIGEN_DEVICE_FUNC DstEvaluatorType & dstEvaluator() EIGEN_NOEXCEPT
Definition: AssignEvaluator.h:613
const SrcEvaluatorType & m_src
Definition: AssignEvaluator.h:671
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE generic_dense_assignment_kernel(DstEvaluatorType &dst, const SrcEvaluatorType &src, const Functor &func, DstXprType &dstExpr)
Definition: AssignEvaluator.h:597
DstEvaluatorTypeT DstEvaluatorType
Definition: AssignEvaluator.h:591
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: AssignEvaluator.h:609
AssignmentTraits::PacketType PacketType
Definition: AssignEvaluator.h:595
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: AssignEvaluator.h:610
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(Index row, Index col)
Assign src(row,col) to dst(row,col) through the assignment functor.
Definition: AssignEvaluator.h:617
SrcEvaluatorTypeT SrcEvaluatorType
Definition: AssignEvaluator.h:592
DstEvaluatorType & m_dst
Definition: AssignEvaluator.h:670
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerSize() const EIGEN_NOEXCEPT
Definition: AssignEvaluator.h:608
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignPacketByOuterInner(Index outer, Index inner)
Definition: AssignEvaluator.h:645
const Functor & m_functor
Definition: AssignEvaluator.h:672
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(Index index)
Definition: AssignEvaluator.h:622
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT
Definition: AssignEvaluator.h:611
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index innerSize() const EIGEN_NOEXCEPT
Definition: AssignEvaluator.h:607
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignPacket(Index row, Index col)
Definition: AssignEvaluator.h:634
copy_using_evaluator_traits< DstEvaluatorTypeT, SrcEvaluatorTypeT, Functor > AssignmentTraits
Definition: AssignEvaluator.h:594
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rowIndexByOuterInner(Index outer, Index inner)
Definition: AssignEvaluator.h:651
EIGEN_DEVICE_FUNC const SrcEvaluatorType & srcEvaluator() const EIGEN_NOEXCEPT
Definition: AssignEvaluator.h:614
SrcEvaluatorTypeT::XprType SrcXprType
Definition: AssignEvaluator.h:588
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index colIndexByOuterInner(Index outer, Index inner)
Definition: AssignEvaluator.h:659
DstEvaluatorTypeT::XprType DstXprType
Definition: AssignEvaluator.h:587
DstEvaluatorType::Scalar Scalar
Definition: AssignEvaluator.h:593
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeffByOuterInner(Index outer, Index inner)
Definition: AssignEvaluator.h:627
Base::DstXprType DstXprType
Definition: AssignEvaluator.h:689
EIGEN_DEVICE_FUNC restricted_packet_dense_assignment_kernel(DstEvaluatorTypeT &dst, const SrcEvaluatorTypeT &src, const Functor &func, DstXprType &dstExpr)
Definition: AssignEvaluator.h:693
generic_dense_assignment_kernel< DstEvaluatorTypeT, SrcEvaluatorTypeT, Functor, BuiltIn > Base
Definition: AssignEvaluator.h:685
AssignmentTraits::PacketType PacketType
Definition: AssignEvaluator.h:691
copy_using_evaluator_traits< DstEvaluatorTypeT, SrcEvaluatorTypeT, Functor, 4 > AssignmentTraits
Definition: AssignEvaluator.h:690
Base::Scalar Scalar
Definition: AssignEvaluator.h:688
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79
@ InnerVectorizedTraversal
Definition: Constants.h:284
@ LinearVectorizedTraversal
Definition: Constants.h:287
@ DefaultTraversal
Definition: Constants.h:279
@ SliceVectorizedTraversal
Definition: Constants.h:290
@ LinearTraversal
Definition: Constants.h:281
@ AllAtOnceTraversal
Definition: Constants.h:294
@ InnerUnrolling
Definition: Constants.h:303
@ CompleteUnrolling
Definition: Constants.h:306
@ NoUnrolling
Definition: Constants.h:301
const unsigned int LinearAccessBit
Definition: Constants.h:133
const unsigned int DirectAccessBit
Definition: Constants.h:159
const unsigned int RowMajorBit
Definition: Constants.h:70
return int(ret)+1
Eigen::DenseIndex ret
Definition: level1_cplx_impl.h:43
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_restricted_packet_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
Definition: AssignEvaluator.h:833
constexpr int plain_enum_min(A a, B b)
Definition: Meta.h:649
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize_if_allowed(DstXprType &dst, const SrcXprType &src, const Functor &)
Definition: AssignEvaluator.h:703
constexpr int min_size_prefer_fixed(A a, B b)
Definition: Meta.h:683
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(Dst &dst, const Src &src)
Definition: AssignEvaluator.h:781
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
Definition: AssignEvaluator.h:812
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_dense_assignment_loop(DstXprType &dst, const SrcXprType &src, const Functor &func)
Definition: AssignEvaluator.h:720
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias_no_transpose(Dst &dst, const Src &src, const Func &func)
Definition: AssignEvaluator.h:857
EIGEN_DEVICE_FUNC void check_for_aliasing(const Dst &dst, const Src &src)
Definition: Transpose.h:416
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition: MathFunctions.h:920
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
const unsigned int ActualPacketAccessBit
Definition: Constants.h:110
auto run(Kernel kernel, Args &&... args) -> decltype(kernel(args...))
Definition: gpu_test_helper.h:414
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
const int Dynamic
Definition: Constants.h:25
Definition: Eigen_Colamd.h:49
void start(const unsigned &i)
(Re-)start i-th timer
Definition: oomph_utilities.cc:243
string name
Definition: plotDoE.py:33
CwiseBinaryOp< internal::scalar_sum_op< double, double >, const CpyMatrixXd, const CpyMatrixXd > XprType
Definition: nestbyvalue.cpp:15
Definition: Constants.h:540
Dense2Dense Kind
Definition: AssignEvaluator.h:765
Definition: AssignEvaluator.h:760
EigenBase2EigenBase Kind
Definition: AssignEvaluator.h:761
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const Functor &func)
Definition: AssignEvaluator.h:882
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const internal::sub_assign_op< typename DstXprType::Scalar, SrcScalarType > &)
Definition: AssignEvaluator.h:949
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const internal::add_assign_op< typename DstXprType::Scalar, SrcScalarType > &)
Definition: AssignEvaluator.h:937
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op< typename DstXprType::Scalar, typename SrcXprType::Scalar > &)
Definition: AssignEvaluator.h:923
Definition: AssignEvaluator.h:773
Definition: AssignEvaluator.h:756
Definition: AssignEvaluator.h:757
Definition: ForwardDeclarations.h:221
Template functor for scalar/packet assignment with addition.
Definition: AssignmentFunctors.h:52
Template functor for scalar/packet assignment.
Definition: AssignmentFunctors.h:25
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &)
Definition: AssignEvaluator.h:215
DstEvaluatorType::XprType DstXprType
Definition: AssignEvaluator.h:203
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &kernel)
Definition: AssignEvaluator.h:207
Kernel::DstEvaluatorType DstEvaluatorType
Definition: AssignEvaluator.h:202
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &, Index)
Definition: AssignEvaluator.h:228
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &kernel, Index outer)
Definition: AssignEvaluator.h:220
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &)
Definition: AssignEvaluator.h:245
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &kernel)
Definition: AssignEvaluator.h:237
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &)
Definition: AssignEvaluator.h:275
Kernel::PacketType PacketType
Definition: AssignEvaluator.h:257
Kernel::DstEvaluatorType DstEvaluatorType
Definition: AssignEvaluator.h:255
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &kernel)
Definition: AssignEvaluator.h:266
DstEvaluatorType::XprType DstXprType
Definition: AssignEvaluator.h:256
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &, Index)
Definition: AssignEvaluator.h:291
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &kernel, Index outer)
Definition: AssignEvaluator.h:281
Kernel::PacketType PacketType
Definition: AssignEvaluator.h:280
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &)
Definition: AssignEvaluator.h:401
Kernel::DstEvaluatorType DstEvaluatorType
Definition: AssignEvaluator.h:386
Kernel::PacketType PacketType
Definition: AssignEvaluator.h:388
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &kernel)
Definition: AssignEvaluator.h:392
DstEvaluatorType::XprType DstXprType
Definition: AssignEvaluator.h:387
Definition: AssignEvaluator.h:31
@ Unrolling
Definition: AssignEvaluator.h:132
find_best_packet< DstScalar, RestrictedLinearSize >::type LinearPacketType
Definition: AssignEvaluator.h:60
find_best_packet< DstScalar, RestrictedInnerSize >::type InnerPacketType
Definition: AssignEvaluator.h:61
std::conditional_t< int(Traversal)==LinearVectorizedTraversal, LinearPacketType, InnerPacketType > PacketType
Definition: AssignEvaluator.h:113
@ SrcAlignment
Definition: AssignEvaluator.h:40
@ JointAlignment
Definition: AssignEvaluator.h:42
@ DstAlignment
Definition: AssignEvaluator.h:39
@ DstHasDirectAccess
Definition: AssignEvaluator.h:41
@ SrcFlags
Definition: AssignEvaluator.h:35
@ DstFlags
Definition: AssignEvaluator.h:35
DstEvaluator::XprType Dst
Definition: AssignEvaluator.h:32
@ InnerRequiredAlignment
Definition: AssignEvaluator.h:71
@ LinearRequiredAlignment
Definition: AssignEvaluator.h:70
@ InnerPacketSize
Definition: AssignEvaluator.h:65
@ LinearPacketSize
Definition: AssignEvaluator.h:64
@ Vectorized
Definition: AssignEvaluator.h:109
@ Traversal
Definition: AssignEvaluator.h:101
@ InnerSize
Definition: AssignEvaluator.h:47
@ MaxSizeAtCompileTime
Definition: AssignEvaluator.h:56
@ InnerMaxSize
Definition: AssignEvaluator.h:50
@ RestrictedLinearSize
Definition: AssignEvaluator.h:54
@ RestrictedInnerSize
Definition: AssignEvaluator.h:53
@ MightVectorize
Definition: AssignEvaluator.h:79
@ MayLinearVectorize
Definition: AssignEvaluator.h:85
@ MayLinearize
Definition: AssignEvaluator.h:84
@ MayInnerVectorize
Definition: AssignEvaluator.h:81
@ SrcIsRowMajor
Definition: AssignEvaluator.h:77
@ MaySliceVectorize
Definition: AssignEvaluator.h:90
@ DstIsRowMajor
Definition: AssignEvaluator.h:76
@ StorageOrdersAgree
Definition: AssignEvaluator.h:78
Dst::Scalar DstScalar
Definition: AssignEvaluator.h:33
@ ActualPacketSize
Definition: AssignEvaluator.h:117
@ UnrollingLimit
Definition: AssignEvaluator.h:120
static EIGEN_DEVICE_FUNC void EIGEN_STRONG_INLINE EIGEN_CONSTEXPR run(Kernel &)
Definition: AssignEvaluator.h:311
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &kernel)
Definition: AssignEvaluator.h:334
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &kernel)
Definition: AssignEvaluator.h:342
static EIGEN_DEVICE_FUNC void EIGEN_STRONG_INLINE run(Kernel &kernel)
Definition: AssignEvaluator.h:323
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &kernel)
Definition: AssignEvaluator.h:468
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Kernel &kernel)
Definition: AssignEvaluator.h:476
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel)
Definition: AssignEvaluator.h:456
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel)
Definition: AssignEvaluator.h:500
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel)
Definition: AssignEvaluator.h:492
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel)
Definition: AssignEvaluator.h:433
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel)
Definition: AssignEvaluator.h:406
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel)
Definition: AssignEvaluator.h:512
Definition: AssignEvaluator.h:302
Definition: CoreEvaluators.h:98
storage_kind_to_shape< typename traits< T >::StorageKind >::Shape Shape
Definition: CoreEvaluators.h:90
Definition: CoreEvaluators.h:104
find_best_packet_helper< Size, typename packet_traits< T >::type >::type type
Definition: XprHelper.h:290
Definition: XprHelper.h:205
Definition: DenseCoeffsBase.h:556
Definition: GenericPacketMath.h:108
Definition: XprHelper.h:389
Definition: NullaryFunctors.h:21
Definition: NullaryFunctors.h:40
Template functor for scalar/packet assignment with subtraction.
Definition: AssignmentFunctors.h:73
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &kernel, Index start, Index end)
Definition: AssignEvaluator.h:376
Definition: AssignEvaluator.h:360
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void run(Kernel &, Index, Index)
Definition: AssignEvaluator.h:363
Definition: GenericPacketMath.h:134
@ size
Definition: GenericPacketMath.h:139
Definition: NonLinearOptimization.cpp:97
Definition: benchGeometry.cpp:21
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