mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-16 15:45:44 -05:00
58 lines
2.6 KiB
C++
58 lines
2.6 KiB
C++
// Part of the Concrete Compiler Project, under the BSD3 License with Zama
|
|
// Exceptions. See
|
|
// https://github.com/zama-ai/concrete-compiler-internal/blob/main/LICENSE.txt
|
|
// for license information.
|
|
|
|
/// Define the API exposed to the compiler for streaming code generation.
|
|
|
|
#ifndef CONCRETELANG_STREAM_EMULATOR_API_H
|
|
#define CONCRETELANG_STREAM_EMULATOR_API_H
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <cstdlib>
|
|
|
|
typedef enum stream_type {
|
|
TS_STREAM_TYPE_X86_TO_TOPO_LSAP,
|
|
TS_STREAM_TYPE_TOPO_TO_TOPO_LSAP,
|
|
TS_STREAM_TYPE_TOPO_TO_X86_LSAP
|
|
} stream_type;
|
|
|
|
extern "C" {
|
|
void *stream_emulator_init();
|
|
void stream_emulator_run(void *dfg);
|
|
void stream_emulator_delete(void *dfg);
|
|
|
|
void stream_emulator_make_memref_add_lwe_ciphertexts_u64_process(void *dfg,
|
|
void *sin1,
|
|
void *sin2,
|
|
void *sout);
|
|
void stream_emulator_make_memref_add_plaintext_lwe_ciphertext_u64_process(
|
|
void *dfg, void *sin1, void *sin2, void *sout);
|
|
void stream_emulator_make_memref_mul_cleartext_lwe_ciphertext_u64_process(
|
|
void *dfg, void *sin1, void *sin2, void *sout);
|
|
void stream_emulator_make_memref_negate_lwe_ciphertext_u64_process(void *dfg,
|
|
void *sin1,
|
|
void *sout);
|
|
void stream_emulator_make_memref_keyswitch_lwe_u64_process(
|
|
void *dfg, void *sin1, void *sout, uint32_t level, uint32_t base_log,
|
|
uint32_t input_lwe_dim, uint32_t output_lwe_dim, void *context);
|
|
void stream_emulator_make_memref_bootstrap_lwe_u64_process(
|
|
void *dfg, void *sin1, void *sin2, void *sout, uint32_t input_lwe_dim,
|
|
uint32_t poly_size, uint32_t level, uint32_t base_log, uint32_t glwe_dim,
|
|
uint32_t precision, void *context);
|
|
|
|
void *stream_emulator_make_uint64_stream(const char *name, stream_type stype);
|
|
void stream_emulator_put_uint64(void *stream, uint64_t e);
|
|
uint64_t stream_emulator_get_uint64(void *stream);
|
|
|
|
void *stream_emulator_make_memref_stream(const char *name, stream_type stype);
|
|
void stream_emulator_put_memref(void *stream, uint64_t *allocated,
|
|
uint64_t *aligned, uint64_t offset,
|
|
uint64_t size, uint64_t stride);
|
|
void stream_emulator_get_memref(void *stream, uint64_t *out_allocated,
|
|
uint64_t *out_aligned, uint64_t out_offset,
|
|
uint64_t out_size, uint64_t out_stride);
|
|
}
|
|
|
|
#endif
|