diff --git a/examples/C/mpc/benchmarks/cryptonets/cryptonets.c b/examples/C/mpc/benchmarks/cryptonets/cryptonets.c index 61ffa200..f43b552a 100644 --- a/examples/C/mpc/benchmarks/cryptonets/cryptonets.c +++ b/examples/C/mpc/benchmarks/cryptonets/cryptonets.c @@ -1,10 +1,10 @@ // Parameters taken from the paper -#define IMAGE_WIDTH 28 // 28 +#define IMAGE_WIDTH 16 // 28 #define WINDOW_WIDTH 5 #define STRIDE 2 #define OUTPUT_CHANNELS 5 // 5 -#define IMAGE_CROP 13 // 13 with padding +#define IMAGE_CROP 5 // 13 with padding #define SIZE_CONVOLUTION (IMAGE_CROP * IMAGE_CROP) // 169 #define FULLY_CONNECTED_WIDTH 100 // (7, 9) @@ -20,7 +20,6 @@ DT relu(DT val) { } } - DT activate_sqr(DT val) { DT res = val*val; return res; @@ -162,25 +161,67 @@ typedef struct DT final_layer[FINAL_OUTPUT_CHANNELS]; } Output; + +DT mmulT_unrolled_inner_2(DT* a, DT* b) { + DT sum = 0; + // int i = 0; + // // Add the first as groups of eight + // for (i=0; i+8< OUTPUT_CHANNELS * SIZE_CONVOLUTION; i+=8) { + // sum += a[i+0]*b[i+0] + a[i+1]*b[i+1] + a[i+2]*b[i+2] + a[i+3]*b[i+3] + a[i+4]*b[i+4] + a[i+5]*b[i+5] + a[i+6]*b[i+6] + a[i+7]*b[i+7]; + // } + // if(i+4 ToABY<'a> { .join(" ") } - fn get_md(&self) -> ComputationMetadata { - self.fs - .computations - .get(&self.curr_comp) - .unwrap() - .metadata - .clone() + fn get_md(&self) -> &ComputationMetadata { + &self.fs.computations.get(&self.curr_comp).unwrap().metadata } fn get_var_name(name: &String) -> String {