mirror of
https://github.com/logos-storage/nim-groth16.git
synced 2026-01-06 23:53:12 +00:00
Merge 0b7e5b912c2b51cf995f67c4484595fab4b57194 into d790dc3162b828f87abc3ccf3eb181616d5047e9
This commit is contained in:
commit
bbcc76b0b2
@ -1,2 +1,5 @@
|
||||
--path:".."
|
||||
--threads:on
|
||||
--threads:on
|
||||
--gc:orc
|
||||
--release
|
||||
# --debug
|
||||
|
||||
@ -7,5 +7,5 @@ skipDirs = @["groth16/example"]
|
||||
binDir = "build"
|
||||
namedBin = {"cli/cli_main": "nim-groth16"}.toTable()
|
||||
|
||||
requires "https://github.com/status-im/nim-taskpools"
|
||||
requires "https://github.com/status-im/nim-taskpools >= 0.0.5"
|
||||
requires "https://github.com/mratsim/constantine#5f7ba18f2ed351260015397c9eae079a6decaee1"
|
||||
@ -107,6 +107,7 @@ func multiplyByPowers( xs: seq[Fr], eta: Fr ): seq[Fr] =
|
||||
|
||||
# interpolates a polynomial, shift the variable by `eta`, and compute the shifted values
|
||||
func shiftEvalDomain( values: seq[Fr], D: Domain, eta: Fr ): seq[Fr] =
|
||||
echo "task: abc.values: ", values[0].unsafeAddr.pointer.repr
|
||||
let poly : Poly = polyInverseNTT( values , D )
|
||||
let cs : seq[Fr] = poly.coeffs
|
||||
var ds : seq[Fr] = multiplyByPowers( cs, eta )
|
||||
@ -128,16 +129,13 @@ proc computeQuotientPointwise( nthreads: int, abc: ABC ): Poly =
|
||||
let invZ1 = invFr( smallPowFr(eta,n) - oneFr )
|
||||
|
||||
var pool = Taskpool.new(num_threads = nthreads)
|
||||
GCref(abc.valuesAz)
|
||||
GCref(abc.valuesBz)
|
||||
GCref(abc.valuesCz)
|
||||
echo "main: abc.valuesAz: ", abc.valuesAz[0].unsafeAddr.pointer.repr
|
||||
echo "main: abc.valuesBz: ", abc.valuesBz[0].unsafeAddr.pointer.repr
|
||||
echo "main: abc.valuesCz: ", abc.valuesCz[0].unsafeAddr.pointer.repr
|
||||
var A1fv : FlowVar[seq[Fr]] = pool.spawn shiftEvalDomain( abc.valuesAz, D, eta )
|
||||
var B1fv : FlowVar[seq[Fr]] = pool.spawn shiftEvalDomain( abc.valuesBz, D, eta )
|
||||
var C1fv : FlowVar[seq[Fr]] = pool.spawn shiftEvalDomain( abc.valuesCz, D, eta )
|
||||
pool.syncAll()
|
||||
GCunref(abc.valuesAz)
|
||||
GCunref(abc.valuesBz)
|
||||
GCunref(abc.valuesCz)
|
||||
let A1 = sync A1fv
|
||||
let B1 = sync B1fv
|
||||
let C1 = sync C1fv
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user