fix(compiler): conversion to optimizer dag, bad dot before signed lut

this has no effect apart making the shape incorrect
This commit is contained in:
rudy
2023-09-15 14:37:58 +02:00
committed by Quentin Bourgerie
parent f988eccd57
commit 1c0a70f911
4 changed files with 17 additions and 3 deletions

View File

@@ -203,9 +203,8 @@ struct FunctionToDag {
if (inputType.isSigned()) {
// std::vector<std::int64_t> weights_vector{1};
auto addIndex = dag->add_dot(slice(encrypted_inputs),
concrete_optimizer::weights::vector(
slice(std::vector<std::int64_t>{1})));
encrypted_inputs[0] = addIndex;
concrete_optimizer::weights::number(1));
encrypted_input = addIndex;
operatorIndexes.push_back(addIndex.index);
}
auto lutIndex =

View File

@@ -574,6 +574,10 @@ fn vector(weights: &[i64]) -> Box<Weights> {
Box::new(Weights(operator::Weights::vector(weights)))
}
fn number(weight: i64) -> Box<Weights> {
Box::new(Weights(operator::Weights::number(weight)))
}
impl From<OperatorIndex> for ffi::OperatorIndex {
fn from(oi: OperatorIndex) -> Self {
Self { index: oi.i }
@@ -671,6 +675,9 @@ mod ffi {
#[namespace = "concrete_optimizer::weights"]
fn vector(weights: &[i64]) -> Box<Weights>;
#[namespace = "concrete_optimizer::weights"]
fn number(weight: i64) -> Box<Weights>;
fn optimize_multi(self: &OperationDag, _options: Options) -> CircuitSolution;
fn NO_KEY_ID() -> u64;

View File

@@ -1292,6 +1292,8 @@ extern "C" {
namespace weights {
extern "C" {
::concrete_optimizer::Weights *concrete_optimizer$weights$cxxbridge1$vector(::rust::Slice<::std::int64_t const> weights) noexcept;
::concrete_optimizer::Weights *concrete_optimizer$weights$cxxbridge1$number(::std::int64_t weight) noexcept;
} // extern "C"
} // namespace weights
@@ -1391,6 +1393,10 @@ namespace weights {
::rust::Box<::concrete_optimizer::Weights> vector(::rust::Slice<::std::int64_t const> weights) noexcept {
return ::rust::Box<::concrete_optimizer::Weights>::from_raw(concrete_optimizer$weights$cxxbridge1$vector(weights));
}
::rust::Box<::concrete_optimizer::Weights> number(::std::int64_t weight) noexcept {
return ::rust::Box<::concrete_optimizer::Weights>::from_raw(concrete_optimizer$weights$cxxbridge1$number(weight));
}
} // namespace weights
::concrete_optimizer::dag::CircuitSolution OperationDag::optimize_multi(::concrete_optimizer::Options _options) const noexcept {

View File

@@ -1232,6 +1232,8 @@ namespace dag {
namespace weights {
::rust::Box<::concrete_optimizer::Weights> vector(::rust::Slice<::std::int64_t const> weights) noexcept;
::rust::Box<::concrete_optimizer::Weights> number(::std::int64_t weight) noexcept;
} // namespace weights
::std::uint64_t NO_KEY_ID() noexcept;