QMCPACK
VectorSoaContainer< T, D, Alloc > Struct Template Reference

SoA adaptor class for Vector<TinyVector<T,D> > More...

+ Inheritance diagram for VectorSoaContainer< T, D, Alloc >:
+ Collaboration diagram for VectorSoaContainer< T, D, Alloc >:

Classes

struct  Accessor
 helper class for operator ()(size_type i) to assign a value More...
 

Public Types

using AoSElement_t = TinyVector< T, D >
 
using size_type = size_t
 
using value_type = T
 

Public Member Functions

 VectorSoaContainer ()
 default constructor More...
 
 VectorSoaContainer (T *ptr, size_type n, size_type n_padded)
 constructor for a view, attach to pre-allocated data More...
 
 ~VectorSoaContainer ()
 destructor More...
 
 VectorSoaContainer (const VectorSoaContainer &in)
 default copy constructor More...
 
VectorSoaContaineroperator= (const VectorSoaContainer &in)
 default copy operator More...
 
 VectorSoaContainer (VectorSoaContainer &&in) noexcept
 move constructor More...
 
 VectorSoaContainer (size_type n)
 constructor with size n without initialization More...
 
template<typename T1 >
 VectorSoaContainer (const Vector< TinyVector< T1, D >> &in)
 constructor with Vector<T1,D> More...
 
template<typename T1 >
VectorSoaContaineroperator= (const Vector< TinyVector< T1, D >> &in)
 
template<typename T1 >
VectorSoaContaineroperator= (const T1 in)
 need A=0.0; More...
 
void resize (size_type n)
 resize myData More...
 
void clear ()
 clear More...
 
void free ()
 free allocated memory and clear status variables More...
 
void attachReference (size_type n, size_type n_padded, T *ptr)
 attach to pre-allocated data More...
 
template<typename CONTAINER >
void attachReference (size_type n, size_type n_padded, const CONTAINER &other, T *ptr)
 attach to pre-allocated data More...
 
size_type size () const
 return the physical size More...
 
size_type capacity () const
 return the physical size More...
 
void copyIn (const Vector< TinyVector< T, D >> &in)
 AoS to SoA : copy from Vector<TinyVector<>> More...
 
void copyOut (Vector< TinyVector< T, D >> &out) const
 SoA to AoS : copy to Vector<TinyVector<>> More...
 
const AoSElement_t operator[] (size_type i) const
 return TinyVector<T,D> More...
 
Accessor operator() (size_type i)
 access operator for assignment of the i-th value More...
 
T * data ()
 return the base More...
 
const T * data () const
 return the base More...
 
T * getNonConstData () const
 return non_const data More...
 
T *restrict data (size_type i)
 return the pointer of the i-th components More...
 
const T *restrict data (size_type i) const
 return the const pointer of the i-th components More...
 
T * end ()
 return the end More...
 
const T * end () const
 return the end More...
 
template<typename Allocator = Alloc, typename = IsDualSpace<Allocator>>
T * device_data ()
 return the base, device More...
 
template<typename Allocator = Alloc, typename = IsDualSpace<Allocator>>
const T * device_data () const
 return the base, device More...
 
template<typename Allocator = Alloc, typename = IsDualSpace<Allocator>>
T *restrict device_data (size_type i)
 return the pointer of the i-th components, device More...
 
template<typename Allocator = Alloc, typename = IsDualSpace<Allocator>>
const T *restrict device_data (size_type i) const
 return the const pointer of the i-th components, device More...
 
template<typename Allocator = Alloc, typename = IsDualSpace<Allocator>>
void updateTo ()
 
template<typename Allocator = Alloc, typename = IsDualSpace<Allocator>>
void updateFrom ()
 
template<typename Allocator = Alloc, typename = IsDualSpace<Allocator>>
void copyDeviceDataByIndex (unsigned to, unsigned from)
 

Private Member Functions

bool isRefAttached () const
 return true if memory is not owned by the container but from outside. More...
 

Private Attributes

size_type nLocal
 number of elements More...
 
size_type nGhosts
 number of elements + padded More...
 
size_type nAllocated
 number of elements allocated by myAlloc More...
 
T * myData
 pointer: what type???? More...
 
Alloc mAllocator
 allocator More...
 

Friends

class qmcplusplus::Vector< T, Alloc >
 
template<typename OtherT , unsigned OtherD, typename OtherAlloc >
struct VectorSoaContainer
 

Detailed Description

template<typename T, unsigned D, typename Alloc = aligned_allocator<T>>
struct qmcplusplus::VectorSoaContainer< T, D, Alloc >

SoA adaptor class for Vector<TinyVector<T,D> >

Template Parameters
Tdata type, float, double, complex<float>, complex<double>
Allocmemory allocator

Definition at line 34 of file VectorSoaContainer.h.

Member Typedef Documentation

◆ AoSElement_t

using AoSElement_t = TinyVector<T, D>

Definition at line 36 of file VectorSoaContainer.h.

◆ size_type

using size_type = size_t

Definition at line 37 of file VectorSoaContainer.h.

◆ value_type

using value_type = T

Definition at line 38 of file VectorSoaContainer.h.

Constructor & Destructor Documentation

◆ VectorSoaContainer() [1/6]

VectorSoaContainer ( )
inline

default constructor

Definition at line 41 of file VectorSoaContainer.h.

41 : nLocal(0), nGhosts(0), nAllocated(0), myData(nullptr) {}
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded
size_type nAllocated
number of elements allocated by myAlloc
size_type nLocal
number of elements

◆ VectorSoaContainer() [2/6]

VectorSoaContainer ( T *  ptr,
size_type  n,
size_type  n_padded 
)
inline

constructor for a view, attach to pre-allocated data

Parameters
ptrnew myData
nnew nLocal
n_paddednew nGhosts

Definition at line 48 of file VectorSoaContainer.h.

48 : nLocal(n), nGhosts(n_padded), nAllocated(0), myData(ptr) {}
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded
size_type nAllocated
number of elements allocated by myAlloc
size_type nLocal
number of elements

◆ ~VectorSoaContainer()

~VectorSoaContainer ( )
inline

destructor

Definition at line 51 of file VectorSoaContainer.h.

51 { free(); }
void free()
free allocated memory and clear status variables

◆ VectorSoaContainer() [3/6]

VectorSoaContainer ( const VectorSoaContainer< T, D, Alloc > &  in)
inline

default copy constructor

Definition at line 54 of file VectorSoaContainer.h.

54  : nLocal(0), nGhosts(0), nAllocated(0), myData(nullptr)
55  {
56  resize(in.nLocal);
57  std::copy_n(in.myData, nGhosts * D, myData);
58  }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded
sycl::event copy_n(sycl::queue &aq, const T1 *restrict VA, size_t array_size, T2 *restrict VC, const std::vector< sycl::event > &events)
Definition: syclBLAS.cpp:548
void resize(size_type n)
resize myData
size_type nAllocated
number of elements allocated by myAlloc
size_type nLocal
number of elements

◆ VectorSoaContainer() [4/6]

VectorSoaContainer ( VectorSoaContainer< T, D, Alloc > &&  in)
inlinenoexcept

move constructor

Definition at line 73 of file VectorSoaContainer.h.

74  : nLocal(in.nLocal), nGhosts(in.nGhosts), nAllocated(in.nAllocated), myData(std::move(in.myData))
75  {
76  in.myData = nullptr;
77  in.nAllocated = 0;
78  in.nLocal = 0;
79  in.nGhosts = 0;
80  }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded
size_type nAllocated
number of elements allocated by myAlloc
size_type nLocal
number of elements

◆ VectorSoaContainer() [5/6]

VectorSoaContainer ( size_type  n)
inlineexplicit

constructor with size n without initialization

Definition at line 83 of file VectorSoaContainer.h.

83 : nLocal(0), nGhosts(0), nAllocated(0), myData(nullptr) { resize(n); }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded
void resize(size_type n)
resize myData
size_type nAllocated
number of elements allocated by myAlloc
size_type nLocal
number of elements

◆ VectorSoaContainer() [6/6]

VectorSoaContainer ( const Vector< TinyVector< T1, D >> &  in)
inline

constructor with Vector<T1,D>

Definition at line 87 of file VectorSoaContainer.h.

87  : nLocal(0), nGhosts(0), nAllocated(0), myData(nullptr)
88  {
89  resize(in.size());
90  copyIn(in);
91  }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded
void copyIn(const Vector< TinyVector< T, D >> &in)
AoS to SoA : copy from Vector<TinyVector<>>
void resize(size_type n)
resize myData
size_type nAllocated
number of elements allocated by myAlloc
size_type nLocal
number of elements

Member Function Documentation

◆ attachReference() [1/2]

void attachReference ( size_type  n,
size_type  n_padded,
T *  ptr 
)
inline

attach to pre-allocated data

Parameters
nnew nLocal
n_paddednew nGhosts
ptrnew myData

To attach to existing memory, currently owned memory must be freed before calling attachReference

Todo:
return this when buffer system is simplified.

Definition at line 165 of file VectorSoaContainer.h.

Referenced by JeeIOrbitalSoA< FT >::copyFromBuffer(), SoaDistanceTableAAOMPTarget< T, D, SC >::move(), RealSpacePositionsOMPTarget::RealSpacePositionsOMPTarget(), and RealSpacePositionsOMPTarget::resize().

166  {
167  if (nAllocated)
168  {
169  free();
170  // This is too noisy right now.
171  // std::cerr << "OhmmsVectorSoa attachReference called on previously allocated vector.\n" << std::endl;
172  /// \todo return this when buffer system is simplified.
173  }
174  nLocal = n;
175  nGhosts = n_padded;
176  myData = ptr;
177  }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded
void free()
free allocated memory and clear status variables
size_type nAllocated
number of elements allocated by myAlloc
size_type nLocal
number of elements

◆ attachReference() [2/2]

void attachReference ( size_type  n,
size_type  n_padded,
const CONTAINER &  other,
T *  ptr 
)
inline

attach to pre-allocated data

Parameters
nnew nLocal
n_paddednew nGhosts
otherthe container that owns the memory that ptr points to
ptrnew myData

To attach to existing memory, currently owned memory must be freed before calling attachReference

Todo:
return this when buffer system is simplified.

Definition at line 188 of file VectorSoaContainer.h.

189  {
190  if (nAllocated)
191  {
192  free();
193  // This is too noisy right now.
194  // std::cerr << "OhmmsVectorSoa attachReference called on previously allocated vector.\n" << std::endl;
195  /// \todo return this when buffer system is simplified.
196  }
197  nLocal = n;
198  nGhosts = n_padded;
199  myData = ptr;
200  qmc_allocator_traits<Alloc>::attachReference(other.mAllocator, mAllocator, other.data(), ptr);
201  }
T * myData
pointer: what type????
static void attachReference(Allocator &from, Allocator &to, std::ptrdiff_t ptr_offset)
So we can write generic tests that work with all QMCPACK allocators.
size_type nGhosts
number of elements + padded
void free()
free allocated memory and clear status variables
size_type nAllocated
number of elements allocated by myAlloc
size_type nLocal
number of elements

◆ capacity()

size_type capacity ( ) const
inline

return the physical size

Definition at line 206 of file VectorSoaContainer.h.

Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::move().

206 { return nGhosts; }
size_type nGhosts
number of elements + padded

◆ clear()

void clear ( )
inline

clear

Definition at line 141 of file VectorSoaContainer.h.

142  {
143  nLocal = 0;
144  nGhosts = 0;
145  }
size_type nGhosts
number of elements + padded
size_type nLocal
number of elements

◆ copyDeviceDataByIndex()

void copyDeviceDataByIndex ( unsigned  to,
unsigned  from 
)
inline

Definition at line 316 of file VectorSoaContainer.h.

Referenced by qmcplusplus::testDualAllocator().

317  {
318  auto* host_ptr = this->data();
319  auto offset_from = this->data(from) - host_ptr;
320  auto offset_to = this->data(to) - host_ptr;
321  auto nsize = this->size();
322  qmc_allocator_traits<Alloc>::deviceSideCopyN(mAllocator, offset_to, nsize, offset_from);
323  }
static void deviceSideCopyN(Allocator &a, size_t to, size_t n, size_t from)
size_type size() const
return the physical size

◆ copyIn()

void copyIn ( const Vector< TinyVector< T, D >> &  in)
inline

AoS to SoA : copy from Vector<TinyVector<>>

The same sizes are assumed.

Definition at line 212 of file VectorSoaContainer.h.

Referenced by VectorSoaContainer< ST, 5 >::operator=(), RealSpacePositions::setAllParticlePos(), RealSpacePositionsOMPTarget::setAllParticlePos(), qmcplusplus::TEST_CASE(), and VectorSoaContainer< ST, 5 >::VectorSoaContainer().

213  {
214  PosAoS2SoA(nLocal, D, reinterpret_cast<const T*>(in.first_address()), D, myData, nGhosts);
215  }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded
void PosAoS2SoA(int nrows, int ncols, const T *restrict iptr, int lda, T *restrict out, int ldb)
General conversion function from AoS[nrows][ncols] to SoA[ncols][ldb].
size_type nLocal
number of elements

◆ copyOut()

void copyOut ( Vector< TinyVector< T, D >> &  out) const
inline

SoA to AoS : copy to Vector<TinyVector<>>

The same sizes are assumed.

Definition at line 221 of file VectorSoaContainer.h.

222  {
223  PosSoA2AoS(nLocal, D, myData, nGhosts, reinterpret_cast<T*>(out.first_address()), D);
224  }
T * myData
pointer: what type????
void PosSoA2AoS(int nrows, int ncols, const T *restrict iptr, int lda, T *restrict out, int ldb)
General conversion function from SoA[ncols][ldb] to AoS[nrows][ncols].
size_type nGhosts
number of elements + padded
size_type nLocal
number of elements

◆ data() [1/4]

T* data ( )
inline

return the base

Definition at line 262 of file VectorSoaContainer.h.

Referenced by JeeIOrbitalSoA< FT >::acceptMove(), MomentumDistribution::accumulate(), TwoBodyJastrow< FT >::accumulateG(), J1OrbitalSoA< FT >::accumulateGL(), J1Spin< FT >::accumulateGL(), JeeIOrbitalSoA< FT >::computeU3(), JeeIOrbitalSoA< FT >::computeU3_engine(), VectorSoaContainer< ST, 5 >::copyDeviceDataByIndex(), MomentumEstimator::evaluate(), SoaDistanceTableABOMPTarget< T, D, SC >::evaluate(), LCAOrbitalSet::evaluate_ionderiv_v_impl(), LCAOrbitalSet::evaluate_ionderiv_v_row_impl(), LCAOrbitalSet::evaluate_ionderiv_vgl_impl(), LCAOrbitalSet::evaluate_vgh_impl(), LCAOrbitalSet::evaluate_vghgh_impl(), LCAOrbitalSet::evaluate_vgl_impl(), LCAOrbitalSet::evaluateDetRatios(), SoaCartesianTensor< T >::evaluateV(), SoaSphericalTensor< ST >::evaluateV(), SoaAtomicBasisSet< ROT, SH >::evaluateV(), LCAOrbitalSet::evaluateValue(), SoaAtomicBasisSet< ROT, SH >::evaluateVGH(), SoaAtomicBasisSet< ROT, SH >::evaluateVGHGH(), SoaCuspCorrection::evaluateVGL(), SoaAtomicBasisSet< ROT, SH >::evaluateVGL(), SoaDistanceTableAAOMPTarget< T, D, SC >::move(), RealSpacePositionsOMPTarget::mw_acceptParticlePos(), SoaSphericalTensor< ST >::operator[](), SoaCartesianTensor< T >::operator[](), JeeIOrbitalSoA< FT >::recompute(), JeeIOrbitalSoA< FT >::registerData(), qmcplusplus::testDualAllocator(), SoaDistanceTableAB< T, D, SC >::update(), SoaDistanceTableAA< T, D, SC >::update(), SoaDistanceTableABOMPTarget< T, D, SC >::update(), SoaDistanceTableAAOMPTarget< T, D, SC >::update(), SoaDistanceTableAA< T, D, SC >::updatePartial(), and SoaDistanceTableAAOMPTarget< T, D, SC >::updatePartial().

262 { return myData; }
T * myData
pointer: what type????

◆ data() [2/4]

const T* data ( ) const
inline

return the base

Definition at line 264 of file VectorSoaContainer.h.

264 { return myData; }
T * myData
pointer: what type????

◆ data() [3/4]

T* restrict data ( size_type  i)
inline

return the pointer of the i-th components

Definition at line 268 of file VectorSoaContainer.h.

268 { return myData + i * nGhosts; }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded

◆ data() [4/4]

const T* restrict data ( size_type  i) const
inline

return the const pointer of the i-th components

Definition at line 270 of file VectorSoaContainer.h.

270 { return myData + i * nGhosts; }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded

◆ device_data() [1/4]

T* device_data ( )
inline

return the base, device

Definition at line 279 of file VectorSoaContainer.h.

Referenced by qmcplusplus::testDualAllocator().

280  {
281  return mAllocator.get_device_ptr();
282  }

◆ device_data() [2/4]

const T* device_data ( ) const
inline

return the base, device

Definition at line 285 of file VectorSoaContainer.h.

286  {
287  return mAllocator.get_device_ptr();
288  }

◆ device_data() [3/4]

T* restrict device_data ( size_type  i)
inline

return the pointer of the i-th components, device

Definition at line 291 of file VectorSoaContainer.h.

292  {
293  return mAllocator.get_device_ptr() + i * nGhosts;
294  }
size_type nGhosts
number of elements + padded

◆ device_data() [4/4]

const T* restrict device_data ( size_type  i) const
inline

return the const pointer of the i-th components, device

Definition at line 297 of file VectorSoaContainer.h.

298  {
299  return mAllocator.get_device_ptr() + i * nGhosts;
300  }
size_type nGhosts
number of elements + padded

◆ end() [1/2]

T* end ( )
inline

return the end

Definition at line 272 of file VectorSoaContainer.h.

Referenced by JeeIOrbitalSoA< FT >::registerData().

272 { return myData + D * nGhosts; }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded

◆ end() [2/2]

const T* end ( ) const
inline

return the end

Definition at line 274 of file VectorSoaContainer.h.

274 { return myData + D * nGhosts; }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded

◆ free()

void free ( )
inline

free allocated memory and clear status variables

Definition at line 148 of file VectorSoaContainer.h.

Referenced by TwoBodyJastrow< FT >::acquireResource(), VectorSoaContainer< ST, 5 >::attachReference(), JeeIOrbitalSoA< FT >::registerData(), TwoBodyJastrow< FT >::releaseResource(), and VectorSoaContainer< ST, 5 >::~VectorSoaContainer().

149  {
150  if (nAllocated)
151  mAllocator.deallocate(myData, nAllocated);
152  nLocal = 0;
153  nGhosts = 0;
154  nAllocated = 0;
155  myData = nullptr;
156  }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded
size_type nAllocated
number of elements allocated by myAlloc
size_type nLocal
number of elements

◆ getNonConstData()

T* getNonConstData ( ) const
inline

return non_const data

Definition at line 266 of file VectorSoaContainer.h.

266 { return myData; }
T * myData
pointer: what type????

◆ isRefAttached()

bool isRefAttached ( ) const
inlineprivate

return true if memory is not owned by the container but from outside.

Definition at line 338 of file VectorSoaContainer.h.

Referenced by VectorSoaContainer< ST, 5 >::resize().

338 { return nGhosts * D > nAllocated; }
size_type nGhosts
number of elements + padded
size_type nAllocated
number of elements allocated by myAlloc

◆ operator()()

Accessor operator() ( size_type  i)
inline

access operator for assignment of the i-th value

Use for (*this)[i]=TinyVector<T,D>;

Definition at line 260 of file VectorSoaContainer.h.

260 { return Accessor(myData + i, nGhosts); }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded

◆ operator=() [1/3]

VectorSoaContainer& operator= ( const VectorSoaContainer< T, D, Alloc > &  in)
inline

default copy operator

Definition at line 61 of file VectorSoaContainer.h.

62  {
63  if (myData != in.myData)
64  {
65  if (nLocal != in.nLocal)
66  resize(in.nLocal);
67  std::copy_n(in.myData, nGhosts * D, myData);
68  }
69  return *this;
70  }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded
sycl::event copy_n(sycl::queue &aq, const T1 *restrict VA, size_t array_size, T2 *restrict VC, const std::vector< sycl::event > &events)
Definition: syclBLAS.cpp:548
void resize(size_type n)
resize myData
size_type nLocal
number of elements

◆ operator=() [2/3]

VectorSoaContainer& operator= ( const Vector< TinyVector< T1, D >> &  in)
inline

Definition at line 94 of file VectorSoaContainer.h.

95  {
96  resize(in.size());
97  copyIn(in);
98  return *this;
99  }
void copyIn(const Vector< TinyVector< T, D >> &in)
AoS to SoA : copy from Vector<TinyVector<>>
void resize(size_type n)
resize myData

◆ operator=() [3/3]

VectorSoaContainer& operator= ( const T1  in)
inline

need A=0.0;

Definition at line 104 of file VectorSoaContainer.h.

105  {
106  std::fill(myData, myData + nGhosts * D, static_cast<T>(in));
107  return *this;
108  }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded

◆ operator[]()

const AoSElement_t operator[] ( size_type  i) const
inline

return TinyVector<T,D>

Definition at line 228 of file VectorSoaContainer.h.

228 { return AoSElement_t(myData + i, nGhosts); }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded

◆ resize()

void resize ( size_type  n)
inline

resize myData

Parameters
nnLocal

nAllocated is used to ensure no memory leak

Definition at line 115 of file VectorSoaContainer.h.

Referenced by SoaAtomicBasisSet< ROT, SH >::finalize(), JeeIOrbitalSoA< FT >::init(), LCAOrbitalSet::LCAOrbitalSet(), MomentumDistribution::MomentumDistribution(), VectorSoaContainer< ST, 5 >::operator=(), MomentumEstimator::putSpecial(), RealSpacePositions::resize(), SoaDistanceTableAB< T, D, SC >::resize(), MomentumEstimator::resize(), SoaDistanceTableAA< T, D, SC >::resize(), SoaDistanceTableAAOMPTarget< T, D, SC >::resize(), SplineC2R< ST >::resize_kpoints(), SplineC2C< ST >::resize_kpoints(), SplineC2R< ST >::resizeStorage(), SplineR2R< ST >::resizeStorage(), SplineC2C< ST >::resizeStorage(), SplineC2COMPTarget< ST >::resizeStorage(), SplineC2ROMPTarget< ST >::resizeStorage(), SoaCartesianTensor< T >::SoaCartesianTensor(), SoaDistanceTableABOMPTarget< T, D, SC >::SoaDistanceTableABOMPTarget(), qmcplusplus::testDualAllocator(), and VectorSoaContainer< ST, 5 >::VectorSoaContainer().

116  {
117  static_assert(std::is_same<T, typename Alloc::value_type>::value,
118  "VectorSoaContainer and Alloc data types must agree!");
119  if (isRefAttached())
120  throw std::runtime_error("Resize not allowed on VectorSoaContainer constructed by initialized memory.");
121 
122  size_type n_padded = getAlignedSize<T, Alloc::alignment>(n);
123 
124  if (n_padded * D > nAllocated)
125  {
126  if (nAllocated)
127  mAllocator.deallocate(myData, nAllocated);
128  nLocal = n;
129  nGhosts = n_padded;
130  nAllocated = nGhosts * D;
131  myData = mAllocator.allocate(nAllocated);
132  }
133  else
134  {
135  nLocal = n;
136  nGhosts = n_padded;
137  }
138  }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded
bool isRefAttached() const
return true if memory is not owned by the container but from outside.
size_type nAllocated
number of elements allocated by myAlloc
size_type nLocal
number of elements

◆ size()

◆ updateFrom()

void updateFrom ( )
inline

Definition at line 309 of file VectorSoaContainer.h.

Referenced by qmcplusplus::testDualAllocator().

310  {
312  }
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded
static void updateFrom(Allocator &a, value_type *host_ptr, size_t n, size_t offset=0)

◆ updateTo()

void updateTo ( )
inline

Definition at line 304 of file VectorSoaContainer.h.

Referenced by qmcplusplus::testDualAllocator().

305  {
307  }
static void updateTo(Allocator &a, value_type *host_ptr, size_t n, size_t offset=0)
T * myData
pointer: what type????
size_type nGhosts
number of elements + padded

Friends And Related Function Documentation

◆ qmcplusplus::Vector< T, Alloc >

friend class qmcplusplus::Vector< T, Alloc >
friend

Definition at line 342 of file VectorSoaContainer.h.

◆ VectorSoaContainer

friend struct VectorSoaContainer
friend

Definition at line 345 of file VectorSoaContainer.h.

Member Data Documentation

◆ mAllocator

◆ myData

◆ nAllocated

◆ nGhosts

◆ nLocal


The documentation for this struct was generated from the following file: