|
LibSWIFFT
1.2.0
|
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:
SWIFFT_fft{,sum}. These are the two low-level stages in a SWIFFT hash computation and are normally not used directly.SWIFFT_{Compute,Compact}. These transform from input to output and from output to compact forms.SWIFFT_{,Const}{Set,Add,Sub,Mul}. These set, add, subtract, or multiply given two output forms or one output form and a constant value.Multiple as part of their name. They operate on a number of blocks given as a parameter, rather than one block like the corresponding (i.e., without Multiple) single-block functions.The main C++ API has the following organization:
Swifft{Input,Output,Compact}. These wrap input, output, and compact buffers with automatic memory-alignment.SwifftOutput instance with another or with a constant value.The microarchitecture-specific APIs have the following organization:
_AVX, _AVX2, and _AVX512 that respectively provide implementations optimized for a microarchitecture supporting AVX, AVX2, and AVX512F instruction-sets.The major code conventions used in LibSWIFFT are:
SWIFFT\_.LIBSWIFFT\_LibSwifft.LibSWIFFT code uses conditional compilation directives with the following goals:
1.8.13