Skip to content

Commit

Permalink
fixed README and removed alignas from param.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
nindanaoto committed Jul 12, 2024
1 parent 08be62e commit 041dde8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ We assume to install MKL by [this procedure](https://www.intel.com/content/www/u

Add `-DUSE_MKL` to the CMake option to use MKL

### FFTW3 API
To use this, you have to also add `-DUSE_FFTW3`.

### Native API
Instead of FFTW3 API, I also added native API version. This will be enabled if `-DUSE_FFTW3` is not specified with `-DUSE_MKL`.

## concrete-fft
concrete-fft is the pure rust FFT library developed by Zama.ai. This can be enabled by `-DUSE_CONCRETE_FFT`.

## spqliox_aarch64
spqliox_aarch64 is the FFT library for aarch64 forked from SPQLIOS.
This is slightly faster than FFTW3(average 1ms).
Expand Down
6 changes: 6 additions & 0 deletions include/mulfft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ template <uint32_t N>
inline void MulInFD(std::array<double, N> &res, const std::array<double, N> &a,
const std::array<double, N> &b)
{
std::assume_aligned<16>(res.data());
std::assume_aligned<16>(a.data());
std::assume_aligned<16>(b.data());
#ifdef USE_INTERLEAVED_FORMAT
for(int i = 0; i < N / 2; i++){
const std::complex tmp = std::complex(a[2*i], a[2*i+1]) * std::complex(b[2*i], b[2*i+1]);
Expand All @@ -171,6 +174,9 @@ template <uint32_t N>
inline void FMAInFD(std::array<double, N> &res, const std::array<double, N> &a,
const std::array<double, N> &b)
{
std::assume_aligned<16>(res.data());
std::assume_aligned<16>(a.data());
std::assume_aligned<16>(b.data());
#ifdef USE_INTERLEAVED_FORMAT
for(int i = 0; i < N / 2; i++){
std::complex tmp = std::complex(a[2*i], a[2*i+1]) * std::complex(b[2*i], b[2*i+1]);
Expand Down
4 changes: 2 additions & 2 deletions include/params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ using BootstrappingKey =
std::array<BootstrappingKeyElement<P>, P::domainP::k * P::domainP::n>;
template <class P>
using BootstrappingKeyFFT =
alignas(16) std::array<BootstrappingKeyElementFFT<P>,
std::array<BootstrappingKeyElementFFT<P>,
P::domainP::k * P::domainP::n / P::Addends>;
template <class P>
using BootstrappingKeyNTT =
Expand All @@ -143,7 +143,7 @@ using BootstrappingKeyRAINTT =
std::array<TRGSWRAINTT<typename P::targetP>, P::domainP::k * P::domainP::n>;

template <class P>
using KeySwitchingKey = alignas(16) std::array<
using KeySwitchingKey = std::array<
std::array<std::array<TLWE<typename P::targetP>, (1 << P::basebit) - 1>,
P::t>,
P::domainP::k * P::domainP::n>;
Expand Down

0 comments on commit 041dde8

Please sign in to comment.