DFT-EFE
 
Loading...
Searching...
No Matches
dftefe::utils::MemoryStorage< ValueType, memorySpace > Class Template Reference

#include <MemoryStorage.h>

Public Types

typedef ValueType value_type
 A class template to provide an interface that can act similar to STL vectors but with different MemorySpace— HOST (cpu) , DEVICE (gpu), etc,. More...
 
typedef ValueType * pointer
 
typedef ValueType & reference
 
typedef const ValueType & const_reference
 
typedef ValueType * iterator
 
typedef const ValueType * const_iterator
 

Public Member Functions

 MemoryStorage ()=default
 
 MemoryStorage (const MemoryStorage &u)
 Copy constructor for a MemoryStorage. More...
 
 MemoryStorage (MemoryStorage &&u) noexcept
 Move constructor for a Vector. More...
 
 MemoryStorage (size_type size, ValueType initVal=ValueType())
 Constructor for Vector with size and initial value arguments. More...
 
 ~MemoryStorage ()
 Destructor. More...
 
void setValue (const ValueType val)
 Set all the entries to a given value. More...
 
iterator begin ()
 Return iterator pointing to the beginning of point data. More...
 
const_iterator begin () const
 Return iterator pointing to the beginning of Vector data. More...
 
iterator end ()
 Return iterator pointing to the end of Vector data. More...
 
const_iterator end () const
 Return iterator pointing to the end of Vector data. More...
 
MemoryStorageoperator= (const MemoryStorage &rhs)
 Copy assignment operator. More...
 
MemoryStorageoperator= (MemoryStorage &&rhs) noexcept
 Move assignment constructor. More...
 
void resize (size_type size, ValueType initVal=ValueType())
 Deallocates and then resizes Vector with new size and initial value arguments. More...
 
size_type size () const
 Returns the dimension of the Vector. More...
 
ValueType * data () noexcept
 Return the raw pointer to the Vector. More...
 
const ValueType * data () const noexcept
 Return the raw pointer to the Vector without modifying the values. More...
 
template<dftefe::utils::MemorySpace memorySpaceDst>
void copyTo (MemoryStorage< ValueType, memorySpaceDst > &dstMemoryStorage) const
 Copies the data to a MemoryStorage object in a different memory space. This provides a seamless interface to copy back and forth between memory spaces , including between the same memory spaces. More...
 
template<dftefe::utils::MemorySpace memorySpaceDst>
void copyTo (MemoryStorage< ValueType, memorySpaceDst > &dstMemoryStorage, const size_type N, const size_type srcOffset, const size_type dstOffset) const
 Copies the data to a MemoryStorage object in a different memory space. This provides a seamless interface to copy back and forth between memory spaces , including between the same memory spaces. This is a more granular version of the above copyTo function as it provides transfer from a specific portion of the source MemoryStorage to a specific portion of the destination MemoryStorage. More...
 
template<dftefe::utils::MemorySpace memorySpaceSrc>
void copyFrom (const MemoryStorage< ValueType, memorySpaceSrc > &srcMemoryStorage)
 Copies data from a MemoryStorage object in a different memory space. This provides a seamless interface to copy back and forth between memory spaces, including between the same memory spaces. More...
 
template<dftefe::utils::MemorySpace memorySpaceSrc>
void copyFrom (MemoryStorage< ValueType, memorySpaceSrc > &srcMemoryStorage, const size_type N, const size_type srcOffset, const size_type dstOffset)
 Copies data from a MemoryStorage object in a different memory space. This provides a seamless interface to copy back and forth between memory spaces, including between the same memory spaces. This is a more granular version of the above copyFrom function as it provides transfer from a specific portion of the source MemoryStorage to a specific portion of the destination MemoryStorage. More...
 
template<dftefe::utils::MemorySpace memorySpaceDst>
void copyTo (ValueType *dst) const
 Copies the data to a memory pointed by a raw pointer This provides a seamless interface to copy back and forth between memory spaces, including between the same memory spaces. More...
 
template<dftefe::utils::MemorySpace memorySpaceDst>
void copyTo (ValueType *dst, const size_type N, const size_type srcOffset, const size_type dstOffset) const
 Copies the data to a memory pointer by a raw pointer. This provides a seamless interface to copy back and forth between memory spaces , including between the same memory spaces. This is a more granular version of the above copyTo function as it provides transfer from a specific portion of the source MemoryStorage to a specific portion of the destination pointer. More...
 
template<dftefe::utils::MemorySpace memorySpaceSrc>
void copyFrom (const ValueType *src)
 Copies data from a memory pointed by a raw pointer into the MemoryStorage object. This provides a seamless interface to copy back and forth between memory spaces, including between the same memory spaces. More...
 
template<dftefe::utils::MemorySpace memorySpaceSrc>
void copyFrom (const ValueType *src, const size_type N, const size_type srcOffset, const size_type dstOffset)
 Copies data from a memory pointer by a raw pointer into the MemoryStorage object. This provides a seamless interface to copy back and forth between memory spaces, including between the same memory spaces. This is a more granular version of the above copyFrom function as it provides transfer from a specific portion of the source memory to a specific portion of the destination MemoryStorage. More...
 
void copyTo (std::vector< ValueType > &dst) const
 Copies the data to a C++ STL vector, which always resides in the CPU. This provides a seamless interface to copy from any memory space to a C++ STL vector, including the case where source memory space is HOST (i.e., it resides on the CPU) More...
 
void copyTo (std::vector< ValueType > &dst, const size_type N, const size_type srcOffset, const size_type dstOffset) const
 Copies the data to a C++ STL vector, which always resides in the CPU. This provides a seamless interface to copy from any memory space to a C++ STL vector, including the case where source memory space is HOST (i.e., it resides on the CPU). This is a more granular version of the above copyToSTL function as it provides transfer from a specific portion of the MemoryStorage to a specific portion of the destination STL vector. More...
 
void copyFrom (const std::vector< ValueType > &src)
 Copies data from a C++ STL vector to the MemoryStorage object, which always resides on a CPU. This provides a seamless interface to copy from any memory space, including the case where the same memory spaces is HOST(i.e., the MemoryStorage is on CPU). More...
 
void copyFrom (const std::vector< ValueType > &src, const size_type N, const size_type srcOffset, const size_type dstOffset)
 Copies data from a C++ STL vector to the MemoryStorage object, which always resides on a CPU. This provides a seamless interface to copy from any memory space, including the case where the same memory spaces is HOST(i.e., the MemoryStorage is on CPU). This is a more granular version of the above copyFromSTL function as it provides transfer from a specific portion of the source STL vector to to a specific portion of the destination MemoryStorage. More...
 

Private Attributes

ValueType * d_data = nullptr
 
size_type d_size = 0
 

Member Typedef Documentation

◆ const_iterator

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
typedef const ValueType* dftefe::utils::MemoryStorage< ValueType, memorySpace >::const_iterator

◆ const_reference

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
typedef const ValueType& dftefe::utils::MemoryStorage< ValueType, memorySpace >::const_reference

◆ iterator

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
typedef ValueType* dftefe::utils::MemoryStorage< ValueType, memorySpace >::iterator

◆ pointer

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
typedef ValueType* dftefe::utils::MemoryStorage< ValueType, memorySpace >::pointer

◆ reference

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
typedef ValueType& dftefe::utils::MemoryStorage< ValueType, memorySpace >::reference

◆ value_type

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
typedef ValueType dftefe::utils::MemoryStorage< ValueType, memorySpace >::value_type

A class template to provide an interface that can act similar to STL vectors but with different MemorySpace— HOST (cpu) , DEVICE (gpu), etc,.

Template Parameters
ValueTypeThe underlying value type for the MemoryStorage (e.g., int, double, complex<double>, etc.)
memorySpaceThe memory space in which the MemoryStorage needs to reside

Constructor & Destructor Documentation

◆ MemoryStorage() [1/4]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::utils::MemoryStorage< ValueType, memorySpace >::MemoryStorage ( )
default

◆ MemoryStorage() [2/4]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::utils::MemoryStorage< ValueType, memorySpace >::MemoryStorage ( const MemoryStorage< ValueType, memorySpace > &  u)

Copy constructor for a MemoryStorage.

Parameters
[in]uMemoryStorage object to copy from

◆ MemoryStorage() [3/4]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::utils::MemoryStorage< ValueType, memorySpace >::MemoryStorage ( MemoryStorage< ValueType, memorySpace > &&  u)
noexcept

Move constructor for a Vector.

Parameters
[in]uVector object to move from

◆ MemoryStorage() [4/4]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::utils::MemoryStorage< ValueType, memorySpace >::MemoryStorage ( size_type  size,
ValueType  initVal = ValueType() 
)
explicit

Constructor for Vector with size and initial value arguments.

Parameters
[in]sizesize of the Vector
[in]initValinitial value of elements of the Vector
Here is the call graph for this function:

◆ ~MemoryStorage()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::utils::MemoryStorage< ValueType, memorySpace >::~MemoryStorage

Destructor.

Member Function Documentation

◆ begin() [1/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
MemoryStorage< ValueType, memorySpace >::iterator dftefe::utils::MemoryStorage< ValueType, memorySpace >::begin

Return iterator pointing to the beginning of point data.

Returns
Iterator pointing to the beginning of Vector.
Here is the caller graph for this function:

◆ begin() [2/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
MemoryStorage< ValueType, memorySpace >::const_iterator dftefe::utils::MemoryStorage< ValueType, memorySpace >::begin

Return iterator pointing to the beginning of Vector data.

Returns
Constant iterator pointing to the beginning of Vector.

◆ copyFrom() [1/6]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
template<dftefe::utils::MemorySpace memorySpaceSrc>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::copyFrom ( const MemoryStorage< ValueType, memorySpaceSrc > &  srcMemoryStorage)

Copies data from a MemoryStorage object in a different memory space. This provides a seamless interface to copy back and forth between memory spaces, including between the same memory spaces.

Note
The MemoryStorage must be pre-allocated appropriately
Template Parameters
memorySpaceSrcmemory space of the source MemoryStorage from which to copy
Parameters
[in]srcMemoryStoragereference to the source MemoryStorage
Exceptions
utils::LengthErrorexception if the size of underlying MemoryStorage is less than size of srcMemoryStorage
Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyFrom() [2/6]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::copyFrom ( const std::vector< ValueType > &  src)

Copies data from a C++ STL vector to the MemoryStorage object, which always resides on a CPU. This provides a seamless interface to copy from any memory space, including the case where the same memory spaces is HOST(i.e., the MemoryStorage is on CPU).

Parameters
[in]srcconst reference to the source C++ STL vector from which the data needs to be copied.
Exceptions
utils::LengthErrorexception if the size of the MemoryStorage is less than the size of the src
Here is the call graph for this function:

◆ copyFrom() [3/6]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::copyFrom ( const std::vector< ValueType > &  src,
const size_type  N,
const size_type  srcOffset,
const size_type  dstOffset 
)

Copies data from a C++ STL vector to the MemoryStorage object, which always resides on a CPU. This provides a seamless interface to copy from any memory space, including the case where the same memory spaces is HOST(i.e., the MemoryStorage is on CPU). This is a more granular version of the above copyFromSTL function as it provides transfer from a specific portion of the source STL vector to to a specific portion of the destination MemoryStorage.

Parameters
[in]srcconst reference to the source C++ STL vector from which the data needs to be copied.
[in]Nnumber of entries of the source pointer that needs to be copied to the destination MemoryStorage
[in]srcOffsetoffset relative to the start of the source STL vector from which we need to copy data
[in]dstOffsetoffset relative to the start of the destination MemoryStorage to which we need to copy data
Exceptions
utils::LengthErrorexception if the size of src is less than N + srcOffset
utils::LengthErrorexception if the size of the MemoryStorage is less thant N + dstOffset

◆ copyFrom() [4/6]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
template<dftefe::utils::MemorySpace memorySpaceSrc>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::copyFrom ( const ValueType *  src)

Copies data from a memory pointed by a raw pointer into the MemoryStorage object. This provides a seamless interface to copy back and forth between memory spaces, including between the same memory spaces.

Note
The src pointer must point to a memory chunk that is at least the size of the MemoryStorage
Template Parameters
memorySpaceSrcmemory space of the source pointer from which to copy
Parameters
[in]srcpointer to the source memory
Here is the call graph for this function:

◆ copyFrom() [5/6]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
template<dftefe::utils::MemorySpace memorySpaceSrc>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::copyFrom ( const ValueType *  src,
const size_type  N,
const size_type  srcOffset,
const size_type  dstOffset 
)

Copies data from a memory pointer by a raw pointer into the MemoryStorage object. This provides a seamless interface to copy back and forth between memory spaces, including between the same memory spaces. This is a more granular version of the above copyFrom function as it provides transfer from a specific portion of the source memory to a specific portion of the destination MemoryStorage.

Note
The src pointer must point to a memory chunk that is at least the size of N + srcOffset
Template Parameters
memorySpaceSrcmemory space of the source pointer from which to copy
Parameters
[in]srcpointer to the source memory
[in]Nnumber of entries of the source pointer that needs to be copied to the destination MemoryStorage
[in]srcOffsetoffset relative to the start of the source pointer from which we need to copy data
[in]dstOffsetoffset relative to the start of the destination MemoryStorage to which we need to copy data
Exceptions
utils::LengthErrorexception if the size of the MemoryStorage is less than N + dstOffset
Here is the call graph for this function:

◆ copyFrom() [6/6]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
template<dftefe::utils::MemorySpace memorySpaceSrc>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::copyFrom ( MemoryStorage< ValueType, memorySpaceSrc > &  srcMemoryStorage,
const size_type  N,
const size_type  srcOffset,
const size_type  dstOffset 
)

Copies data from a MemoryStorage object in a different memory space. This provides a seamless interface to copy back and forth between memory spaces, including between the same memory spaces. This is a more granular version of the above copyFrom function as it provides transfer from a specific portion of the source MemoryStorage to a specific portion of the destination MemoryStorage.

Note
The MemoryStorage must be pre-allocated appropriately
Template Parameters
memorySpaceSrcmemory space of the source MemoryStorage from which to copy
Parameters
[in]srcMemoryStoragereference to the source MemoryStorage
[in]Nnumber of entries of the source MemoryStorage that needs to be copied to the destination MemoryStorage
[in]srcOffsetoffset relative to the start of the source MemoryStorage from which we need to copy data
[in]dstOffsetoffset relative to the start of the destination MemoryStorage to which we need to copy data
Exceptions
utils::LengthErrorexception if the size of srcMemoryStorage is less than N + srcOffset
utils::LengthErrorexception if the size of underlying MemoryStorage is less than N + dstOffset

◆ copyTo() [1/6]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
template<dftefe::utils::MemorySpace memorySpaceDst>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::copyTo ( MemoryStorage< ValueType, memorySpaceDst > &  dstMemoryStorage) const

Copies the data to a MemoryStorage object in a different memory space. This provides a seamless interface to copy back and forth between memory spaces , including between the same memory spaces.

Note
The destination MemoryStorage must be pre-allocated appropriately
Template Parameters
memorySpaceDstmemory space of the destination MemoryStorage
Parameters
[in]dstMemoryStoragereference to the destination MemoryStorage. It must be pre-allocated appropriately
[out]dstMemoryStoragereference to the destination MemoryStorage with the data copied into it
Exceptions
utils::LengthErrorexception if the size of dstMemoryStorage is less than underlying MemoryStorage
Here is the call graph for this function:

◆ copyTo() [2/6]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
template<dftefe::utils::MemorySpace memorySpaceDst>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::copyTo ( MemoryStorage< ValueType, memorySpaceDst > &  dstMemoryStorage,
const size_type  N,
const size_type  srcOffset,
const size_type  dstOffset 
) const

Copies the data to a MemoryStorage object in a different memory space. This provides a seamless interface to copy back and forth between memory spaces , including between the same memory spaces. This is a more granular version of the above copyTo function as it provides transfer from a specific portion of the source MemoryStorage to a specific portion of the destination MemoryStorage.

Note
The destination MemoryStorage must be pre-allocated appropriately
Template Parameters
memorySpaceDstmemory space of the destination MemoryStorage
Parameters
[in]dstMemoryStoragereference to the destination MemoryStorage. It must be pre-allocated appropriately
[in]Nnumber of entries of the source MemoryStorage that needs to be copied to the destination MemoryStorage
[in]srcOffsetoffset relative to the start of the source MemoryStorage from which we need to copy data
[in]dstOffsetoffset relative to the start of the destination MemoryStorage to which we need to copy data
[out]dstMemoryStoragereference to the destination MemoryStorage with the data copied into it
Exceptions
utils::LengthErrorexception if the size of dstMemoryStorage is less than N + dstOffset
utils::LengthErrorexception if the size of underlying MemoryStorage is less than N + srcOffset
Here is the call graph for this function:

◆ copyTo() [3/6]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::copyTo ( std::vector< ValueType > &  dst) const

Copies the data to a C++ STL vector, which always resides in the CPU. This provides a seamless interface to copy from any memory space to a C++ STL vector, including the case where source memory space is HOST (i.e., it resides on the CPU)

Parameters
[in]dstreference to the destination C++ STL vector to which the data needs to be copied.
[out]dstreference to the destination C++ STL vector with the data copied into it
Note
If the size of the dst vector is less than the the size of the underlying MemoryStorage, it will be resized. Thus, for performance reasons, it is recommened that the dst STL vector be pre-allocated appropriately.

◆ copyTo() [4/6]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::copyTo ( std::vector< ValueType > &  dst,
const size_type  N,
const size_type  srcOffset,
const size_type  dstOffset 
) const

Copies the data to a C++ STL vector, which always resides in the CPU. This provides a seamless interface to copy from any memory space to a C++ STL vector, including the case where source memory space is HOST (i.e., it resides on the CPU). This is a more granular version of the above copyToSTL function as it provides transfer from a specific portion of the MemoryStorage to a specific portion of the destination STL vector.

Parameters
[in]dstreference to the destination C++ STL vector to which the data needs to be copied.
Note
If the size of the dst vector is less than the the size of the underlying memory storage, it will be resized. Thus, for performance reasons it is recommened to should be allocated appropriately.
Parameters
[in]Nnumber of entries of the source MemoryStorage that needs to be copied to the destination pointer
[in]srcOffsetoffset relative to the start of the source MemoryStorage from which we need to copy data
[in]dstOffsetoffset relative to the start of the STL vector to which we need to copy data
[out]dstreference to the destination C++ STL vector with the data copied into it
Exceptions
utils::LengthErrorexception if the size of the MemoryStorage is less than N + srcOffset
Note
If the size of the dst vector is less N + srcOffset, it will be resized. Thus, for performance reasons, it is recommened that the dst STL vector be allocated appropriately.
Here is the call graph for this function:

◆ copyTo() [5/6]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
template<dftefe::utils::MemorySpace memorySpaceDst>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::copyTo ( ValueType *  dst) const

Copies the data to a memory pointed by a raw pointer This provides a seamless interface to copy back and forth between memory spaces, including between the same memory spaces.

Note
The destination pointer must be pre-allocated to be at least of the size of the MemoryStorage
Template Parameters
memorySpaceDstmemory space of the destination pointer
Parameters
[in]dstpointer to the destination. It must be pre-allocated appropriately
[out]dstpointer to the destination with the data copied into it
Here is the call graph for this function:

◆ copyTo() [6/6]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
template<dftefe::utils::MemorySpace memorySpaceDst>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::copyTo ( ValueType *  dst,
const size_type  N,
const size_type  srcOffset,
const size_type  dstOffset 
) const

Copies the data to a memory pointer by a raw pointer. This provides a seamless interface to copy back and forth between memory spaces , including between the same memory spaces. This is a more granular version of the above copyTo function as it provides transfer from a specific portion of the source MemoryStorage to a specific portion of the destination pointer.

Note
The destination pointer must be pre-allocated to be at least of the size N + dstOffset
Template Parameters
memorySpaceDstmemory space of the destination pointer
Parameters
[in]dstpointer to the destination. It must be pre-allocated appropriately
[in]Nnumber of entries of the source MemoryStorage that needs to be copied to the destination pointer
[in]srcOffsetoffset relative to the start of the source MemoryStorage from which we need to copy data
[in]dstOffsetoffset relative to the start of the destination pointer to which we need to copy data
[out]dstpointer to the destination with the data copied into it
Exceptions
utils::LengthErrorexception if the size of the MemoryStorage is less than N + srcOffset

◆ data() [1/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
const ValueType * dftefe::utils::MemoryStorage< ValueType, memorySpace >::data
noexcept

Return the raw pointer to the Vector without modifying the values.

Returns
pointer to const data

◆ data() [2/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
ValueType * dftefe::utils::MemoryStorage< ValueType, memorySpace >::data
noexcept

Return the raw pointer to the Vector.

Returns
pointer to data

◆ end() [1/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
MemoryStorage< ValueType, memorySpace >::iterator dftefe::utils::MemoryStorage< ValueType, memorySpace >::end

Return iterator pointing to the end of Vector data.

Returns
Iterator pointing to the end of Vector.

◆ end() [2/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
MemoryStorage< ValueType, memorySpace >::const_iterator dftefe::utils::MemoryStorage< ValueType, memorySpace >::end

Return iterator pointing to the end of Vector data.

Returns
Constant iterator pointing to the end of Vector.

◆ operator=() [1/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
MemoryStorage< ValueType, memorySpace > & dftefe::utils::MemoryStorage< ValueType, memorySpace >::operator= ( const MemoryStorage< ValueType, memorySpace > &  rhs)

Copy assignment operator.

Parameters
[in]rhsthe rhs Vector from which to copy
Returns
reference to the lhs Vector

◆ operator=() [2/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
MemoryStorage< ValueType, memorySpace > & dftefe::utils::MemoryStorage< ValueType, memorySpace >::operator= ( MemoryStorage< ValueType, memorySpace > &&  rhs)
noexcept

Move assignment constructor.

Parameters
[in]rhsthe rhs Vector from which to move
Returns
reference to the lhs Vector

◆ resize()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::resize ( size_type  size,
ValueType  initVal = ValueType() 
)

Deallocates and then resizes Vector with new size and initial value arguments.

Parameters
[in]sizesize of the Vector
[in]initValinitial value of elements of the Vector
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setValue()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::utils::MemoryStorage< ValueType, memorySpace >::setValue ( const ValueType  val)

Set all the entries to a given value.

Parameters
[in]valThe value to which the entries are to be set

◆ size()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
size_type dftefe::utils::MemoryStorage< ValueType, memorySpace >::size

Returns the dimension of the Vector.

Returns
size of the Vector
Here is the caller graph for this function:

Member Data Documentation

◆ d_data

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
ValueType* dftefe::utils::MemoryStorage< ValueType, memorySpace >::d_data = nullptr
private

◆ d_size

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
size_type dftefe::utils::MemoryStorage< ValueType, memorySpace >::d_size = 0
private

The documentation for this class was generated from the following files: