LibSWIFFT  1.2.0
Design of LibSWIFFT Code

At a high level, LibSWIFFT includes a layer of C code that provides the C API and a layer of C++ code on top of it that provides the C++ API. New features are normally added to the C layer and then wrapped by the C++ layer.

The C layer is composed of the main API and the microarchitecture-specific APIs, discussed in more detail below. In regular use cases, one would normally use the main API only, which selects the best microarchitecture-specific API for the platform the library was built for. In more sophisticated use cases, one could use a microarchitecture-specific APIs directly, e.g., to provide an optimized feature. The main C and C++ APIs are respectively provided by the swifft.h and swifft.hpp headers.

LibSWIFFT has the following file and directory structure:

File or Directory Description
- include root directory of headers
- libswifft directory of LibSWIFFT headers
- common.h LibSWIFFT public C common definitions
- swifft.h LibSWIFFT public C API
- swifft.hpp LibSWIFFT public C++ API
- swifft_avx.h LibSWIFFT public C API for AVX
- swifft_avx2.h LibSWIFFT public C API for AVX2
- swifft_avx512.h LibSWIFFT public C API for AVX512
- swifft_common.h LibSWIFFT public C definitions
- swifft_iset.inl LibSWIFFT public C API expansion for instruction-sets
- swifft_ver.h LibSWIFFT public C API
- src directory of LibSWIFFT sources
- swifft.c LibSWIFFT public C implementation
- swifft.inl LibSWIFFT internal C code expansion
- swifft_avx.c LibSWIFFT public C implementation for AVX
- swifft_avx2.c LibSWIFFT public C implementation for AVX2
- swifft_avx512.c LibSWIFFT public C implementation for AVX512
- swifft_impl.inl LibSWIFFT internal C definitions
- swifft_keygen.cpp LibSWIFFT internal C code generation
- swifft_ops.inl LibSWIFFT internal C code expansion
- transpose_8x8_16_sse2.inl LibSWIFFT internal C code for matrix transposing

The main C API has the following organization:

The main C++ API has the following organization:

The microarchitecture-specific APIs have the following organization:

The major code conventions used in LibSWIFFT are:

LibSWIFFT code uses conditional compilation directives with the following goals: