diff --git a/compiler/Makefile b/compiler/Makefile index b91770919..107d52d2e 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -21,7 +21,7 @@ HPX_TARBALL=$(shell pwd)/hpx-$(HPX_VERSION).tar.gz HPX_LOCAL_DIR=$(shell pwd)/hpx-$(HPX_VERSION) HPX_INSTALL_DIR?=$(HPX_LOCAL_DIR)/build -CONCRETE_CORE_FFI_VERSION?=0.2.0-rc.5 +CONCRETE_CORE_FFI_VERSION?=0.2.0 ifeq ($(shell uname), Linux) CONCRETE_CORE_FFI_TARBALL=concrete-core-ffi_$(CONCRETE_CORE_FFI_VERSION)_linux_amd64.tar.gz else diff --git a/compiler/concrete-optimizer b/compiler/concrete-optimizer index a4a1f4b11..f19becac2 160000 --- a/compiler/concrete-optimizer +++ b/compiler/concrete-optimizer @@ -1 +1 @@ -Subproject commit a4a1f4b112033c96f8a3b5c9d5664415e5b0de8f +Subproject commit f19becac21ebf9a0387c6d59287d3a59c72cef41 diff --git a/compiler/include/concretelang/Runtime/context.h b/compiler/include/concretelang/Runtime/context.h index dea37efe6..2f5244202 100644 --- a/compiler/include/concretelang/Runtime/context.h +++ b/compiler/include/concretelang/Runtime/context.h @@ -37,26 +37,26 @@ typedef struct RuntimeContext { ~RuntimeContext() { CAPI_ASSERT_ERROR(destroy_default_engine(default_engine)); - for (const auto &key : fftw_engines) { - CAPI_ASSERT_ERROR(destroy_fftw_engine(key.second)); + for (const auto &key : fft_engines) { + CAPI_ASSERT_ERROR(destroy_fft_engine(key.second)); } if (fbsk != nullptr) { - CAPI_ASSERT_ERROR(destroy_fftw_fourier_lwe_bootstrap_key_u64(fbsk)); + CAPI_ASSERT_ERROR(destroy_fft_fourier_lwe_bootstrap_key_u64(fbsk)); } } - FftwEngine *get_fftw_engine() { + FftEngine *get_fft_engine() { pthread_t threadId = pthread_self(); std::lock_guard guard(engines_map_guard); - auto engineIt = fftw_engines.find(threadId); - if (engineIt == fftw_engines.end()) { - FftwEngine *fftw_engine = nullptr; + auto engineIt = fft_engines.find(threadId); + if (engineIt == fft_engines.end()) { + FftEngine *fft_engine = nullptr; - CAPI_ASSERT_ERROR(new_fftw_engine(&fftw_engine)); + CAPI_ASSERT_ERROR(new_fft_engine(&fft_engine)); engineIt = - fftw_engines - .insert(std::pair(threadId, fftw_engine)) + fft_engines + .insert(std::pair(threadId, fft_engine)) .first; } assert(engineIt->second && "No engine available in context"); @@ -65,7 +65,7 @@ typedef struct RuntimeContext { DefaultEngine *get_default_engine() { return default_engine; } - FftwFourierLweBootstrapKey64 *get_fftw_fourier_bsk() { + FftFourierLweBootstrapKey64 *get_fft_fourier_bsk() { if (fbsk != nullptr) { return fbsk; @@ -74,8 +74,8 @@ typedef struct RuntimeContext { const std::lock_guard guard(fbskMutex); if (fbsk == nullptr) { CAPI_ASSERT_ERROR( - fftw_engine_convert_lwe_bootstrap_key_to_fftw_fourier_lwe_bootstrap_key_u64( - get_fftw_engine(), evaluationKeys.getBsk(), &fbsk)); + fft_engine_convert_lwe_bootstrap_key_to_fft_fourier_lwe_bootstrap_key_u64( + get_fft_engine(), evaluationKeys.getBsk(), &fbsk)); } return fbsk; } @@ -97,9 +97,9 @@ typedef struct RuntimeContext { private: std::mutex fbskMutex; - FftwFourierLweBootstrapKey64 *fbsk = nullptr; + FftFourierLweBootstrapKey64 *fbsk = nullptr; DefaultEngine *default_engine; - std::map fftw_engines; + std::map fft_engines; std::mutex engines_map_guard; } RuntimeContext; @@ -111,14 +111,14 @@ extern "C" { LweKeyswitchKey64 * get_keyswitch_key_u64(mlir::concretelang::RuntimeContext *context); -FftwFourierLweBootstrapKey64 * -get_fftw_fourier_bootstrap_key_u64(mlir::concretelang::RuntimeContext *context); +FftFourierLweBootstrapKey64 * +get_fft_fourier_bootstrap_key_u64(mlir::concretelang::RuntimeContext *context); LweBootstrapKey64 * get_bootstrap_key_u64(mlir::concretelang::RuntimeContext *context); DefaultEngine *get_engine(mlir::concretelang::RuntimeContext *context); -FftwEngine *get_fftw_engine(mlir::concretelang::RuntimeContext *context); +FftEngine *get_fft_engine(mlir::concretelang::RuntimeContext *context); } #endif diff --git a/compiler/lib/ClientLib/Serializers.cpp b/compiler/lib/ClientLib/Serializers.cpp index db6eddb5a..0a19839d4 100644 --- a/compiler/lib/ClientLib/Serializers.cpp +++ b/compiler/lib/ClientLib/Serializers.cpp @@ -79,16 +79,16 @@ std::ostream &operator<<(std::ostream &ostream, const LweBootstrapKey64 *key) { } std::ostream &operator<<(std::ostream &ostream, - const FftwFourierLweBootstrapKey64 *key) { - FftwSerializationEngine *engine; + const FftFourierLweBootstrapKey64 *key) { + FftSerializationEngine *engine; // No Freeing as it doesn't allocate anything. - CAPI_ASSERT_ERROR(new_fftw_serialization_engine(&engine)); + CAPI_ASSERT_ERROR(new_fft_serialization_engine(&engine)); Buffer b; CAPI_ASSERT_ERROR( - fftw_serialization_engine_serialize_fftw_fourier_lwe_bootstrap_key_u64( + fft_serialization_engine_serialize_fft_fourier_lwe_bootstrap_key_u64( engine, key, &b)) writeBufferLike(ostream, b); @@ -122,15 +122,15 @@ std::istream &operator>>(std::istream &istream, LweBootstrapKey64 *&key) { } std::istream &operator>>(std::istream &istream, - FftwFourierLweBootstrapKey64 *&key) { - FftwSerializationEngine *engine; + FftFourierLweBootstrapKey64 *&key) { + FftSerializationEngine *engine; // No Freeing as it doesn't allocate anything. - CAPI_ASSERT_ERROR(new_fftw_serialization_engine(&engine)); + CAPI_ASSERT_ERROR(new_fft_serialization_engine(&engine)); key = read_deser( istream, - fftw_serialization_engine_deserialize_fftw_fourier_lwe_bootstrap_key_u64, + fft_serialization_engine_deserialize_fft_fourier_lwe_bootstrap_key_u64, engine); return istream; } diff --git a/compiler/lib/Runtime/AsyncOffload.cpp b/compiler/lib/Runtime/AsyncOffload.cpp index 4d674e978..c9c5c18d6 100644 --- a/compiler/lib/Runtime/AsyncOffload.cpp +++ b/compiler/lib/Runtime/AsyncOffload.cpp @@ -66,9 +66,9 @@ void async_bootstrap( expanded_tabulated_function_array.data(), poly_size)); CAPI_ASSERT_ERROR( - fftw_engine_lwe_ciphertext_discarding_bootstrap_u64_raw_ptr_buffers( - get_fftw_engine(context), get_engine(context), - get_fftw_fourier_bootstrap_key_u64(context), out_aligned + out_offset, + fft_engine_lwe_ciphertext_discarding_bootstrap_u64_raw_ptr_buffers( + get_fft_engine(context), get_engine(context), + get_fft_fourier_bootstrap_key_u64(context), out_aligned + out_offset, ct0_aligned + ct0_offset, glwe_ct)); promise.set_value(concretelang::clientlib::MemRefDescriptor<1>{ out_allocated, out_aligned, out_offset, {out_size}, {out_stride}}); diff --git a/compiler/lib/Runtime/context.cpp b/compiler/lib/Runtime/context.cpp index 2377d59c7..c5a7bdd98 100644 --- a/compiler/lib/Runtime/context.cpp +++ b/compiler/lib/Runtime/context.cpp @@ -19,15 +19,15 @@ get_bootstrap_key_u64(mlir::concretelang::RuntimeContext *context) { return context->get_bsk(); } -FftwFourierLweBootstrapKey64 *get_fftw_fourier_bootstrap_key_u64( - mlir::concretelang::RuntimeContext *context) { - return context->get_fftw_fourier_bsk(); +FftFourierLweBootstrapKey64 * +get_fft_fourier_bootstrap_key_u64(mlir::concretelang::RuntimeContext *context) { + return context->get_fft_fourier_bsk(); } DefaultEngine *get_engine(mlir::concretelang::RuntimeContext *context) { return context->get_default_engine(); } -FftwEngine *get_fftw_engine(mlir::concretelang::RuntimeContext *context) { - return context->get_fftw_engine(); +FftEngine *get_fft_engine(mlir::concretelang::RuntimeContext *context) { + return context->get_fft_engine(); } diff --git a/compiler/lib/Runtime/wrappers.cpp b/compiler/lib/Runtime/wrappers.cpp index 96d873e65..3dc17c2c2 100644 --- a/compiler/lib/Runtime/wrappers.cpp +++ b/compiler/lib/Runtime/wrappers.cpp @@ -360,9 +360,9 @@ void memref_bootstrap_lwe_u64( expanded_tabulated_function_array.data(), poly_size)); CAPI_ASSERT_ERROR( - fftw_engine_lwe_ciphertext_discarding_bootstrap_u64_raw_ptr_buffers( - get_fftw_engine(context), get_engine(context), - get_fftw_fourier_bootstrap_key_u64(context), out_aligned + out_offset, + fft_engine_lwe_ciphertext_discarding_bootstrap_u64_raw_ptr_buffers( + get_fft_engine(context), get_engine(context), + get_fft_fourier_bootstrap_key_u64(context), out_aligned + out_offset, ct0_aligned + ct0_offset, glwe_ct)); free(glwe_ct); } @@ -476,9 +476,9 @@ void memref_wop_pbs_crt_buffer( (uint64_t(1) << (uint64_t(64) - nb_bits_to_extract - 5)); in_block[lwe_big_size - 1] -= sub; CAPI_ASSERT_ERROR( - fftw_engine_lwe_ciphertext_discarding_bit_extraction_unchecked_u64_raw_ptr_buffers( - context->get_fftw_engine(), context->get_default_engine(), - context->get_fftw_fourier_bsk(), context->get_ksk(), + fft_engine_lwe_ciphertext_discarding_bit_extraction_unchecked_u64_raw_ptr_buffers( + context->get_fft_engine(), context->get_default_engine(), + context->get_fft_fourier_bsk(), context->get_ksk(), &extract_bits_output_buffer[lwe_small_size * extract_bits_output_offset], in_block, nb_bits_to_extract, delta_log)); @@ -493,9 +493,9 @@ void memref_wop_pbs_crt_buffer( // Vertical packing CAPI_ASSERT_ERROR( - fftw_engine_lwe_ciphertext_vector_discarding_circuit_bootstrap_boolean_vertical_packing_u64_raw_ptr_buffers( - context->get_fftw_engine(), context->get_default_engine(), - context->get_fftw_fourier_bsk(), out_aligned, lwe_big_size, + fft_engine_lwe_ciphertext_vector_discarding_circuit_bootstrap_boolean_vertical_packing_u64_raw_ptr_buffers( + context->get_fft_engine(), context->get_default_engine(), + context->get_fft_fourier_bsk(), out_aligned, lwe_big_size, crt_decomp_size, extract_bits_output_buffer, lwe_small_size, total_number_of_bits_per_block, luts_crt, luts_crt_size, cbs_level_count, cbs_base_log, context->get_fpksk()));