Skip to content

Commit

Permalink
concrete-fft working
Browse files Browse the repository at this point in the history
  • Loading branch information
nindanaoto committed Jul 12, 2024
1 parent 29c2b44 commit 08be62e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ option(USE_RANDEN "Use randen as CSPRNG" ON)
option(USE_BLAKE3 "Use blake3 as CSPRNG" ON)

option(USE_AVX512 "Use AVX512 ver. SPQLIOS" OFF)
option(USE_CONCRETE_FFT "Use concrete-fft" OFF)
option(USE_MKL "Use Intel MKL" OFF)
option(USE_FFTW3 "Use FFTW3" OFF)
option(USE_SPQLIOX_AARCH64 "Use spqliox_aarch64" OFF)
Expand Down Expand Up @@ -109,7 +110,7 @@ if(USE_FFTW3)
add_subdirectory(thirdparties/fftw)
elseif(USE_MKL)
set(TFHEpp_DEFINITIONS
"${TFHEpp_DEFINITIONS};USE_MKL"
"${TFHEpp_DEFINITIONS};USE_MKL;USE_INTERLEAVED_FORMAT"
PARENT_SCOPE)
add_compile_definitions(USE_MKL)
add_compile_definitions(USE_INTERLEAVED_FORMAT)
Expand All @@ -126,6 +127,13 @@ elseif(USE_SPQLIOX_AARCH64)
if(APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
include_directories(/opt/homebrew/include)
endif()
elseif(USE_CONCRETE_FFT)
set(TFHEpp_DEFINITIONS
"${TFHEpp_DEFINITIONS};USE_CONCRETE_FFT;USE_INTERLEAVED_FORMAT"
PARENT_SCOPE)
add_compile_definitions(USE_CONCRETE_FFT)
add_compile_definitions(USE_INTERLEAVED_FORMAT)
add_subdirectory(thirdparties/concrete-fft)
else()
add_subdirectory(thirdparties/spqlios)
endif()
Expand Down
2 changes: 2 additions & 0 deletions include/mulfft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <fft_processor_mkl.hpp>
#elif USE_SPQLIOX_AARCH64
#include <fft_processor_spqliox_aarch64.h>
#elif USE_CONCRETE_FFT
#include <fft_processor_concrete.hpp>
#else
#include <fft_processor_spqlios.h>
#endif
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ target_include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/thirdparties/spqlios
${PROJECT_SOURCE_DIR}/thirdparties/fftw
${PROJECT_SOURCE_DIR}/thirdparties/concrete-fft/cpp
${PROJECT_BINARY_DIR}/thirdparties/concrete-fft
${PROJECT_SOURCE_DIR}/thirdparties/spqliox_aarch64
${PROJECT_SOURCE_DIR}/thirdparties/spqliox_aarch64/xbyak_aarch64/xbyak_aarch64
${PROJECT_SOURCE_DIR}/thirdparties/hexl/hexl/hexl/include
Expand Down Expand Up @@ -39,6 +41,8 @@ elseif(USE_SPQLIOX_AARCH64)
target_link_libraries(tfhe++ INTERFACE spqliox_aarch64 xbyak_aarch64)
elseif(USE_HEXL)
target_link_libraries(tfhe++ INTERFACE spqlios HEXL::hexl)
elseif(USE_CONCRETE_FFT)
target_link_libraries(tfhe++ INTERFACE concrete-fft)
else()
if(USE_MKL)
target_link_libraries(tfhe++ INTERFACE mklproc)
Expand Down
2 changes: 1 addition & 1 deletion thirdparties/concrete-fft

0 comments on commit 08be62e

Please sign in to comment.