Reference documentation for deal.II version Git 4abc4a1666 2020-07-04 19:58:34 +0200
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
aligned_vector.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2011 - 2020 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 
17 #ifndef dealii_aligned_vector_h
18 #define dealii_aligned_vector_h
19 
20 #include <deal.II/base/config.h>
21 
24 #include <deal.II/base/parallel.h>
25 #include <deal.II/base/utilities.h>
26 
27 // boost::serialization::make_array used to be in array.hpp, but was
28 // moved to a different file in BOOST 1.64
29 #include <boost/version.hpp>
30 #if BOOST_VERSION >= 106400
31 # include <boost/serialization/array_wrapper.hpp>
32 #else
33 # include <boost/serialization/array.hpp>
34 #endif
35 #include <boost/serialization/split_member.hpp>
36 
37 #include <cstring>
38 #include <type_traits>
39 
40 
41 
43 
44 
60 template <class T>
62 {
63 public:
68  using value_type = T;
69  using pointer = value_type *;
70  using const_pointer = const value_type *;
71  using iterator = value_type *;
72  using const_iterator = const value_type *;
73  using reference = value_type &;
74  using const_reference = const value_type &;
75  using size_type = std::size_t;
76 
80  AlignedVector();
81 
88  AlignedVector(const size_type size, const T &init = T());
89 
94 
100  AlignedVector(const AlignedVector<T> &vec);
101 
106  AlignedVector(AlignedVector<T> &&vec) noexcept;
107 
113  AlignedVector &
114  operator=(const AlignedVector<T> &vec);
115 
119  AlignedVector &
120  operator=(AlignedVector<T> &&vec) noexcept;
121 
130  void
131  resize_fast(const size_type size);
132 
145  void
146  resize(const size_type size_in);
147 
163  void
164  resize(const size_type size_in, const T &init);
165 
174  void
175  reserve(const size_type size_alloc);
176 
181  void
182  clear();
183 
189  void
190  push_back(const T in_data);
191 
195  reference
196  back();
197 
202  back() const;
203 
208  template <typename ForwardIterator>
209  void
210  insert_back(ForwardIterator begin, ForwardIterator end);
211 
221  void
222  fill();
223 
232  void
233  fill(const T &element);
234 
238  void
239  swap(AlignedVector<T> &vec);
240 
244  bool
245  empty() const;
246 
250  size_type
251  size() const;
252 
257  size_type
258  capacity() const;
259 
263  reference operator[](const size_type index);
264 
268  const_reference operator[](const size_type index) const;
269 
273  pointer
274  data();
275 
280  data() const;
281 
285  iterator
286  begin();
287 
291  iterator
292  end();
293 
298  begin() const;
299 
304  end() const;
305 
311  size_type
312  memory_consumption() const;
313 
318  template <class Archive>
319  void
320  save(Archive &ar, const unsigned int version) const;
321 
326  template <class Archive>
327  void
328  load(Archive &ar, const unsigned int version);
329 
330 #ifdef DOXYGEN
331 
335  template <class Archive>
336  void
337  serialize(Archive &archive, const unsigned int version);
338 #else
339  // This macro defines the serialize() method that is compatible with
340  // the templated save() and load() method that have been implemented.
341  BOOST_SERIALIZATION_SPLIT_MEMBER()
342 #endif
343 
344 private:
349 
354 
359 };
360 
361 
362 // ------------------------------- inline functions --------------------------
363 
369 namespace internal
370 {
386  template <typename T>
388  {
389  static const std::size_t minimum_parallel_grain_size =
390  160000 / sizeof(T) + 1;
391 
392  public:
402  AlignedVectorCopy(const T *const source_begin,
403  const T *const source_end,
404  T *const destination)
405  : source_(source_begin)
406  , destination_(destination)
407  {
408  Assert(source_end >= source_begin, ExcInternalError());
409  Assert(source_end == source_begin || destination != nullptr,
410  ExcInternalError());
411  const std::size_t size = source_end - source_begin;
412  if (size < minimum_parallel_grain_size)
413  AlignedVectorCopy::apply_to_subrange(0, size);
414  else
415  apply_parallel(0, size, minimum_parallel_grain_size);
416  }
417 
422  virtual void
423  apply_to_subrange(const std::size_t begin,
424  const std::size_t end) const override
425  {
426  if (end == begin)
427  return;
428 
429  // for classes trivial assignment can use memcpy. cast element to
430  // (void*) to silence compiler warning for virtual classes (they will
431  // never arrive here because they are non-trivial).
432 
433  if (std::is_trivial<T>::value == true)
434  std::memcpy(static_cast<void *>(destination_ + begin),
435  static_cast<const void *>(source_ + begin),
436  (end - begin) * sizeof(T));
437  else
438  for (std::size_t i = begin; i < end; ++i)
439  new (&destination_[i]) T(source_[i]);
440  }
441 
442  private:
443  const T *const source_;
444  T *const destination_;
445  };
446 
447 
453  template <typename T>
455  {
456  static const std::size_t minimum_parallel_grain_size =
457  160000 / sizeof(T) + 1;
458 
459  public:
469  AlignedVectorMove(T *const source_begin,
470  T *const source_end,
471  T *const destination)
472  : source_(source_begin)
473  , destination_(destination)
474  {
475  Assert(source_end >= source_begin, ExcInternalError());
476  Assert(source_end == source_begin || destination != nullptr,
477  ExcInternalError());
478  const std::size_t size = source_end - source_begin;
479  if (size < minimum_parallel_grain_size)
480  AlignedVectorMove::apply_to_subrange(0, size);
481  else
482  apply_parallel(0, size, minimum_parallel_grain_size);
483  }
484 
489  virtual void
490  apply_to_subrange(const std::size_t begin,
491  const std::size_t end) const override
492  {
493  if (end == begin)
494  return;
495 
496  // for classes trivial assignment can use memcpy. cast element to
497  // (void*) to silence compiler warning for virtual classes (they will
498  // never arrive here because they are non-trivial).
499 
500  if (std::is_trivial<T>::value == true)
501  std::memcpy(static_cast<void *>(destination_ + begin),
502  static_cast<void *>(source_ + begin),
503  (end - begin) * sizeof(T));
504  else
505  for (std::size_t i = begin; i < end; ++i)
506  {
507  // initialize memory (copy construct by placement new), and
508  // destruct the source
509  new (&destination_[i]) T(std::move(source_[i]));
510  source_[i].~T();
511  }
512  }
513 
514  private:
515  T *const source_;
516  T *const destination_;
517  };
518 
519 
531  template <typename T, bool initialize_memory>
533  {
534  static const std::size_t minimum_parallel_grain_size =
535  160000 / sizeof(T) + 1;
536 
537  public:
542  AlignedVectorSet(const std::size_t size,
543  const T & element,
544  T *const destination)
545  : element_(element)
546  , destination_(destination)
547  , trivial_element(false)
548  {
549  if (size == 0)
550  return;
551  Assert(destination != nullptr, ExcInternalError());
552 
553  // do not use memcmp for long double because on some systems it does not
554  // completely fill its memory and may lead to false positives in
555  // e.g. valgrind
556  if (std::is_trivial<T>::value == true &&
557  std::is_same<T, long double>::value == false)
558  {
559  const unsigned char zero[sizeof(T)] = {};
560  // cast element to (void*) to silence compiler warning for virtual
561  // classes (they will never arrive here because they are
562  // non-trivial).
563  if (std::memcmp(zero,
564  static_cast<const void *>(&element),
565  sizeof(T)) == 0)
566  trivial_element = true;
567  }
568  if (size < minimum_parallel_grain_size)
569  AlignedVectorSet::apply_to_subrange(0, size);
570  else
571  apply_parallel(0, size, minimum_parallel_grain_size);
572  }
573 
577  virtual void
578  apply_to_subrange(const std::size_t begin,
579  const std::size_t end) const override
580  {
581  // for classes with trivial assignment of zero can use memset. cast
582  // element to (void*) to silence compiler warning for virtual
583  // classes (they will never arrive here because they are
584  // non-trivial).
585  if (std::is_trivial<T>::value == true && trivial_element)
586  std::memset(static_cast<void *>(destination_ + begin),
587  0,
588  (end - begin) * sizeof(T));
589  else
590  copy_construct_or_assign(
591  begin, end, std::integral_constant<bool, initialize_memory>());
592  }
593 
594  private:
595  const T & element_;
596  mutable T *destination_;
598 
599  // copy assignment operation
600  void
601  copy_construct_or_assign(const std::size_t begin,
602  const std::size_t end,
603  std::integral_constant<bool, false>) const
604  {
605  for (std::size_t i = begin; i < end; ++i)
606  destination_[i] = element_;
607  }
608 
609  // copy constructor (memory initialization)
610  void
611  copy_construct_or_assign(const std::size_t begin,
612  const std::size_t end,
613  std::integral_constant<bool, true>) const
614  {
615  for (std::size_t i = begin; i < end; ++i)
616  new (&destination_[i]) T(element_);
617  }
618  };
619 
620 
621 
633  template <typename T, bool initialize_memory>
635  {
636  static const std::size_t minimum_parallel_grain_size =
637  160000 / sizeof(T) + 1;
638 
639  public:
644  AlignedVectorDefaultInitialize(const std::size_t size, T *const destination)
645  : destination_(destination)
646  {
647  if (size == 0)
648  return;
649  Assert(destination != nullptr, ExcInternalError());
650 
651  if (size < minimum_parallel_grain_size)
652  AlignedVectorDefaultInitialize::apply_to_subrange(0, size);
653  else
654  apply_parallel(0, size, minimum_parallel_grain_size);
655  }
656 
660  virtual void
661  apply_to_subrange(const std::size_t begin,
662  const std::size_t end) const override
663  {
664  // for classes with trivial assignment of zero can use memset. cast
665  // element to (void*) to silence compiler warning for virtual
666  // classes (they will never arrive here because they are
667  // non-trivial).
668  if (std::is_trivial<T>::value == true)
669  std::memset(static_cast<void *>(destination_ + begin),
670  0,
671  (end - begin) * sizeof(T));
672  else
673  default_construct_or_assign(
674  begin, end, std::integral_constant<bool, initialize_memory>());
675  }
676 
677  private:
678  mutable T *destination_;
679 
680  // copy assignment operation
681  void
683  const std::size_t end,
684  std::integral_constant<bool, false>) const
685  {
686  for (std::size_t i = begin; i < end; ++i)
687  destination_[i] = std::move(T());
688  }
689 
690  // copy constructor (memory initialization)
691  void
693  const std::size_t end,
694  std::integral_constant<bool, true>) const
695  {
696  for (std::size_t i = begin; i < end; ++i)
697  new (&destination_[i]) T;
698  }
699  };
700 
701 } // end of namespace internal
702 
703 
704 #ifndef DOXYGEN
705 
706 
707 template <class T>
709  : data_begin(nullptr)
710  , data_end(nullptr)
711  , allocated_end(nullptr)
712 {}
713 
714 
715 
716 template <class T>
717 inline AlignedVector<T>::AlignedVector(const size_type size, const T &init)
718  : data_begin(nullptr)
719  , data_end(nullptr)
720  , allocated_end(nullptr)
721 {
722  if (size > 0)
723  resize(size, init);
724 }
725 
726 
727 
728 template <class T>
730 {
731  clear();
732 }
733 
734 
735 
736 template <class T>
738  : data_begin(nullptr)
739  , data_end(nullptr)
740  , allocated_end(nullptr)
741 {
742  // copy the data from vec
743  reserve(vec.data_end - vec.data_begin);
745  internal::AlignedVectorCopy<T>(vec.data_begin, vec.data_end, data_begin);
746 }
747 
748 
749 
750 template <class T>
752  : data_begin(vec.data_begin)
753  , data_end(vec.data_end)
754  , allocated_end(vec.allocated_end)
755 {
756  vec.data_begin = nullptr;
757  vec.data_end = nullptr;
758  vec.allocated_end = nullptr;
759 }
760 
761 
762 
763 template <class T>
764 inline AlignedVector<T> &
766 {
767  resize(0);
768  resize_fast(vec.data_end - vec.data_begin);
769  internal::AlignedVectorCopy<T>(vec.data_begin, vec.data_end, data_begin);
770  return *this;
771 }
772 
773 
774 
775 template <class T>
776 inline AlignedVector<T> &
778 {
779  clear();
780 
781  data_begin = vec.data_begin;
782  data_end = vec.data_end;
783  allocated_end = vec.allocated_end;
784 
785  vec.data_begin = nullptr;
786  vec.data_end = nullptr;
787  vec.allocated_end = nullptr;
788 
789  return *this;
790 }
791 
792 
793 
794 template <class T>
795 inline void
797 {
798  const size_type old_size = size();
799  if (std::is_trivial<T>::value == false && size_in < old_size)
800  {
801  // call destructor on fields that are released. doing it backward
802  // releases the elements in reverse order as compared to how they were
803  // created
804  while (data_end != data_begin + size_in)
805  (--data_end)->~T();
806  }
807  reserve(size_in);
808  data_end = data_begin + size_in;
809 
810  // need to still set the values in case the class is non-trivial because
811  // virtual classes etc. need to run their (default) constructor
812  if (std::is_trivial<T>::value == false && size_in > old_size)
814  size_in - old_size, data_begin + old_size);
815 }
816 
817 
818 
819 template <class T>
820 inline void
821 AlignedVector<T>::resize(const size_type size_in)
822 {
823  const size_type old_size = size();
824  if (std::is_trivial<T>::value == false && size_in < old_size)
825  {
826  // call destructor on fields that are released. doing it backward
827  // releases the elements in reverse order as compared to how they were
828  // created
829  while (data_end != data_begin + size_in)
830  (--data_end)->~T();
831  }
832  reserve(size_in);
833  data_end = data_begin + size_in;
834 
835  // finally set the desired init values
836  if (size_in > old_size)
838  size_in - old_size, data_begin + old_size);
839 }
840 
841 
842 
843 template <class T>
844 inline void
845 AlignedVector<T>::resize(const size_type size_in, const T &init)
846 {
847  const size_type old_size = size();
848  if (std::is_trivial<T>::value == false && size_in < old_size)
849  {
850  // call destructor on fields that are released. doing it backward
851  // releases the elements in reverse order as compared to how they were
852  // created
853  while (data_end != data_begin + size_in)
854  (--data_end)->~T();
855  }
856  reserve(size_in);
857  data_end = data_begin + size_in;
858 
859  // finally set the desired init values
860  if (size_in > old_size)
861  ::internal::AlignedVectorSet<T, true>(size_in - old_size,
862  init,
863  data_begin + old_size);
864 }
865 
866 
867 
868 template <class T>
869 inline void
870 AlignedVector<T>::reserve(const size_type size_alloc)
871 {
872  const size_type old_size = data_end - data_begin;
873  const size_type allocated_size = allocated_end - data_begin;
874  if (size_alloc > allocated_size)
875  {
876  // if we continuously increase the size of the vector, we might be
877  // reallocating a lot of times. therefore, try to increase the size more
878  // aggressively
879  size_type new_size = size_alloc;
880  if (size_alloc < (2 * allocated_size))
881  new_size = 2 * allocated_size;
882 
883  const size_type size_actual_allocate = new_size * sizeof(T);
884 
885  // allocate and align along 64-byte boundaries (this is enough for all
886  // levels of vectorization currently supported by deal.II)
887  T *new_data;
888  Utilities::System::posix_memalign(reinterpret_cast<void **>(&new_data),
889  64,
890  size_actual_allocate);
891 
892  // copy data in case there was some content before and release the old
893  // memory with the function corresponding to the one used for allocating
894  std::swap(data_begin, new_data);
895  data_end = data_begin + old_size;
896  allocated_end = data_begin + new_size;
897  if (data_end != data_begin)
898  {
900  new_data + old_size,
901  data_begin);
902  free(new_data);
903  }
904  else
905  Assert(new_data == nullptr, ExcInternalError());
906  }
907  else if (size_alloc == 0)
908  clear();
909 }
910 
911 
912 
913 template <class T>
914 inline void
916 {
917  if (data_begin != nullptr)
918  {
919  if (std::is_trivial<T>::value == false)
920  while (data_end != data_begin)
921  (--data_end)->~T();
922 
923  free(data_begin);
924  }
925  data_begin = nullptr;
926  data_end = nullptr;
927  allocated_end = nullptr;
928 }
929 
930 
931 
932 template <class T>
933 inline void
934 AlignedVector<T>::push_back(const T in_data)
935 {
937  if (data_end == allocated_end)
938  reserve(std::max(2 * capacity(), static_cast<size_type>(16)));
939  if (std::is_trivial<T>::value == false)
940  new (data_end++) T(in_data);
941  else
942  *data_end++ = in_data;
943 }
944 
945 
946 
947 template <class T>
948 inline typename AlignedVector<T>::reference
950 {
951  AssertIndexRange(0, size());
952  T *field = data_end - 1;
953  return *field;
954 }
955 
956 
957 
958 template <class T>
959 inline typename AlignedVector<T>::const_reference
961 {
962  AssertIndexRange(0, size());
963  const T *field = data_end - 1;
964  return *field;
965 }
966 
967 
968 
969 template <class T>
970 template <typename ForwardIterator>
971 inline void
972 AlignedVector<T>::insert_back(ForwardIterator begin, ForwardIterator end)
973 {
974  const unsigned int old_size = size();
975  reserve(old_size + (end - begin));
976  for (; begin != end; ++begin, ++data_end)
977  {
978  if (std::is_trivial<T>::value == false)
979  new (data_end) T;
980  *data_end = *begin;
981  }
982 }
983 
984 
985 
986 template <class T>
987 inline void
989 {
991  data_begin);
992 }
993 
994 
995 
996 template <class T>
997 inline void
998 AlignedVector<T>::fill(const T &value)
999 {
1001 }
1002 
1003 
1004 
1005 template <class T>
1006 inline void
1008 {
1009  std::swap(data_begin, vec.data_begin);
1010  std::swap(data_end, vec.data_end);
1011  std::swap(allocated_end, vec.allocated_end);
1012 }
1013 
1014 
1015 
1016 template <class T>
1017 inline bool
1019 {
1020  return data_end == data_begin;
1021 }
1022 
1023 
1024 
1025 template <class T>
1026 inline typename AlignedVector<T>::size_type
1027 AlignedVector<T>::size() const
1028 {
1029  return data_end - data_begin;
1030 }
1031 
1032 
1033 
1034 template <class T>
1035 inline typename AlignedVector<T>::size_type
1037 {
1038  return allocated_end - data_begin;
1039 }
1040 
1041 
1042 
1043 template <class T>
1045  operator[](const size_type index)
1046 {
1047  AssertIndexRange(index, size());
1048  return data_begin[index];
1049 }
1050 
1051 
1052 
1053 template <class T>
1055  operator[](const size_type index) const
1056 {
1057  AssertIndexRange(index, size());
1058  return data_begin[index];
1059 }
1060 
1061 
1062 
1063 template <typename T>
1064 inline typename AlignedVector<T>::pointer
1066 {
1067  return data_begin;
1068 }
1069 
1070 
1071 
1072 template <typename T>
1073 inline typename AlignedVector<T>::const_pointer
1074 AlignedVector<T>::data() const
1075 {
1076  return data_begin;
1077 }
1078 
1079 
1080 
1081 template <class T>
1082 inline typename AlignedVector<T>::iterator
1084 {
1085  return data_begin;
1086 }
1087 
1088 
1089 
1090 template <class T>
1091 inline typename AlignedVector<T>::iterator
1093 {
1094  return data_end;
1095 }
1096 
1097 
1098 
1099 template <class T>
1100 inline typename AlignedVector<T>::const_iterator
1102 {
1103  return data_begin;
1104 }
1105 
1106 
1107 
1108 template <class T>
1109 inline typename AlignedVector<T>::const_iterator
1110 AlignedVector<T>::end() const
1111 {
1112  return data_end;
1113 }
1114 
1115 
1116 
1117 template <class T>
1118 template <class Archive>
1119 inline void
1120 AlignedVector<T>::save(Archive &ar, const unsigned int) const
1121 {
1122  size_type vec_size(size());
1123  ar & vec_size;
1124  if (vec_size > 0)
1125  ar &boost::serialization::make_array(data_begin, vec_size);
1126 }
1127 
1128 
1129 
1130 template <class T>
1131 template <class Archive>
1132 inline void
1133 AlignedVector<T>::load(Archive &ar, const unsigned int)
1134 {
1135  size_type vec_size = 0;
1136  ar & vec_size;
1137 
1138  if (vec_size > 0)
1139  {
1140  reserve(vec_size);
1141  ar &boost::serialization::make_array(data_begin, vec_size);
1142  data_end = data_begin + vec_size;
1143  }
1144 }
1145 
1146 
1147 
1148 template <class T>
1149 inline typename AlignedVector<T>::size_type
1151 {
1152  size_type memory = sizeof(*this);
1153  for (const T *t = data_begin; t != data_end; ++t)
1154  memory += ::MemoryConsumption::memory_consumption(*t);
1155  memory += sizeof(T) * (allocated_end - data_end);
1156  return memory;
1157 }
1158 
1159 
1160 #endif // ifndef DOXYGEN
1161 
1162 
1168 template <class T>
1169 bool
1171 {
1172  if (lhs.size() != rhs.size())
1173  return false;
1174  for (typename AlignedVector<T>::const_iterator lit = lhs.begin(),
1175  rit = rhs.begin();
1176  lit != lhs.end();
1177  ++lit, ++rit)
1178  if (*lit != *rit)
1179  return false;
1180  return true;
1181 }
1182 
1183 
1184 
1190 template <class T>
1191 bool
1193 {
1194  return !(operator==(lhs, rhs));
1195 }
1196 
1197 
1199 
1200 #endif
void default_construct_or_assign(const std::size_t begin, const std::size_t end, std::integral_constant< bool, false >) const
void posix_memalign(void **memptr, std::size_t alignment, std::size_t size)
Definition: utilities.cc:1051
virtual void apply_to_subrange(const std::size_t begin, const std::size_t end) const override
value_type * pointer
virtual void apply_to_subrange(const std::size_t begin, const std::size_t end) const override
#define AssertIndexRange(index, range)
Definition: exceptions.h:1628
pointer data()
void load(Archive &ar, const unsigned int version)
AlignedVector & operator=(const AlignedVector< T > &vec)
virtual void apply_to_subrange(const std::size_t begin, const std::size_t end) const override
void reserve(const size_type size_alloc)
void push_back(const T in_data)
void resize(const size_type size_in)
value_type * iterator
reference operator[](const size_type index)
void serialize(Archive &archive, const unsigned int version)
bool operator==(const AlignedVector< T > &lhs, const AlignedVector< T > &rhs)
static const char T
#define Assert(cond, exc)
Definition: exceptions.h:1403
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:363
void copy_construct_or_assign(const std::size_t begin, const std::size_t end, std::integral_constant< bool, true >) const
void insert_back(ForwardIterator begin, ForwardIterator end)
const value_type * const_iterator
size_type memory_consumption() const
value_type & reference
void copy_construct_or_assign(const std::size_t begin, const std::size_t end, std::integral_constant< bool, false >) const
void default_construct_or_assign(const std::size_t begin, const std::size_t end, std::integral_constant< bool, true >) const
void swap(AlignedVector< T > &vec)
void resize_fast(const size_type size)
void swap(MemorySpaceData< Number, MemorySpace > &, MemorySpaceData< Number, MemorySpace > &)
Definition: memory_space.h:102
void save(Archive &ar, const unsigned int version) const
virtual void apply_to_subrange(const std::size_t begin, const std::size_t end) const override
iterator end()
AlignedVectorMove(T *const source_begin, T *const source_end, T *const destination)
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:362
AlignedVectorCopy(const T *const source_begin, const T *const source_end, T *const destination)
iterator begin()
AlignedVectorSet(const std::size_t size, const T &element, T *const destination)
size_type size() const
unsigned int minimum_parallel_grain_size
Definition: parallel.cc:34
bool operator!=(const AlignedVector< T > &lhs, const AlignedVector< T > &rhs)
AlignedVectorDefaultInitialize(const std::size_t size, T *const destination)
static const types::blas_int zero
void free(T *&pointer)
Definition: cuda.h:96
const value_type * const_pointer
bool empty() const
const value_type & const_reference
T max(const T &t, const MPI_Comm &mpi_communicator)
size_type capacity() const
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
reference back()
static ::ExceptionBase & ExcInternalError()