From 041dde839290035978f2df85f82d2f0845745bbd Mon Sep 17 00:00:00 2001 From: nindanaoto Date: Fri, 12 Jul 2024 17:11:45 +0000 Subject: [PATCH] fixed README and removed alignas from param.hpp --- README.md | 9 +++++++++ include/mulfft.hpp | 6 ++++++ include/params.hpp | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 345a479..fc2f198 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/include/mulfft.hpp b/include/mulfft.hpp index c9c0235..b2cc84e 100644 --- a/include/mulfft.hpp +++ b/include/mulfft.hpp @@ -149,6 +149,9 @@ template inline void MulInFD(std::array &res, const std::array &a, const std::array &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]); @@ -171,6 +174,9 @@ template inline void FMAInFD(std::array &res, const std::array &a, const std::array &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]); diff --git a/include/params.hpp b/include/params.hpp index d4d19a1..0fe21cd 100644 --- a/include/params.hpp +++ b/include/params.hpp @@ -133,7 +133,7 @@ using BootstrappingKey = std::array, P::domainP::k * P::domainP::n>; template using BootstrappingKeyFFT = - alignas(16) std::array, + std::array, P::domainP::k * P::domainP::n / P::Addends>; template using BootstrappingKeyNTT = @@ -143,7 +143,7 @@ using BootstrappingKeyRAINTT = std::array, P::domainP::k * P::domainP::n>; template -using KeySwitchingKey = alignas(16) std::array< +using KeySwitchingKey = std::array< std::array, (1 << P::basebit) - 1>, P::t>, P::domainP::k * P::domainP::n>;