feat: add batched real-FFT plans in float and double precision - #4
Draft
galenlynch wants to merge 4 commits into
Draft
galenlynch wants to merge 4 commits into
galenlynch wants to merge 4 commits into
Conversation
galenlynch
force-pushed
the
float-batched-r2c
branch
from
September 8, 2026 23:06
0abe4ef to
37ea96e
Compare
galenlynch
force-pushed
the
float-batched-r2c
branch
2 times, most recently
from
September 8, 2026 23:47
287f9c5 to
8f15852
Compare
galenlynch
changed the base branch from
consume-fftw-dependency-bundles
to
package-fftw-dependencies
September 8, 2026 23:50
anjaldoshi
force-pushed
the
float-batched-r2c
branch
from
September 9, 2026 01:10
8f15852 to
4e440ab
Compare
The packaging change does not require every OpenEphysFFTW build to use a newer CMake release. Keep the top-level project at its existing 3.5 minimum and apply newer requirements only to the isolated tools that need them. Automatic staging now requires CMake 3.19 for archive extraction and fatal subprocess errors. The dependency smoke project requires CMake 3.22 for its test-environment modification.
Callers currently manage one FFT at a time, which prevents channel-by-taper workloads from sharing plans and aligned storage. Add move-only float and double real-to-complex plans with transform-major buffers. Reuse FFTW plan-many objects so execution requires no allocation.
Forward-only batches cannot reconstruct real signals with the same reusable storage and planning model. Add move-only float and double complex-to-real plans with transform-major buffers. Preserve FFTW's unnormalized inverse convention so callers control normalization.
galenlynch
force-pushed
the
float-batched-r2c
branch
from
September 10, 2026 17:12
4e440ab to
2ad1943
Compare
Collaborator
Author
|
Depends on #2 |
anjaldoshi
added this pull request to stack #5
September 11, 2026 20:28
Remove the redundant OEP_FFTW_API macro and use COMMON_LIB, which already provides the required export/import behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds four reusable, RAII-managed transform types:
BatchedRealToComplexPlanFBatchedComplexToRealPlanFBatchedRealToComplexPlanDBatchedComplexToRealPlanDThey support workloads such as spectrum estimation, where each channel and taper produces an independent transform of the same length. One persistent
fftw_plan_many_dft_*plan handles the complete batch and avoids per-frame planning or allocation.API contract
Each object owns aligned input and output storage plus its FFTW plan. Construction validates the transform length and batch count; row accessors expose contiguous transform-major storage.
execute()performs no allocation.Inverse transforms preserve FFTW's normal unnormalized convention. Callers must divide by the transform length when they require a normalized inverse.
FFTW plan creation and destruction are protected by the wrapper's existing planning mutex. Separate plan objects may execute concurrently, but concurrent access to the same object is unsupported because its buffers are mutable and owned by the plan.
Compatibility
The change is additive. Existing classes and function signatures remain unchanged. The new classes are concrete, non-polymorphic types, so this PR does not alter any existing object layout or vtable.
The public header remains independent of JUCE. The library links both the double-precision and single-precision FFTW libraries supplied by the dependency bundles.
Scope
FFTW-managed worker threads are intentionally excluded. The consuming plugin can first assign independent plans to its own workers, preserving one clear scheduling policy. Threaded FFTW can be evaluated separately if end-to-end profiling shows a need.
Verification
Tests should cover float and double forward transforms, inverse reconstruction, batch isolation, invalid dimensions, move semantics, and repeated allocation-free execution. CI must run these tests on Linux, Windows, and macOS after the two dependency-packaging PRs have landed.