www.cemf.ir
VectorSingle.cpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 template<typename T, typename MemorySpace>
24 (
25  uint32 n,
26  bool withInit
27 )
28 {
29  if(n > this->capacity() )
30  {
31  uint32 newCap = evalCapacity(n);
32  changeCapacity(newCap, withInit);
33  }
34  return setSize(n);
35 }
36 
37 template<typename T, typename MemorySpace>
40 (
41  uint32 actualCap,
42  uint32 n,
43  bool withInit
44 )
45 {
46  changeCapacity(actualCap, withInit);
47  return setSize(n);
48 }
49 
50 template<typename T, typename MemorySpace>
53 (
54  uint32 actualCap,
55  bool withInit
56 )
57 {
58 
59  if(withInit)
60  {
61  resizeInit(view_, actualCap);
62  }
63  else
64  {
65  resizeNoInit(view_, actualCap);
66  }
67 
68 }
69 
70 template<typename T, typename MemorySpace>
73 (
74  uint32 cap,
75  uint32 s
76 )
77 {
78  reallocNoInit(view_, cap);
79  return setSize(s);
80 }
81 
82 template<typename T, typename MemorySpace>
85 {
86  auto os = size_;
87  size_ = n;
88  return os;
89 }
90 
91 
92 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
93 
94 template<typename T, typename MemorySpace>
96 :
97  VectorSingle("VectorSingle")
98 {}
99 
100 template<typename T, typename MemorySpace>
102 :
103  size_(0),
104  view_(name,2)
105 {}
106 
107 template<typename T, typename MemorySpace>
109 (
110  const word& name,
111  uint32 n
112 )
113 :
114  size_(n),
115  view_(name, evalCapacity(n))
116 {}
117 
118 template<typename T, typename MemorySpace>
120 (
121  const word& name,
122  uint32 n,
123  const T& val
124 )
125 :
126  VectorSingle(name, n)
127 {
128  assign(n, val);
129 }
130 
131 template<typename T, typename MemorySpace>
133 (
134  const word& name,
135  uint32 cap,
136  uint32 n,
137  RESERVE
138 )
139 :
140  size_(n),
141  view_(name, cap)
142 {}
143 
144 template<typename T, typename MemorySpace>
146 (
147  const word& name,
148  const std::vector<T> & src
149 )
150 :
151  VectorSingle(name)
152 {
153  assign(src);
154 }
155 
156 template<typename T, typename MemorySpace>
158 (
159  const word& name,
160  const std::vector<T> & src,
161  uint32 cap
162 )
163 :
164  VectorSingle(name)
165 {
166  assign(src, cap);
167 }
168 
169 template<typename T, typename MemorySpace>
171 (
172  const VectorSingle& src
173 )
174 :
175  VectorSingle(src.name(), src)
176 {}
177 
178 template<typename T, typename MemorySpace>
180 (
181  const word& name,
182  const VectorSingle& src
183 )
184 :
185  VectorSingle(name, src.capacity(), src.size(), RESERVE())
186 {
187  copy(deviceView(), src.deviceView());
188 }
189 
190 template<typename T, typename MemorySpace>
192 (
193  const word& name,
194  const ViewType1D<T, MemorySpace>& src
195 )
196 :
197  VectorSingle(name, src.size(), src.size(), RESERVE())
198 {
199  copy(deviceView(), src);
200 }
201 
202 template<typename T, typename MemorySpace>
205 {
206  if(&rhs == this) return *this;
207  VectorSingle temp(rhs);
208 
209  size_ = temp.size();
210  view_ = temp.view_;
211 
212  return *this;
213 }
214 
215 template<typename T, typename MemorySpace>
217 {
218  view_ = viewType();
219  size_ = 0;
220 }
221 
222 template<typename T, typename MemorySpace>
226 {
227  return makeUnique<VectorSingle>( this->name(), *this);
228 }
229 
230 
231 template<typename T, typename MemorySpace>
235 {
236  return *this;
237 }
238 
239 template<typename T, typename MemorySpace>
243 {
244  return *this;
245 }
246 
247 template<typename T, typename MemorySpace>
250 {
251  return view_;
252 }
253 
254 template<typename T, typename MemorySpace>
257 {
258  return view_;
259 }
260 
261 template<typename T, typename MemorySpace>
264 {
265  return Kokkos::subview(
266  view_,
267  Kokkos::make_pair(0u,static_cast<uint32>(size_)));
268 }
269 
270 template<typename T, typename MemorySpace>
273 {
274  auto hView = Kokkos::create_mirror_view(view_);
275  copy(hView, view_);
276  return hView;
277 }
278 
279 template<typename T, typename MemorySpace>
282 {
283  auto hView = Kokkos::create_mirror_view(deviceView());
284  copy(hView, deviceView());
285  return hView;
286 }
287 
288 template<typename T, typename MemorySpace>
291 {
292  return view_.label();
293 }
294 
295 template<typename T, typename MemorySpace>
298 {
299  return size_;
300 }
301 
302 template<typename T, typename MemorySpace>
305 {
306  return view_.extent(0);
307 }
308 
309 template<typename T, typename MemorySpace>
312 {
313  return size_==0;
314 }
315 
316 template<typename T, typename MemorySpace>
319 {
320  if(cap == capacity() ) return;
321  changeCapacity(cap);
322 }
323 
324 template<typename T, typename MemorySpace>
327 {
328  reallocateCapacitySize(cap, 0);
329 }
330 
331 template<typename T, typename MemorySpace>
334 (
335  uint32 cap,
336  uint32 newSize
337 )
338 {
339  reallocateCapacitySize(cap, newSize);
340 }
341 
342 template<typename T, typename MemorySpace>
345 {
346  changeSize(n);
347 }
348 
349 template<typename T, typename MemorySpace>
352 {
353  assign(n, val);
354 }
355 
356 template<typename T, typename MemorySpace>
359 {
360  size_ = 0;
361 }
362 
363 template<typename T, typename MemorySpace>
366 {
367  if(empty())return;
368  pFlow::fill(view_, rangeU32(0 ,size_) ,val);
369 }
370 
371 template<typename T, typename MemorySpace>
374 (
375  rangeU32 r,
376  const T& val
377 )
378 {
379  changeSize(r.end());
380  pFlow::fill(view_, r, val);
381 }
382 
383 template<typename T, typename MemorySpace>
386 (
387  size_t n,
388  const T& val
389 )
390 {
391 
392  if( n > capacity() )
393  {
394  reallocateCapacitySize(evalCapacity(n), n);
395  }
396  else
397  {
398  setSize(n);
399  }
400  this->fill(val);
401 }
402 
403 template<typename T, typename MemorySpace>
406 (
407  const std::vector<T>& src,
408  uint32 cap
409 )
410 {
411  // make sure that vector has enough capacity
412  uint32 newCap = max(static_cast<uint32>(src.size()), cap);
413  uint32 srcSize = src.size();
414 
415  if(newCap != capacity())
416  {
417  reallocateCapacitySize(newCap, srcSize);
418  }
419  else
420  {
421  changeSize(srcSize);
422  }
423 
424  // - unmanaged view in the host
425  hostViewType1D<const T> temp(src.data(), srcSize );
426  copy(deviceView(), temp);
427 
428 }
429 
430 template<typename T, typename MemorySpace>
433 (
434  const std::vector<T>& src
435 )
436 {
437  assign(src, this->capacity());
438 }
439 
440 template<typename T, typename MemorySpace>
443 {
444  uint32 srcSize = src.size();
445  uint32 srcCap = src.capacity();
446 
447  if(srcCap != capacity())
448  {
449  reallocateCapacitySize(srcCap, srcSize);
450  }
451  else
452  {
453  changeSize(srcSize);
454  }
455 
456  copy(deviceView(), src.hostView());
457 
458 }
459 
460 template<typename T, typename MemorySpace>
463 (
464  const VectorType& src,
465  bool srcCapacity
466 )
467 {
468  uint32 srcSize = src.size();
469  uint32 srcCap = src.capacity();
470 
471  if(srcCapacity && srcCap != capacity())
472  {
473  reallocateCapacitySize(srcCap, srcSize);
474  }
475  else
476  {
477  changeSize(srcSize);
478  }
479 
480  copy(deviceView(), src.deviceView());
481 }
482 
483 
484 template<typename T, typename MemorySpace>
485 template<typename MSpace>
488  const VectorSingle<T, MSpace>& src,
489  bool srcCapacity
490 )
491 {
492  uint32 srcSize = src.size();
493  uint32 srcCap = src.capacity();
494 
495  if(srcCapacity && srcCap != capacity()){
496  reallocateCapacitySize(srcCap, srcSize);
497  }
498  else {
499  changeSize(srcSize);
500  }
501  copy(deviceView(), src.deviceView());
502 }
503 
504 template <typename T, typename MemorySpace>
507 {
508  uint32 appSize = appVec.size();
509  if(appSize == 0) return;
510 
511  uint32 oldS = size();
512  uint32 newSize = oldS + appSize;
513 
514  changeSize(newSize);
515 
516  auto appendView = Kokkos::subview(
517  view_,
518  Kokkos::make_pair<uint32>(oldS, newSize));
519 
520  copy(appendView, appVec);
521 
522 }
523 
524 template <typename T, typename MemorySpace>
527 (
528  const std::vector<T> &appVec
529 )
530 {
531  if(appVec.empty())return;
532 
533  auto srcSize = appVec.size();
534  uint32 oldSize = size();
535  uint32 newSize = srcSize + oldSize;
536 
537  changeSize(newSize);
538 
539  hostViewType1D<const T> temp(appVec.data(), srcSize );
540  auto dest = Kokkos::subview(view_, Kokkos::make_pair<uint32>(oldSize,newSize));
541 
542  copy(dest, temp);
543 }
544 
545 template <typename T, typename MemorySpace>
548 (
549  const VectorType& appVec
550 )
551 {
552  uint32 appSize = appVec.size();
553  if(appSize == 0) return;
554 
555  uint32 oldS = size();
556  uint32 newSize = oldS + appSize;
557 
558  changeSize(newSize);
559 
560  auto appendView = Kokkos::subview(
561  view_,
562  Kokkos::make_pair<uint32>(oldS, newSize));
563 
564  copy(appendView, appVec.deviceView());
565 
566 }
567 
568 template <typename T, typename MemorySpace>
570 {
571  return span<T>(view_.data(), size());
572 }
573 
574 template<typename T, typename MemorySpace>
577 {
578  return span<T>(const_cast<T*>(view_.data()), this->size());
579 }
580 
581 template<typename T, typename MemorySpace>
584 {
585  if(indices.empty()) return true;
586 
587  auto maxInd = indices.max();
588 
589  if(this->empty() || maxInd > size()-1 )
590  {
591  resize(maxInd+1);
592  }
593 
594  using policy = Kokkos::RangePolicy<execution_space,Kokkos::IndexType<uint32>>;
595 
596  if constexpr( isDeviceAccessible_ )
597  {
598  auto v = view_;
599  auto ind = indices.deviceView();
600 
601  Kokkos::parallel_for(
602  "VectorSingle::insertSetElement",
603  policy(0,indices.size()),
604  LAMBDA_HD(uint32 i){
605  v[ind[i]]= val;
606  });
607 
608  Kokkos::fence();
609  }
610  else
611  {
612 
613  auto v = view_;
614  auto ind = indices.hostView();
615 
616  Kokkos::parallel_for(
617  "VectorSingle::insertSetElement",
618  policy(0,indices.size()),
619  LAMBDA_HD(uint32 i){
620  v[ind[i]]= val;
621  });
622 
623  Kokkos::fence();
624 
625  }
626 
627  return true;
628 }
629 
630 
631 template<typename T, typename MemorySpace>
634 (
635  const uint32IndexContainer& indices,
636  const std::vector<T>& vals
637 )
638 {
639 
640  if(indices.empty())return true;
641  if(indices.size() != vals.size())return false;
642 
643  auto maxInd = indices.max();
644 
645  if(this->empty() || maxInd > size()-1 )
646  {
647  resize(maxInd+1);
648  }
649 
650  using policy = Kokkos::RangePolicy<execution_space,Kokkos::IndexType<uint32>>;
651 
652  hostViewType1D<const T> hVals( vals.data(), vals.size());
653 
654  if constexpr( isDeviceAccessible_ )
655  {
656  deviceViewType1D<T> dVals("dVals", indices.size());
657  copy(dVals, hVals);
658  auto dVec = view_;
659  auto ind = indices.deviceView();
660 
661  Kokkos::parallel_for(
662  "VectorSingle::insertSetElement",
663  policy(0,indices.size()), LAMBDA_HD(uint32 i){
664  dVec(ind(i))= dVals(i);});
665  Kokkos::fence();
666 
667  }
668  else
669  {
670  auto dVec = view_;
671  auto ind = indices.hostView();
672 
673  Kokkos::parallel_for(
674  "VectorSingle::insertSetElement",
675  policy(0,indices.size()), LAMBDA_HD(uint32 i){
676  dVec(ind(i))= hVals(i);});
677  Kokkos::fence();
678 
679  }
680 
681  return true;
682 }
683 
684 template<typename T, typename MemorySpace>
687 (
688  const uint32IndexContainer& indices,
689  const ViewType1D<T, memory_space> vals
690 )
691 {
692  if(indices.empty())return true;
693  if(indices.size() != vals.size())return false;
694 
695  auto maxInd = indices.max();
696 
697  if(this->empty() || maxInd > size()-1 )
698  {
699  resize(maxInd+1);
700  }
701 
702  using policy = Kokkos::RangePolicy<
704  Kokkos::IndexType<uint32>>;
705 
706  if constexpr( isDeviceAccessible_ )
707  {
708  auto dVec = view_;
709  auto dVals = vals;
710  auto ind = indices.deviceView();
711 
712  Kokkos::parallel_for(
713  "VectorSingle::insertSetElement",
714  policy(0,indices.size()), LAMBDA_HD(uint32 i){
715  dVec(ind(i))= dVals(i);});
716  Kokkos::fence();
717 
718  }
719  else
720  {
721  auto dVec = view_;
722  auto hVals = vals;
723  auto ind = indices.hostView();
724 
725  Kokkos::parallel_for(
726  "VectorSingle::insertSetElement",
727  policy(0,indices.size()), LAMBDA_HD(uint32 i){
728  dVec(ind(i))= hVals(i);});
729  Kokkos::fence();
730 
731  }
732 
733  return true;
734 }
735 
736 template<typename T, typename MemorySpace>
739 {
740  if(indices.size() == 0)
741  {
742  setSize(0);
743  return true;
744  }
745 
746  auto maxInd = indices.max();
747 
748  if(maxInd >= this->size())
749  {
750  fatalErrorInFunction<<"In reordering the VectorSingle ("
751  << this->name()<< ") maximum index ("<< maxInd <<
752  ") exceeds the size of the vector (" << this->size()<<")"<<endl;
753  return false;
754  }
755 
756  uint32 newSize = indices.size();
757 
758  viewType sortedView(this->name(), newSize);
759 
760  using policy = Kokkos::RangePolicy< execution_space,Kokkos::IndexType<uint32>>;
761 
762  if constexpr( isDeviceAccessible_)
763  {
764  auto d_indices = indices.deviceView();
765  auto d_view = view_;
766 
767  Kokkos::parallel_for
768  (
769  "VectorSingle::sortItems",
770  policy(0,newSize),
771  LAMBDA_HD(uint32 i)
772  {
773  sortedView(i) = d_view(d_indices(i));
774  }
775  );
776 
777  Kokkos::fence();
778 
779  }
780  else
781  {
782  auto h_indices = indices.hostView();
783  auto d_view = view_;
784 
785  Kokkos::parallel_for
786  (
787  "VectorSingle::sortItems",
788  policy(0,newSize),
789  LAMBDA_HD(uint32 i)
790  {
791  sortedView(i) = d_view(h_indices(i));
792  }
793  );
794 
795  Kokkos::fence();
796  }
797 
798  setSize(newSize);
799 
800  copy(deviceView(), sortedView);
801 
802 
803  return true;
804 }
pFlow::span
Definition: span.hpp:31
pFlow::VectorSingle::fill
INLINE_FUNCTION_H void fill(const T &val)
Fill the range [0,size) with val.
Definition: VectorSingle.cpp:365
pFlow::VectorSingle::reserve
INLINE_FUNCTION_H void reserve(uint32 cap)
Reserve capacity for vector Preserve the content.
Definition: VectorSingle.cpp:318
pFlow::VectorSingle::resize
INLINE_FUNCTION_H void resize(uint32 n)
Resize the vector and preserve the content.
Definition: VectorSingle.cpp:344
pFlow::resizeNoInit
INLINE_FUNCTION_H void resizeNoInit(ViewType1D< Type, Properties... > &view, uint32 newLen)
Definition: KokkosUtilities.hpp:151
pFlow::VectorSingle::append
INLINE_FUNCTION_H void append(const ViewType1D< T, MemorySpace > &appVec)
Definition: VectorSingle.cpp:506
pFlow::fill
void fill(Vector< T, Allocator > &vec, const T &val)
Definition: VectorAlgorithm.hpp:44
pFlow::empty
Definition: empty.hpp:30
pFlow::VectorSingle::VectorSingle
VectorSingle()
Empty vector.
Definition: VectorSingle.cpp:95
pFlow::VectorSingle::assignFromDevice
INLINE_FUNCTION_H void assignFromDevice(const VectorSingle< T, MSpace > &src, bool srcCapacity=true)
Definition: VectorSingle.cpp:487
pFlow::indexContainer::max
INLINE_FUNCTION_HD IndexType max() const
Max value of indices.
Definition: indexContainer.hpp:196
pFlow::Range::end
INLINE_FUNCTION_HD T & end()
End.
Definition: Range.hpp:101
pFlow::algorithms::KOKKOS::max
INLINE_FUNCTION_H Type max(const Type *first, uint32 numElems)
Definition: kokkosAlgorithms.hpp:104
pFlow::copy
INLINE_FUNCTION_H void copy(const ViewType1D< dType, dProperties... > &dst, const ViewType1D< sType, sProperties... > &src)
Definition: ViewAlgorithms.hpp:234
pFlow::VectorSingle::reallocate
INLINE_FUNCTION_H void reallocate(uint32 cap)
Reallocate memory to new cap and set size to 0.
Definition: VectorSingle.cpp:326
pFlow::VectorSingle::clear
INLINE_FUNCTION_H void clear()
Clear the vector, but keep the allocated memory unchanged.
Definition: VectorSingle.cpp:358
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::VectorSingle::setSize
INLINE_FUNCTION_H uint32 setSize(uint32 n)
Definition: VectorSingle.cpp:84
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::reallocNoInit
INLINE_FUNCTION_H void reallocNoInit(ViewType1D< Type, Properties... > &view, uint32 len)
Definition: KokkosUtilities.hpp:64
pFlow::VectorSingle::clone
INLINE_FUNCTION_H uniquePtr< VectorSingle > clone() const
Clone as a uniquePtr (perform deep copy)
Definition: VectorSingle.cpp:225
pFlow::VectorSingle::changeCapacitySize
INLINE_FUNCTION_H uint32 changeCapacitySize(uint32 actualCap, uint32 n, bool withInit=false)
Change the size and capacity of Vector.
Definition: VectorSingle.cpp:40
pFlow::rangeU32
Range< uint32 > rangeU32
Definition: Range.hpp:143
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow::VectorSingle::empty
INLINE_FUNCTION_H bool empty() const
If vector is empty.
Definition: VectorSingle.cpp:311
pFlow::deviceViewType1D
Kokkos::View< T * > deviceViewType1D
1D array (vector) with default device (memory space and execution space)
Definition: KokkosTypes.hpp:121
policy
Kokkos::RangePolicy< pFlow::DefaultExecutionSpace, Kokkos::Schedule< Kokkos::Static >, Kokkos::IndexType< pFlow::uint32 > > policy
Definition: grainParticlesKernels.cpp:25
pFlow::VectorSingle< uint32, HostSpace >::execution_space
typename viewType::execution_space execution_space
Definition: VectorSingle.hpp:76
pFlow::VectorSingle::reorderItems
INLINE_FUNCTION_H bool reorderItems(const uint32IndexContainer &indices)
Definition: VectorSingle.cpp:738
pFlow::VectorSingle::deviceView
INLINE_FUNCTION_H auto deviceView() const
Device view range [0, size)
Definition: VectorSingle.cpp:263
pFlow::VectorSingle::name
INLINE_FUNCTION_H word name() const
Name of the vector.
Definition: VectorSingle.cpp:290
pFlow::VectorSingle::changeCapacity
INLINE_FUNCTION_H void changeCapacity(uint32 actualCap, bool withInit=false)
Definition: VectorSingle.cpp:53
RESERVE
Definition: Vector.hpp:40
pFlow::indexContainer::hostView
const HostViewType & hostView() const
Return Host veiw.
Definition: indexContainer.hpp:202
pFlow::VectorSingle::assignFromHost
INLINE_FUNCTION_H void assignFromHost(const VectorTypeHost &src)
Assign source vector from host side.
Definition: VectorSingle.cpp:442
pFlow::VectorSingle::~VectorSingle
~VectorSingle()
Descructor This may not destroy the underlying memory, sice view is shared_ptr and maybe referenced b...
Definition: VectorSingle.cpp:216
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
pFlow::VectorSingle::getSpan
INLINE_FUNCTION_H auto getSpan()
Definition: VectorSingle.cpp:569
pFlow::VectorSingle::changeSize
INLINE_FUNCTION_H uint32 changeSize(uint32 n, bool withInit=false)
Change size to n and preserve the conetent if realloc occurs
Definition: VectorSingle.cpp:24
pFlow::VectorSingle::hostView
INLINE_FUNCTION_H auto hostView() const
Return a view accessible on Host in range [0,size)
Definition: VectorSingle.cpp:281
fill
void fill(Vector< T, Allocator > &vec, const T &val)
INLINE_FUNCTION_H
#define INLINE_FUNCTION_H
Definition: pFlowMacros.hpp:57
pFlow::indexContainer::empty
INLINE_FUNCTION_HD bool empty() const
If the container empty.
Definition: indexContainer.hpp:182
pFlow::resizeInit
INLINE_FUNCTION_H void resizeInit(ViewType1D< Type, Properties... > &view, uint32 newLen)
Definition: KokkosUtilities.hpp:144
pFlow::VectorSingle
Definition: VectorSingle.hpp:44
pFlow::Range< uint32 >
pFlow::VectorSingle::deviceViewAll
INLINE_FUNCTION_H auto & deviceViewAll()
Device view range [0,capcity)
Definition: VectorSingle.cpp:249
pFlow::ViewType1D
Kokkos::View< T *, properties... > ViewType1D
1D veiw as a vector
Definition: KokkosTypes.hpp:93
pFlow::hostViewType1D
Kokkos::View< T *, Kokkos::HostSpace > hostViewType1D
1D array (vector with host memeory space)
Definition: KokkosTypes.hpp:136
pFlow::VectorSingle::hostViewAll
INLINE_FUNCTION_H auto hostViewAll() const
Return a view accessible on Host in range [0,capacity)
Definition: VectorSingle.cpp:272
n
uint32 n
Definition: NBSLoop.hpp:24
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::VectorSingle::assign
INLINE_FUNCTION_H void assign(size_t n, const T &val)
Change size of the vector and assign val to vector and.
Definition: VectorSingle.cpp:386
LAMBDA_HD
#define LAMBDA_HD
Definition: pFlowMacros.hpp:58
pFlow::VectorSingle::capacity
INLINE_FUNCTION_H uint32 capacity() const
Definition: VectorSingle.cpp:304
pFlow::VectorSingle::VectorField
INLINE_FUNCTION_H VectorType & VectorField()
Return *this.
Definition: VectorSingle.cpp:234
pFlow::indexContainer::size
INLINE_FUNCTION_HD auto size() const
Size.
Definition: indexContainer.hpp:175
pFlow::VectorSingle::reallocateCapacitySize
INLINE_FUNCTION_H uint32 reallocateCapacitySize(uint32 cap, uint32 s)
Definition: VectorSingle.cpp:73
pFlow::VectorSingle::operator=
VectorSingle & operator=(const VectorSingle &rhs)
Copy assignment (perform deep copy from rhs to *this)
Definition: VectorSingle.cpp:204
pFlow::VectorSingle::insertSetElement
INLINE_FUNCTION_H bool insertSetElement(const uint32IndexContainer &indices, const T &val)
Definition: VectorSingle.cpp:583
pFlow::indexContainer
It holds two vectors of indecis on Host and Device.
Definition: indexContainer.hpp:39
pFlow::VectorSingle::size
INLINE_FUNCTION_H uint32 size() const
Size of the vector.
Definition: VectorSingle.cpp:297
pFlow::indexContainer::deviceView
const DeviceViewType & deviceView() const
Return Device view.
Definition: indexContainer.hpp:208
pFlow::VectorSingle< uint32, HostSpace >::viewType
ViewType1D< uint32, HostSpace > viewType
Definition: VectorSingle.hpp:70
pFlow::VectorSingle::view_
viewType view_
view of the vector
Definition: VectorSingle.hpp:86