![]() |
Block-Structured AMR Software Framework
|
#include <AMReX_FFT_Helper.H>
Public Types | |
| using | VendorPlan = cufftHandle |
| using | VendorComplex = std::conditional_t< std::is_same_v< float, T >, cuComplex, cuDoubleComplex > |
Public Member Functions | |
| void | set_ptrs (void *p0, void *p1) |
| Register device pointers used by the forward/backward executions. | |
| void | destroy () |
| Release any vendor FFT plan objects owned by this Plan. | |
| template<Direction D> | |
| void | init_r2c (Box const &box, T *pr, VendorComplex *pc, bool is_2d_transform=false, int ncomp=1) |
| Initialize a 1-D or 2-D real-to-complex plan over the supplied Box. | |
| template<Direction D, int M> | |
| void | init_r2c (IntVectND< M > const &fft_size, void *pbf, void *pbb, bool cache, int ncomp=1) |
| Initialize an M-dimensional batched real-to-complex plan. | |
| template<Direction D> | |
| void | init_c2c (Box const &box, VendorComplex *p, int ncomp=1, int ndims=1) |
| Initialize a complex-to-complex plan across 1/2/3 dimensions. | |
| template<Direction D> | |
| Kind | get_r2r_kind (std::pair< Boundary, Boundary > const &bc) |
| Map boundary conditions to the Plan Kind for real-to-real transforms. | |
| template<Direction D> | |
| void | init_r2r (Box const &box, T *p, std::pair< Boundary, Boundary > const &bc, int howmany_initval=1) |
| Initialize a real-to-real (cosine/sine) plan that operates on real buffers. | |
| template<Direction D> | |
| void | init_r2r (Box const &box, VendorComplex *pc, std::pair< Boundary, Boundary > const &bc) |
| Initialize a real-to-real plan that reads/writes complex storage. | |
| template<Direction D> | |
| void | compute_r2c () |
| Execute the previously initialized real-to-complex plan. | |
| template<Direction D> | |
| void | compute_c2c () |
| Execute the complex-to-complex plan in place. | |
| void * | alloc_scratch_space () const |
| Allocate GPU scratch space large enough to hold packed R2R data. | |
| void | pack_r2r_buffer (void *pbuf, T const *psrc) const |
| Expand the real R2R input into the symmetry-extended buffer expected by CUFFT/rocFFT. | |
| void | unpack_r2r_buffer (T *pdst, void const *pbuf) const |
| Collapse the spectral R2R result back into the original real layout. | |
| template<Direction D> | |
| void | compute_r2r () |
| Execute the real-to-real plan, including GPU packing/unpacking. | |
Static Public Member Functions | |
| static void | free_scratch_space (void *p) |
| Release GPU scratch allocated via alloc_scratch_space(). | |
| static void | destroy_vendor_plan (VendorPlan plan) |
| Helper that destroys a vendor plan of the appropriate backend type. | |
Public Attributes | |
| int | n = 0 |
| int | howmany = 0 |
| Kind | kind = Kind::none |
| bool | r2r_data_is_complex = false |
| bool | defined = false |
| bool | defined2 = false |
| VendorPlan | plan {} |
| VendorPlan | plan2 {} |
| void * | pf = nullptr |
| void * | pb = nullptr |
| using amrex::FFT::Plan< T >::VendorComplex = std::conditional_t<std::is_same_v<float,T>, cuComplex, cuDoubleComplex> |
| using amrex::FFT::Plan< T >::VendorPlan = cufftHandle |
|
inline |
Allocate GPU scratch space large enough to hold packed R2R data.
Execute the complex-to-complex plan in place.
Execute the previously initialized real-to-complex plan.
The direction is determined by the template parameter.
Execute the real-to-real plan, including GPU packing/unpacking.
|
inline |
|
inlinestatic |
Helper that destroys a vendor plan of the appropriate backend type.
|
inlinestatic |
Release GPU scratch allocated via alloc_scratch_space().
|
inline |
Map boundary conditions to the Plan Kind for real-to-real transforms.
| bc | Pair denoting (low, high) boundary type. |
|
inline |
Initialize a complex-to-complex plan across 1/2/3 dimensions.
The batch size equals the number of components ncomp multiplied by the cell counts along directions that are not transformed. For example, in a 3-D build with ndims = 1 we perform an x-line transform batched over every y–z cell, so the batch count becomes ncomp * box.length(1) * box.length(2). Likewise, a 2-D transform in a 3-D build batches along the remaining z slices.
| box | Box describing the logical FFT extents. |
| p | Pointer to the in-place complex buffer. |
| ncomp | Number of independent components per cell. |
| ndims | Dimensionality of the transform (1, 2, or 3). |
|
inline |
Initialize a 1-D or 2-D real-to-complex plan over the supplied Box.
| box | Real-space domain |
| pr | Pointer to the real data buffer. |
| pc | Pointer to the complex data buffer. |
| is_2d_transform | True for 2d tranfrom. |
| ncomp | Number of real components packed into the buffer. |
| void amrex::FFT::Plan< T >::init_r2c | ( | IntVectND< M > const & | fft_size, |
| void * | pbf, | ||
| void * | pbb, | ||
| bool | cache, | ||
| int | ncomp = 1 |
||
| ) |
Initialize an M-dimensional batched real-to-complex plan.
| fft_size | Logical FFT extent per dimension. |
| pbf | Forward (real) buffer pointer. |
| pbb | Backward (complex) buffer pointer. |
| cache | Whether to cache vendor plans (GPU backends only). |
| ncomp | Number of transforms sharing the same plan. |
|
inline |
Initialize a real-to-real (cosine/sine) plan that operates on real buffers.
| box | Box describing the transform size. |
| p | Pointer to the real input/output buffer. |
| bc | Boundary-condition pair. |
| howmany_initval | Number of transforms batched together. |
|
inline |
Initialize a real-to-real plan that reads/writes complex storage.
| box | 1-D Box describing the transform size. |
| pc | Pointer to the complex buffer (two real components interleaved). |
| bc | Boundary-condition pair. |
|
inline |
Expand the real R2R input into the symmetry-extended buffer expected by CUFFT/rocFFT.
| pbuf | Destination buffer (scratch). |
| psrc | Source real data. |
|
inline |
Register device pointers used by the forward/backward executions.
| p0 | Forward buffer pointer. |
| p1 | Backward buffer pointer. |
|
inline |
Collapse the spectral R2R result back into the original real layout.
| pdst | Destination real buffer. |
| pbuf | Scratch buffer holding the spectral data. |
| bool amrex::FFT::Plan< T >::defined = false |
| bool amrex::FFT::Plan< T >::defined2 = false |
| int amrex::FFT::Plan< T >::howmany = 0 |
| Kind amrex::FFT::Plan< T >::kind = Kind::none |
| int amrex::FFT::Plan< T >::n = 0 |
| void* amrex::FFT::Plan< T >::pb = nullptr |
| void* amrex::FFT::Plan< T >::pf = nullptr |
| VendorPlan amrex::FFT::Plan< T >::plan {} |
| VendorPlan amrex::FFT::Plan< T >::plan2 {} |
| bool amrex::FFT::Plan< T >::r2r_data_is_complex = false |