PSCF v1.1
|
Dynamic array on the GPU with alligned data. More...
#include <DField.h>
Public Member Functions | |
DField () | |
Default 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... | |
Data * | cDField () |
Return pointer to underlying C array. More... | |
const Data * | cDField () const |
Return pointer to const to underlying C array. More... | |
virtual DField< Data > & | operator= (const DField< Data > &other) |
Assignment operator. More... | |
DField (const DField &other) | |
Copy constructor. More... | |
Protected Attributes | |
Data * | data_ |
Pointer to an array of Data elements on the device / GPU. More... | |
int | capacity_ |
Allocated size of the data_ array. More... | |
Dynamic array on the GPU with alligned data.
This class wraps an aligned C array with elements of type Data on the device. All member functions may be called from the host. As a result, the class does not offer access to individual elements via operator[]
Pscf::Pspg::DField< Data >::DField |
Default constructor.
Definition at line 27 of file DField.tpp.
|
virtual |
Destructor.
Deletes underlying C array, if allocated previously.
Definition at line 36 of file DField.tpp.
Pscf::Pspg::DField< Data >::DField | ( | const DField< Data > & | other | ) |
Copy constructor.
other | DField<Data> to be copied (input) |
Definition at line 87 of file DField.tpp.
void Pscf::Pspg::DField< Data >::allocate | ( | int | capacity | ) |
Allocate the underlying C array on the device.
Exception | if the Field is already allocated. |
capacity | number of elements to allocate. |
Definition at line 52 of file DField.tpp.
Referenced by Pscf::Pspg::RDField< D >::allocate(), and Pscf::Pspg::RDFieldDft< D >::allocate().
void Pscf::Pspg::DField< Data >::deallocate |
Dellocate the underlying C array.
Exception | if the Field is not allocated. |
Definition at line 70 of file DField.tpp.
References UTIL_THROW.
|
inline |
Return true if the Field has been allocated, false otherwise.
Definition at line 133 of file DField.h.
Referenced by Pscf::Pspg::DField< Data >::operator=().
|
inline |
Return allocated size.
Definition at line 112 of file DField.h.
Referenced by Pscf::Pspg::RFieldComparison< D >::compare(), Pscf::Pspg::KFieldComparison< D >::compare(), Pscf::Pspg::Mixture< D >::compute(), Pscf::Pspg::FieldIo< D >::convertBasisToKGrid(), Pscf::Pspg::FFTBatched< D >::forwardTransform(), Pscf::Pspg::FFT< D >::forwardTransform(), Pscf::Pspg::FFT< D >::forwardTransformSafe(), Pscf::Pspg::FFT< D >::inverseTransform(), Pscf::Pspg::FFT< D >::inverseTransformSafe(), Pscf::Pspg::DField< Data >::operator=(), and Pscf::Pspg::FFT< D >::setup().
|
inline |
Return pointer to underlying C array.
Definition at line 119 of file DField.h.
Referenced by Pscf::Pspg::RFieldComparison< D >::compare(), Pscf::Pspg::KFieldComparison< D >::compare(), Pscf::Pspg::Mixture< D >::compute(), Pscf::Pspg::Solvent< D >::compute(), Pscf::Pspg::FieldIo< D >::convertBasisToKGrid(), Pscf::Pspg::FieldIo< D >::convertKGridToBasis(), Pscf::Pspg::FFTBatched< D >::forwardTransform(), Pscf::Pspg::FFT< D >::forwardTransform(), Pscf::Pspg::FFTBatched< D >::inverseTransform(), Pscf::Pspg::FFT< D >::inverseTransform(), Pscf::Pspg::DField< Data >::operator=(), Pscf::Pspg::FieldIo< D >::readFieldRGrid(), Pscf::Pspg::WFieldContainer< D >::setRGrid(), Pscf::Pspg::Block< D >::setupSolver(), Pscf::Pspg::FieldIo< D >::writeFieldRGrid(), Pscf::Pspg::System< D >::writeQ(), Pscf::Pspg::System< D >::writeQSlice(), and Pscf::Pspg::System< D >::writeQTail().
|
inline |
|
virtual |
Assignment operator.
other | DField<Data> on rhs of assignent (input) |
Definition at line 110 of file DField.tpp.
References Pscf::Pspg::DField< Data >::capacity(), Pscf::Pspg::DField< Data >::capacity_, Pscf::Pspg::DField< Data >::cDField(), Pscf::Pspg::DField< Data >::isAllocated(), and UTIL_THROW.
Referenced by Pscf::Pspg::RDField< D >::operator=(), and Pscf::Pspg::RDFieldDft< D >::operator=().
|
protected |
|
protected |
Allocated size of the data_ array.
Definition at line 104 of file DField.h.
Referenced by Pscf::Pspg::DField< Data >::operator=().