File fft2d_core.h
FileList > fft2d > fft2d_core.h
Go to the source code of this file
Per-instance 2-D FFT using pocketfft directly. More...
#include "clib_common.h"#include "dp/pocketfft.h"
Classes
| Type | Name |
|---|---|
| struct | fft2d_state_t |
Public Functions
| Type | Name |
|---|---|
| fft2d_state_t * | fft2d_create (size_t ny, size_t nx, int sign, int nthreads) Create a 2-D FFT instance. |
| void | fft2d_destroy (fft2d_state_t * state) Destroy and free an fft2d instance. |
| size_t | fft2d_execute_cf32 (fft2d_state_t * state, const float complex * in, size_t n_in, float complex * out) Out-of-place 2-D CF32 FFT. Returns ny*nx. |
| size_t | fft2d_execute_cf32_max_out (fft2d_state_t * state) Maximum output samples for CF32 execute (ny * nx). |
| size_t | fft2d_execute_cf64 (fft2d_state_t * state, const double complex * in, size_t n_in, double complex * out) Out-of-place 2-D CF64 FFT. Returns ny*nx. |
| size_t | fft2d_execute_cf64_max_out (fft2d_state_t * state) Maximum output samples per execute call (ny * nx). |
| size_t | fft2d_execute_inplace_cf32 (fft2d_state_t * state, const float complex * in, size_t n_in, float complex * out) In-place 2-D CF32 FFT (copies in→out, then transforms). |
| size_t | fft2d_execute_inplace_cf32_max_out (fft2d_state_t * state) Maximum output samples for inplace CF32 execute (ny * nx). |
| size_t | fft2d_execute_inplace_cf64 (fft2d_state_t * state, const double complex * in, size_t n_in, double complex * out) In-place 2-D CF64 FFT (copies in→out, then transforms). |
| size_t | fft2d_execute_inplace_cf64_max_out (fft2d_state_t * state) Maximum output samples for inplace CF64 execute (ny * nx). |
| void | fft2d_reset (fft2d_state_t * state) No-op reset (plans are immutable after creation). |
Detailed Description
Holds two pocketfft plans — one CF64, one CF32 — for an ny × nx row-major transform. Input and output arrays are flat buffers of length ny*nx; the Python wrapper class reshapes them. nthreads is accepted for API compatibility but ignored.
Lifecycle:
fft2d_state_t *fft = fft2d_create(64, 64, -1, 1);
double complex out[64 * 64];
fft2d_execute_cf64(fft, in, 64 * 64, out);
fft2d_destroy(fft);
Public Functions Documentation
function fft2d_create
Create a 2-D FFT instance.
fft2d_state_t * fft2d_create (
size_t ny,
size_t nx,
int sign,
int nthreads
)
Parameters:
nyNumber of rows.nxNumber of columns.sign-1 for forward DFT, +1 for inverse.nthreadsIgnored (pocketfft is single-threaded).
Returns:
Heap-allocated state, or NULL on failure.
function fft2d_destroy
Destroy and free an fft2d instance.
void fft2d_destroy (
fft2d_state_t * state
)
Parameters:
stateMay be NULL.
function fft2d_execute_cf32
Out-of-place 2-D CF32 FFT. Returns ny*nx.
size_t fft2d_execute_cf32 (
fft2d_state_t * state,
const float complex * in,
size_t n_in,
float complex * out
)
function fft2d_execute_cf32_max_out
Maximum output samples for CF32 execute (ny * nx).
size_t fft2d_execute_cf32_max_out (
fft2d_state_t * state
)
function fft2d_execute_cf64
Out-of-place 2-D CF64 FFT. Returns ny*nx.
size_t fft2d_execute_cf64 (
fft2d_state_t * state,
const double complex * in,
size_t n_in,
double complex * out
)
function fft2d_execute_cf64_max_out
Maximum output samples per execute call (ny * nx).
size_t fft2d_execute_cf64_max_out (
fft2d_state_t * state
)
function fft2d_execute_inplace_cf32
In-place 2-D CF32 FFT (copies in→out, then transforms).
size_t fft2d_execute_inplace_cf32 (
fft2d_state_t * state,
const float complex * in,
size_t n_in,
float complex * out
)
function fft2d_execute_inplace_cf32_max_out
Maximum output samples for inplace CF32 execute (ny * nx).
size_t fft2d_execute_inplace_cf32_max_out (
fft2d_state_t * state
)
function fft2d_execute_inplace_cf64
In-place 2-D CF64 FFT (copies in→out, then transforms).
size_t fft2d_execute_inplace_cf64 (
fft2d_state_t * state,
const double complex * in,
size_t n_in,
double complex * out
)
function fft2d_execute_inplace_cf64_max_out
Maximum output samples for inplace CF64 execute (ny * nx).
size_t fft2d_execute_inplace_cf64_max_out (
fft2d_state_t * state
)
function fft2d_reset
No-op reset (plans are immutable after creation).
void fft2d_reset (
fft2d_state_t * state
)
The documentation for this class was generated from the following file native/inc/fft2d/fft2d_core.h