gpufft 0.1.1

Unified GPU-accelerated FFT for Rust: Vulkan via VkFFT, CUDA via cuFFT.
docs.rs failed to build gpufft-0.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

Unified GPU-accelerated FFT for Rust.

gpufft exposes a single trait surface that works the same across multiple GPU backends. Backends are selected at build time via Cargo features; at least one must be enabled.

Feature Backend module Underlying library
vulkan [vulkan] VkFFT (vendored)
cuda cuda (when enabled) cuFFT (system)

Quick start

# #[cfg(feature = "vulkan")]
# fn demo() -> Result<(), Box<dyn std::error::Error>> {
use gpufft::{
    vulkan::VulkanBackend, BufferOps, C2cPlanOps, Device, Direction, PlanDesc, Shape,
};
use num_complex::Complex32;

let device = VulkanBackend::new_device(Default::default())?;
let mut buffer = device.alloc::<Complex32>(1024)?;
buffer.write(&vec![Complex32::default(); 1024])?;

let mut plan = device.plan_c2c::<Complex32>(&PlanDesc {
    shape: Shape::D1(1024),
    batch: 1,
    normalize: false,
})?;
plan.execute(&mut buffer, Direction::Forward)?;
# Ok(())
# }

Transform kinds

Each backend exposes three plan types, constructed through distinct device methods:

Method Trait Use
[Device::plan_c2c] [C2cPlanOps] complex-to-complex, in-place
[Device::plan_r2c] [R2cPlanOps] real-to-complex, forward only
[Device::plan_c2r] [C2rPlanOps] complex-to-real, inverse only

R2C output buffers and C2R input buffers are Hermitian-symmetric half-spectra (last dimension n / 2 + 1), matching VkFFT and cuFFT conventions. Use [Shape::complex_half_elements] to size them.

Buffers and plans are typed by their backend, so feeding a Vulkan buffer into a CUDA plan is a compile error.