PSCF v1.1
|
Field of real single precision values on an FFT mesh on a device. More...
#include <RDField.h>
Public Member Functions | |
RDField () | |
Default constructor. More... | |
RDField (const RDField &other) | |
Copy constructor. More... | |
virtual | ~RDField () |
Destructor. More... | |
RDField & | operator= (const RDField &other) |
Assignment operator. More... | |
void | allocate (const IntVec< D > &meshDimensions) |
Allocate the underlying C array for an FFT grid. More... | |
const IntVec< D > & | meshDimensions () const |
Return mesh dimensions by constant reference. More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize a Field to/from an Archive. More... | |
![]() | |
DField () | |
Default constructor. More... | |
DField (const DField &other) | |
Copy constructor. More... | |
virtual | ~DField () |
Destructor. More... | |
void | allocate (int capacity) |
Allocate the underlying C array on the device. More... | |
void | deallocate () |
Dellocate the underlying C array. More... | |
bool | isAllocated () const |
Return true if the Field has been allocated, false otherwise. More... | |
int | capacity () const |
Return allocated size. More... | |
cudaReal * | cDField () |
Return pointer to underlying C array. More... | |
const cudaReal * | cDField () const |
Return pointer to const to underlying C array. More... | |
virtual DField< cudaReal > & | operator= (const DField< cudaReal > &other) |
Assignment operator. More... | |
Additional Inherited Members | |
![]() | |
cudaReal * | data_ |
Pointer to an array of Data elements on the device / GPU. More... | |
int | capacity_ |
Allocated size of the data_ array. More... | |
Field of real single precision values on an FFT mesh on a device.
cudaReal = float or double, depending on preprocessor macro.
Pscf::Pspg::RDField< D >::RDField |
Default constructor.
Definition at line 23 of file RDField.tpp.
Pscf::Pspg::RDField< D >::RDField | ( | const RDField< D > & | other | ) |
Copy constructor.
Allocates new memory and copies all elements by value.
other | the RField to be copied. |
Definition at line 42 of file RDField.tpp.
|
virtual |
Destructor.
Deletes underlying C array, if allocated previously.
Definition at line 31 of file RDField.tpp.
RDField< D > & Pscf::Pspg::RDField< D >::operator= | ( | const RDField< D > & | other | ) |
Assignment operator.
If this Field is not allocated, launch a kernel to swap memory.
If this and the other Field are both allocated, the capacities must be exactly equal. If so, this method copies all elements.
other | the RHS RField |
Definition at line 60 of file RDField.tpp.
References Pscf::Pspg::DField< Data >::operator=().
void Pscf::Pspg::RDField< D >::allocate | ( | const IntVec< D > & | meshDimensions | ) |
Allocate the underlying C array for an FFT grid.
Exception | if the RField is already allocated. |
meshDimensions | number of grid points in each direction |
Definition at line 108 of file RDField.h.
References Pscf::Pspg::DField< Data >::allocate(), and UTIL_CHECK.
Referenced by Pscf::Pspg::FFT< D >::setup(), Pscf::Pspg::System< D >::writeQ(), Pscf::Pspg::System< D >::writeQSlice(), and Pscf::Pspg::System< D >::writeQTail().
|
inline |
Return mesh dimensions by constant reference.
Definition at line 123 of file RDField.h.
Referenced by Pscf::Pspg::FFT< D >::inverseTransform(), Pscf::Pspg::FFT< D >::setup(), and Pscf::Pspg::FFTBatched< D >::setup().
void Pscf::Pspg::RDField< D >::serialize | ( | Archive & | ar, |
const unsigned int | version | ||
) |
Serialize a Field to/from an Archive.
ar | archive |
version | archive version id |
Definition at line 131 of file RDField.h.
References UTIL_THROW.