|
PSCF v1.5.0
|
Discrete Fourier Transform (DFT) of a real field, allocated on a GPU. More...
#include <RFieldDft.h>
Public Member Functions | |
| RFieldDft () | |
| Default constructor. | |
| RFieldDft (IntVec< D > const &meshDimensions) | |
| Allocating constructor. | |
| RFieldDft (RFieldDft< D, CUT > const &other) | |
| Copy constructor. | |
| virtual | ~RFieldDft () |
| Destructor. | |
| void | allocate (IntVec< D > const &meshDimensions) |
| Allocate the underlying C array for an FFT grid. | |
| 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. | |
| RFieldDft< D, CUT > & | operator= (RFieldDft< D, CUT > const &other) |
| Assignment operator, assignment from another RFieldDft<D,CUT>. | |
| RFieldDft< D, CUT > & | operator= (HostSendArray< cudaComplex, CUT > const &other) |
| Assignment operator, assignment from a HostSendArray<cudaComplex,CUT>. | |
| IntVec< D > const & | meshDimensions () const |
| Return vector of real-space mesh dimensions by constant reference. | |
| IntVec< D > const & | dftDimensions () const |
| Return vector of dft (Fourier) grid dimensions by const reference. | |
| template<class Archive> | |
| void | serialize (Archive &ar, const unsigned int version) |
| Serialize a Field to/from an Archive. | |
Discrete Fourier Transform (DFT) of a real field, allocated on a GPU.
The DFT is stored internally as a C array of cudaComplex elements located in global GPU memory. All member functions are C++ functions that can be called from the host CPU.
Definition at line 36 of file cuda/RFieldDft.h.
| Pscf::RFieldDft< D, CUT >::RFieldDft | ( | ) |
Default constructor.
Definition at line 23 of file cuda/RFieldDft.tpp.
References RFieldDft().
Referenced by allocate(), associate(), deallocate(), dftDimensions(), meshDimensions(), operator=(), operator=(), RFieldDft(), RFieldDft(), RFieldDft(), serialize(), and ~RFieldDft().
| Pscf::RFieldDft< D, CUT >::RFieldDft | ( | IntVec< D > const & | meshDimensions | ) |
Allocating constructor.
Calls allocate(meshDimensions) internally.
| meshDimensions | dimensions of asssociated r-grid mesh |
Definition at line 31 of file cuda/RFieldDft.tpp.
References allocate(), meshDimensions(), and RFieldDft().
| Pscf::RFieldDft< D, CUT >::RFieldDft | ( | RFieldDft< D, CUT > const & | other | ) |
Copy constructor.
Allocates new memory and copies all elements by value.
| other | the RFieldDft to be copied. |
Definition at line 46 of file cuda/RFieldDft.tpp.
References RFieldDft().
|
virtual |
Destructor.
Deletes underlying C array, if allocated previously.
Definition at line 39 of file cuda/RFieldDft.tpp.
References RFieldDft().
| void Pscf::RFieldDft< D, CUT >::allocate | ( | IntVec< D > const & | meshDimensions | ) |
Allocate the underlying C array for an FFT grid.
| meshDimensions | number of grid points in each dimension |
Definition at line 57 of file cuda/RFieldDft.tpp.
References meshDimensions(), RFieldDft(), and UTIL_CHECK.
Referenced by RFieldDft(), and serialize().
| void Pscf::RFieldDft< D, CUT >::deallocate | ( | ) |
Deallocate the underlying array.
Definition at line 77 of file cuda/RFieldDft.tpp.
References RFieldDft().
| void Pscf::RFieldDft< 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 89 of file cuda/RFieldDft.tpp.
References meshDimensions(), RFieldDft(), and UTIL_CHECK.
| RFieldDft< D, CUT > & Pscf::RFieldDft< D, CUT >::operator= | ( | RFieldDft< D, CUT > const & | other | ) |
Assignment operator, assignment from another RFieldDft<D,CUT>.
If this Field is not allocated, allocates and copies all elements.
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 Field |
Definition at line 113 of file cuda/RFieldDft.tpp.
References RFieldDft().
| RFieldDft< D, CUT > & Pscf::RFieldDft< 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 HostSendArray<cudaComplex,CUT> from host memory to device memory.
The RHS HostSendArray<cudaComplex,CUT> and LHS RFieldDft<D,CUT> must both be allocated and have equal capacity values on entry.
| other | the RHS HostSendArray<cudaComplex,CUT> |
Definition at line 130 of file cuda/RFieldDft.tpp.
References RFieldDft(), and UTIL_CHECK.
|
inline |
Return vector of real-space mesh dimensions by constant reference.
Definition at line 186 of file cuda/RFieldDft.h.
References RFieldDft().
Referenced by allocate(), associate(), and RFieldDft().
|
inline |
Return vector of dft (Fourier) grid dimensions by const reference.
The last element of dftDimensions() and meshDimensions() differ by about a factor of two: dftDimensions()[D-1] = meshDimensions()/2 + 1. For D > 1, other elements are equal.
Definition at line 193 of file cuda/RFieldDft.h.
References RFieldDft().
| void Pscf::RFieldDft< 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 201 of file cuda/RFieldDft.h.
References allocate(), RFieldDft(), and UTIL_THROW.