|
PSCF v1.5.0
|
Field of complex values on a regular mesh, allocated on a GPU device. More...
#include <CField.h>
Public Member Functions | |
| CField () | |
| Default constructor. | |
| CField (IntVec< D > const &meshDimensions) | |
| Allocating constructor. | |
| CField (CField< D, CUT > const &other) | |
| Copy constructor. | |
| virtual | ~CField () |
| Destructor. | |
| void | allocate (IntVec< D > const &meshDimensions) |
| Allocate the underlying C array for data on a regular mesh. | |
| void | deallocate () |
| Deallocate the underlying array. | |
| void | associate (BackendArray< cudaComplex, CUT > &arr, int beginId, IntVec< D > const &meshDimensions) |
| Associate this object with a slice of another BackendArray. | |
| CField< D, CUT > & | operator= (CField< D, CUT > const &other) |
| Assignment operator, assignment from another CField<D,CUT>. | |
| CField< D, CUT > & | operator= (HostSendArray< cudaComplex, CUT > const &other) |
| Assignment operator, assignment from a HostSendArray<cudaComplex,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 complex values on a regular mesh, allocated on a GPU device.
Definition at line 32 of file cuda/CField.h.
| Pscf::CField< D, CUT >::CField | ( | ) |
Default constructor.
Definition at line 21 of file cuda/CField.tpp.
References CField().
Referenced by allocate(), associate(), CField(), CField(), CField(), deallocate(), meshDimensions(), operator=(), operator=(), serialize(), and ~CField().
| Pscf::CField< D, CUT >::CField | ( | IntVec< D > const & | meshDimensions | ) |
Allocating constructor.
Calls allocate(meshDimension) internally.
| meshDimensions | numbers of grid points in each dimension |
Definition at line 29 of file cuda/CField.tpp.
References allocate(), CField(), and meshDimensions().
| Pscf::CField< D, CUT >::CField | ( | CField< D, CUT > const & | other | ) |
Copy constructor.
Allocates new memory and copies all elements by value.
| other | the CField to be copied. |
Definition at line 37 of file cuda/CField.tpp.
References CField().
|
virtual |
Destructor.
Deletes underlying C array, if allocated previously.
Definition at line 46 of file cuda/CField.tpp.
References CField().
| void Pscf::CField< D, CUT >::allocate | ( | IntVec< D > const & | meshDimensions | ) |
Allocate the underlying C array for data on a regular mesh.
| meshDimensions | number of grid points in each dimension |
Definition at line 53 of file cuda/CField.tpp.
References CField(), meshDimensions(), and UTIL_CHECK.
Referenced by CField(), and serialize().
| void Pscf::CField< D, CUT >::deallocate | ( | ) |
Deallocate the underlying array.
Definition at line 68 of file cuda/CField.tpp.
References CField().
| void Pscf::CField< D, CUT >::associate | ( | BackendArray< cudaComplex, 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 80 of file cuda/CField.tpp.
References CField(), meshDimensions(), and UTIL_CHECK.
| CField< D, CUT > & Pscf::CField< D, CUT >::operator= | ( | CField< D, CUT > const & | other | ) |
Assignment operator, assignment from another CField<D,CUT>.
Performs a deep copy, by copying all elements of the RHS CField<D,CUT> from device memory to device memory.
The RHS CField must be allocated. If this LHS CField is not allocated on entry, allocate it before copying elements. If both LHS and RHS objects are allocated on entry, the capacities must be equal.
| other | the RHS CField<D,CUT> |
Definition at line 98 of file cuda/CField.tpp.
References CField().
| CField< D, CUT > & Pscf::CField< D, CUT >::operator= | ( | HostSendArray< cudaComplex, CUT > const & | other | ) |
Assignment operator, assignment from a HostSendArray<cudaComplex,CUT>.
Performs a deep copy, by copying all elements of the RHS CField<D,CUT> from host memory to device memory.
The RHS HostSendArray<cudaComplex,CUT> and LHS CField<D,CUT> must both be allocated with equal capacity values on entry.
| other | the RHS HostSendArray<cudaComplex,CUT> |
Definition at line 110 of file cuda/CField.tpp.
References CField(), and UTIL_THROW.
|
inline |
Return mesh dimensions by constant reference.
Definition at line 156 of file cuda/CField.h.
References CField().
Referenced by allocate(), associate(), and CField().
| void Pscf::CField< 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 164 of file cuda/CField.h.
References allocate(), CField(), and UTIL_THROW.