From faa0592deae65d3f9717630ba4799676a154950a Mon Sep 17 00:00:00 2001 From: nindanaoto Date: Thu, 18 Jul 2024 04:28:43 +0000 Subject: [PATCH] Added aligned_array --- include/detwfa.hpp | 4 ++-- include/params.hpp | 4 +++- include/utils.hpp | 1 + test/circuitbootstrapping.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/detwfa.hpp b/include/detwfa.hpp index d4f28bb..9eef779 100644 --- a/include/detwfa.hpp +++ b/include/detwfa.hpp @@ -28,9 +28,9 @@ TRGSWFFT

TRGSWFFTOneGen() return ApplyFFT2trgsw

(trgsw); } -alignas(32) const TRGSWFFT trgswonelvl1 = +alignas(64) const TRGSWFFT trgswonelvl1 = TRGSWFFTOneGen(); -alignas(32) const TRGSWFFT trgswonelvl2 = +alignas(64) const TRGSWFFT trgswonelvl2 = TRGSWFFTOneGen(); template diff --git a/include/params.hpp b/include/params.hpp index 0fe21cd..006b86e 100644 --- a/include/params.hpp +++ b/include/params.hpp @@ -8,6 +8,8 @@ namespace TFHEpp { +template struct alignas( 64 ) aligned_array : public std::array { }; + enum class ErrorDistribution { ModularGaussian, CenteredBinomial }; // Use old 80bit security parameters. It is faster, but not recommended. @@ -106,7 +108,7 @@ using TRLWERAINTT = std::array, P::k + 1>; template using TRGSW = std::array, (P::k + 1) * P::l>; template -using TRGSWFFT = std::array, (P::k + 1) * P::l>; +using TRGSWFFT = aligned_array, (P::k + 1) * P::l>; template using TRGSWNTT = std::array, (P::k + 1) * P::l>; template diff --git a/include/utils.hpp b/include/utils.hpp index e0e7e48..2507650 100644 --- a/include/utils.hpp +++ b/include/utils.hpp @@ -214,4 +214,5 @@ inline void Automorphism(Polynomial

&res, const Polynomial

&poly, res[index & Nmask] += poly[i]; } } + } // namespace TFHEpp diff --git a/test/circuitbootstrapping.cpp b/test/circuitbootstrapping.cpp index 44209f4..03f3edb 100644 --- a/test/circuitbootstrapping.cpp +++ b/test/circuitbootstrapping.cpp @@ -38,7 +38,7 @@ int main() for (int i = 0; i < num_test; i++) pones[i] = true; alignas(64) std::vector> ca(num_test); alignas(64) std::vector> cones(num_test); - std::vector,TFHEpp::AlignedAllocator,64>> bootedTGSW( + std::vector> bootedTGSW( num_test); for (int i = 0; i < num_test; i++)