mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 20:25:34 -05:00
41 lines
966 B
C++
41 lines
966 B
C++
// Part of the Concrete Compiler Project, under the BSD3 License with Zama
|
|
// Exceptions. See
|
|
// https://github.com/zama-ai/concrete-compiler-internal/blob/master/LICENSE.txt
|
|
// for license information.
|
|
|
|
#ifndef CONCRETELANG_RUNTIME_CONTEXT_H
|
|
#define CONCRETELANG_RUNTIME_CONTEXT_H
|
|
|
|
#include <map>
|
|
#include <string>
|
|
|
|
extern "C" {
|
|
#include "concrete-ffi.h"
|
|
}
|
|
|
|
namespace mlir {
|
|
namespace concretelang {
|
|
typedef struct RuntimeContext {
|
|
LweKeyswitchKey_u64 *ksk;
|
|
std::map<std::string, LweBootstrapKey_u64 *> bsk;
|
|
|
|
~RuntimeContext() {
|
|
int err;
|
|
for (const auto &key : bsk) {
|
|
if (key.first != "_concretelang_base_context_bsk")
|
|
free_lwe_bootstrap_key_u64(&err, key.second);
|
|
}
|
|
}
|
|
} RuntimeContext;
|
|
} // namespace concretelang
|
|
} // namespace mlir
|
|
|
|
extern "C" {
|
|
LweKeyswitchKey_u64 *
|
|
get_keyswitch_key(mlir::concretelang::RuntimeContext *context);
|
|
|
|
LweBootstrapKey_u64 *
|
|
get_bootstrap_key(mlir::concretelang::RuntimeContext *context);
|
|
}
|
|
#endif
|