Hi. I have been playing around with the parallel keyword a bit and discovered that declaring parallel at component level renders it useless. Please look at the following toy example:
version - 2.1.6doublemultiplier.circom
pragma circom 2.1.6;
template DoubleMultiplier() {
signal input in[4];
signal output out[2];
component multiplier[2];
for (var i=0; i<2; i++) {
multiplier[i] = parallel Multiplier();
multiplier[i].in1 <== in[i*2];
multiplier[i].in2 <== in[i*2+1];
out[i] <== multiplier[i].out;
}
}
template Multiplier() {
signal input in1;
signal input in2;
signal output out;
out <== in1 * in2;
}
component main = DoubleMultiplier();
Three build folder for the following cases:
parallel not used - build_non_parallel
parallel used at component level - build_component_parallel
parallel used at template level - build_template_parallel
After building with circom, running diff -r for build_non_parallel and build_component_parallel produces an empty output, whereas running diff -r for build_non_parallel and build_template_parallel produces non empty output, the following:
Hi. I have been playing around with the
parallel
keyword a bit and discovered that declaringparallel
at component level renders it useless. Please look at the following toy example: version -2.1.6
doublemultiplier.circomThree build folder for the following cases:
parallel
not used -build_non_parallel
parallel
used at component level -build_component_parallel
parallel
used at template level -build_template_parallel
After building with
circom
, runningdiff -r
forbuild_non_parallel
andbuild_component_parallel
produces an empty output, whereas runningdiff -r
forbuild_non_parallel
andbuild_template_parallel
produces non empty output, the following: