SHAFFT 1.1.0-alpha
A Scalable High-dimensional Accelerated FFT Library
Loading...
Searching...
No Matches
shafft::FFT Class Referenceabstract

Abstract base class for FFT plans (FFTND, FFT1D).

#include <fft_base.hpp>

Public Member Functions

virtual void release () noexcept=0
 Release internal resources.
 
virtual int setBuffersRaw (void *data, void *work) noexcept=0
 Attach data and work buffers.
 
virtual int getBuffersRaw (void **data, void **work) noexcept=0
 Retrieve current buffer pointers.
 
virtual int plan () noexcept=0
 Create backend FFT plans.
 
virtual int execute (FFTDirection direction) noexcept=0
 Execute the FFT.
 
virtual int normalize () noexcept=0
 Apply normalization to the transformed data.
 
virtual size_t allocSize () const noexcept=0
 Get the required buffer allocation size (in elements).
 
virtual size_t globalSize () const noexcept=0
 Get the total number of elements in the global tensor.
 
virtual int ndim () const noexcept=0
 Get the number of dimensions.
 
 operator bool () const noexcept
 Check if the plan is valid (alias for isConfigured).
 
virtual bool isActive () const noexcept=0
 Check if this rank participates in the FFT.
 
virtual FFTType fftType () const noexcept=0
 Get the FFT type (C2C or Z2Z).
 
PlanState state () const noexcept
 Get the current plan state.
 
bool isConfigured () const noexcept
 Check if the plan is at least configured (init() succeeded).
 
bool isPlanned () const noexcept
 Check if the plan is fully planned and ready for execution.
 
 FFT (const FFT &)=delete
 
FFToperator= (const FFT &)=delete
 

Constructor & Destructor Documentation

◆ FFT()

shafft::FFT::FFT ( const FFT )
delete

Member Function Documentation

◆ release()

virtual void shafft::FFT::release ( )
pure virtualnoexcept

Call before MPI_Finalize() if plan outlives MPI.

Implemented in shafft::FFTND, and shafft::FFT1D.

◆ setBuffersRaw()

virtual int shafft::FFT::setBuffersRaw ( void *  data,
void *  work 
)
pure virtualnoexcept
Parameters
dataData buffer (at least allocSize() elements).
workWork buffer (at least allocSize() elements).
Returns
0 on success.

Implemented in shafft::FFTND, and shafft::FFT1D.

◆ getBuffersRaw()

virtual int shafft::FFT::getBuffersRaw ( void **  data,
void **  work 
)
pure virtualnoexcept

Buffers may be swapped after execute().

Parameters
[out]dataCurrent data buffer.
[out]workCurrent work buffer.
Returns
0 on success.

Implemented in shafft::FFTND, and shafft::FFT1D.

◆ plan()

virtual int shafft::FFT::plan ( )
pure virtualnoexcept

Must be called after init() succeeds. For GPU backends, buffers must be attached before calling plan(). For FFTW, buffers may be set later. Calling plan() more than once returns Status::ERR_INVALID_STATE.

Returns
0 on success, non-zero on error.

Implemented in shafft::FFTND, and shafft::FFT1D.

◆ execute()

virtual int shafft::FFT::execute ( FFTDirection  direction)
pure virtualnoexcept
Parameters
directionFORWARD or BACKWARD.
Returns
Status code (0 on success).

Implemented in shafft::FFTND, and shafft::FFT1D.

◆ normalize()

virtual int shafft::FFT::normalize ( )
pure virtualnoexcept
Returns
Status code (0 on success).

Implemented in shafft::FFTND, and shafft::FFT1D.

◆ allocSize()

virtual size_t shafft::FFT::allocSize ( ) const
pure virtualnoexcept
Returns
Number of elements needed for data/work buffers.

Implemented in shafft::FFTND, and shafft::FFT1D.

◆ globalSize()

virtual size_t shafft::FFT::globalSize ( ) const
pure virtualnoexcept
Returns
Product of all global dimensions.

Implemented in shafft::FFTND, and shafft::FFT1D.

◆ ndim()

virtual int shafft::FFT::ndim ( ) const
pure virtualnoexcept
Returns
Number of tensor dimensions (1 for FFT1D, N for FFTND).

Implemented in shafft::FFTND, and shafft::FFT1D.

◆ operator bool()

shafft::FFT::operator bool ( ) const
inlineexplicitnoexcept

◆ isActive()

virtual bool shafft::FFT::isActive ( ) const
pure virtualnoexcept

Inactive ranks can safely call execute()/normalize() (no-ops).

Implemented in shafft::FFTND, and shafft::FFT1D.

◆ fftType()

virtual FFTType shafft::FFT::fftType ( ) const
pure virtualnoexcept
Returns
The FFTType of this plan.

Implemented in shafft::FFTND, and shafft::FFT1D.

◆ state()

PlanState shafft::FFT::state ( ) const
inlinenoexcept
Returns
The PlanState of this plan.

◆ isConfigured()

bool shafft::FFT::isConfigured ( ) const
inlinenoexcept
Returns
true if state >= CONFIGURED.

◆ isPlanned()

bool shafft::FFT::isPlanned ( ) const
inlinenoexcept
Returns
true if state == PLANNED.

◆ operator=()

FFT & shafft::FFT::operator= ( const FFT )
delete

The documentation for this class was generated from the following file: