Skip to content

Rust bindings for VkFFT, a high-performance FFT implementation for Vulkan

License

Notifications You must be signed in to change notification settings

NickKarpowicz/vkfft-rs

 
 

Repository files navigation

vkfft-rs

vkfft-rs allows high-performance execution of 1, 2, or 3D FFTs on the GPU using Vulkan in Rust, with built-in support for convolutions.

vkfft-rs is a binding for VkFFT that assumes usage with vulkano. While VkFFT, despite the name, supports multiple backends, this wrapper requires usage with Vulkan.

While vkfft-rs attempts to maintain a safe API, it's very likely there are some safe functions in this codebase that can still cause unsafe behavior. VkFFT's API and associated data structures are unsafe and stateful, which presents difficulties in ensuring Rust's safety guarantees. Until its safety properties can be properly verified it is recommend to proceed with caution. PRs welcome!

Usage

The required libraries should be built automatically by cargo, except for Vulkan itself. When cloning the repo, you may need to run

git submodule init
git submodule update

to populate the submodles.

To see an example, which exhibits the data layout of the buffers for a 1D complex-to-complex transform, a 2D real-to-complex one, and a 2D convolution, run

cargo run --example tests

The examples are heavily commented, and located in examples/tests.rs

Additional requirements:

Vulkan:

  • On Linux: You should install libvulkan using your system's package manager (on most systems, it will already be present).
  • On Mac and Windows: Install the Vulkan SDK from LunarG.

A C/C++ compiler (Apple Clang on Mac, MSVC on Windows).

About

Rust bindings for VkFFT, a high-performance FFT implementation for Vulkan

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 99.2%
  • C 0.8%