|
PSCF v1.5.0
|
Field of real values on a regular mesh, allocated on a GPU device. More...
#include <RField.h>
Public Member Functions | |
| RField () | |
| Default constructor. | |
| RField (IntVec< D > const &meshDimensions) | |
| Allocating constructor. | |
| RField (RField< D, CUT > const &other) | |
| Copy constructor. | |
| virtual | ~RField () |
| Destructor. | |
| void | allocate (IntVec< D > const &meshDimensions) |
| Allocate the underlying array for data on a regular mesh. | |
| void | deallocate () |
| Deallocate the underlying array. | |
| void | associate (BackendArray< cudaReal, CUT > &arr, int beginId, IntVec< D > const &meshDimensions) |
| Associate this object with a slice of another BackendArray. | |
| RField< D, CUT > & | operator= (RField< D, CUT > const &other) |
| Assignment operator, assignment from another RField. | |
| RField< D, CUT > & | operator= (HostSendArray< cudaReal, CUT > const &other) |
| Assignment from a HostSendArray<cudaReal,CUT>. | |
| IntVec< D > const & | meshDimensions () const |
| Return mesh dimensions by constant reference. | |
| template<class Archive> | |
| void | serialize (Archive &ar, const unsigned int version) |
| Serialize a Field to/from an Archive. | |
Field of real values on a regular mesh, allocated on a GPU device.
Type cudaReal is float or double, depending on preprocessor macro.
Definition at line 34 of file cuda/RField.h.
| Pscf::RField< D, CUT >::RField | ( | ) |
Default constructor.
Definition at line 22 of file cuda/RField.tpp.
References RField().
Referenced by allocate(), associate(), deallocate(), meshDimensions(), operator=(), operator=(), RField(), RField(), RField(), serialize(), and ~RField().
| Pscf::RField< D, CUT >::RField | ( | IntVec< D > const & | meshDimensions | ) |
Allocating constructor.
Allocates memory by calling allocate(meshDimensions) internally.
| meshDimensions | number of grid points in each dimension |
Definition at line 30 of file cuda/RField.tpp.
References allocate(), meshDimensions(), and RField().
| Pscf::RField< D, CUT >::RField | ( | RField< D, CUT > const & | other | ) |
Copy constructor.
Allocates new memory and copies all elements by value.
| other | the RField to be copied. |
Definition at line 38 of file cuda/RField.tpp.
References RField().
|
virtual |
Destructor.
Deletes underlying C array, if allocated previously.
Definition at line 47 of file cuda/RField.tpp.
References RField().
| void Pscf::RField< D, CUT >::allocate | ( | IntVec< D > const & | meshDimensions | ) |
Allocate the underlying array for data on a regular mesh.
| meshDimensions | number of grid points in each dimension |
Definition at line 54 of file cuda/RField.tpp.
References meshDimensions(), RField(), and UTIL_CHECK.
Referenced by RField(), and serialize().
| void Pscf::RField< D, CUT >::deallocate | ( | ) |
Deallocate the underlying array.
Definition at line 69 of file cuda/RField.tpp.
References RField().
| void Pscf::RField< D, CUT >::associate | ( | BackendArray< cudaReal, CUT > & | arr, |
| int | beginId, | ||
| IntVec< D > const & | meshDimensions ) |
Associate this object with a slice of another BackendArray.
| Exception | if the array is already allocated. |
| arr | parent array that owns the data |
| beginId | index in the parent array at which this array starts |
| meshDimensions | number of grid points in each dimension |
Definition at line 81 of file cuda/RField.tpp.
References meshDimensions(), RField(), and UTIL_CHECK.
| RField< D, CUT > & Pscf::RField< D, CUT >::operator= | ( | RField< D, CUT > const & | other | ) |
Assignment operator, assignment from another RField.
Performs a deep copy, by copying all elements of the RHS RField from device memory to device memory, and copying the meshDimensions.
The RHS RField must be allocated on entry. If this LHS object is not allocated, allocate with the required capacity. If the LHS and RHS arrays are both allocated, capacity values must be equal.
| other | the RHS RField |
Definition at line 99 of file cuda/RField.tpp.
References RField().
| RField< D, CUT > & Pscf::RField< D, CUT >::operator= | ( | HostSendArray< cudaReal, CUT > const & | other | ) |
Assignment from a HostSendArray<cudaReal,CUT>.
Performs a deep copy, by copying all elements of the RHS RField from host memory to device memory.
The RHS HostSendArray<cudaReal,CUT> and LHS RField must both be allocated with equal capacity values on entry.
| other | the RHS HostSendArray<cudaReal,CUT> |
Definition at line 112 of file cuda/RField.tpp.
References RField(), and UTIL_CHECK.
|
inline |
Return mesh dimensions by constant reference.
Definition at line 173 of file cuda/RField.h.
References RField().
Referenced by allocate(), associate(), and RField().
| void Pscf::RField< D, CUT >::serialize | ( | Archive & | ar, |
| const unsigned int | version ) |
Serialize a Field to/from an Archive.
| ar | archive |
| version | archive version id |
Definition at line 181 of file cuda/RField.h.
References allocate(), RField(), and UTIL_THROW.