|
SHAFFT 1.1.0-alpha
A Scalable High-dimensional Accelerated FFT Library
|
Free functions for C interoperability and advanced use. More...
Classes | |
| struct | shafft::Version |
| Library version information. More... | |
Functions | |
| int | shafft::setBuffers (detail::PlanBase *plan, complexf *data, complexf *work) noexcept |
| Attach buffers using portable complex types. | |
| int | shafft::getBuffers (detail::PlanBase *plan, complexf **data, complexf **work) noexcept |
| Retrieve current buffer pointers. | |
| int | shafft::allocBuffer (size_t count, complexf **buf) noexcept |
| Allocate buffer for the current backend. | |
| int | shafft::freeBuffer (complexf *buf) noexcept |
| Free buffer allocated with allocBuffer(). | |
| int | shafft::copyToBuffer (complexf *dst, const complexf *src, size_t count) noexcept |
| Copy from host to SHAFFT buffer. | |
| int | shafft::copyFromBuffer (complexf *dst, const complexf *src, size_t count) noexcept |
| Copy from SHAFFT buffer to host. | |
| int | shafft::planNDCreate (detail::FFTNDPlan **out) |
| Allocate N-D plan object (C-style API). | |
| int | shafft::FFT1DCreate (detail::FFT1DPlan **out) |
| Allocate 1-D plan object (C-style API). | |
| int | shafft::configuration1D (size_t globalN, size_t &localN, size_t &localStart, FFTType precision, MPI_Comm comm) |
| Compute local layout for 1D distributed FFT. | |
| int | shafft::planND (detail::FFTNDPlan *plan, const std::vector< int > &commDims, const std::vector< size_t > &dimensions, FFTType precision, MPI_Comm comm) |
| Initialize N-D plan (C-style API). | |
| int | shafft::destroy (detail::PlanBase **plan) |
| Release plan resources and null pointer (C-style API). | |
| int | shafft::getLayout (const detail::PlanBase *plan, std::vector< size_t > &subsize, std::vector< size_t > &offset, TensorLayout layout) |
| Query tensor layout (C-style API). | |
| int | shafft::getAxes (const detail::PlanBase *plan, std::vector< int > &ca, std::vector< int > &da, TensorLayout layout) |
| Query axis distribution (C-style API). | |
| int | shafft::getAllocSize (const detail::PlanBase *plan, size_t &localAllocSize) |
| Get required buffer size in complex elements (C-style API). | |
| int | shafft::execute (detail::PlanBase *plan, FFTDirection direction) |
| Execute transform (C-style API). | |
| int | shafft::normalize (detail::PlanBase *plan) |
| Apply normalization (C-style API). | |
| const char * | shafft::getBackendName () noexcept |
| Get the name of the FFT backend used at compile time. | |
| Version | shafft::getVersion () noexcept |
| Get the library version as a struct. | |
| int | shafft::finalize () noexcept |
| Finalize library and release backend resources. | |
These functions mirror the C API but use C++ types. Use them when:
For most applications, prefer the C++ RAII API instead.
GPU backends require device memory; CPU backends require host memory.
| plan | Plan handle. |
| data | Data buffer. |
| work | Work buffer. |
Buffers may be swapped after execute().
| plan | Plan handle. | |
| [out] | data | Current data buffer. |
| [out] | work | Current work buffer. |
|
noexcept |
Uses hipMalloc on GPU, standard allocation on CPU.
| count | Number of complex elements. | |
| [out] | buf | Allocated buffer. |
|
noexcept |
| buf | Buffer to free (nullptr safe). |
Performs copy to a backend buffer.
| dst | Destination buffer. |
| src | Source host memory. |
| count | Number of complex elements. |
Performs copy from a backend buffer to host memory.
| dst | Destination host memory. |
| src | Source buffer. |
| count | Number of complex elements. |
| int shafft::planNDCreate | ( | detail::FFTNDPlan ** | out | ) |
| int shafft::FFT1DCreate | ( | detail::FFT1DPlan ** | out | ) |
| int shafft::configuration1D | ( | size_t | globalN, |
| size_t & | localN, | ||
| size_t & | localStart, | ||
| FFTType | precision, | ||
| MPI_Comm | comm | ||
| ) |
Call before FFT1D::init() to obtain layout parameters.
| globalN | Global FFT size. | |
| [out] | localN | Local element count. |
| [out] | localStart | Local offset in global array. |
| precision | FFT precision (C2C or Z2Z). | |
| comm | MPI communicator. |
| int shafft::planND | ( | detail::FFTNDPlan * | plan, |
| const std::vector< int > & | commDims, | ||
| const std::vector< size_t > & | dimensions, | ||
| FFTType | precision, | ||
| MPI_Comm | comm | ||
| ) |
Prefer FFTND::init() for RAII interface.
| plan | Plan from planNDCreate(). |
| commDims | Process grid dimensions. |
| dimensions | Global tensor dimensions. |
| precision | FFT precision (C2C or Z2Z). |
| comm | MPI communicator. |
| int shafft::destroy | ( | detail::PlanBase ** | plan | ) |
Does not free user buffers. RAII classes handle this automatically.
| [in,out] | plan | Plan pointer; set to nullptr on success. |
| int shafft::getLayout | ( | const detail::PlanBase * | plan, |
| std::vector< size_t > & | subsize, | ||
| std::vector< size_t > & | offset, | ||
| TensorLayout | layout | ||
| ) |
| plan | Plan handle. | |
| [out] | subsize | Local extent per axis. |
| [out] | offset | Global offset per axis. |
| layout | Layout to query (CURRENT, INITIAL, or REDISTRIBUTED). |
| int shafft::getAxes | ( | const detail::PlanBase * | plan, |
| std::vector< int > & | ca, | ||
| std::vector< int > & | da, | ||
| TensorLayout | layout | ||
| ) |
| plan | Plan handle. | |
| [out] | ca | Contiguous (non-distributed) axes. |
| [out] | da | Distributed axes. |
| layout | Layout to query (CURRENT, INITIAL, or REDISTRIBUTED). |
| int shafft::getAllocSize | ( | const detail::PlanBase * | plan, |
| size_t & | localAllocSize | ||
| ) |
| plan | Plan handle. | |
| [out] | localAllocSize | Required buffer size in complex elements. |
| int shafft::execute | ( | detail::PlanBase * | plan, |
| FFTDirection | direction | ||
| ) |
| plan | Plan handle. |
| direction | FORWARD or BACKWARD. |
| int shafft::normalize | ( | detail::PlanBase * | plan | ) |
| plan | Plan handle. |
|
inlinenoexcept |
|
inlinenoexcept |
major, minor, and patch fields populated.
|
noexcept |
Call after all plans are destroyed, before MPI_Finalize() for FFTW backend. Safe to call multiple times.