Merge 0b7e5b912c2b51cf995f67c4484595fab4b57194 into d790dc3162b828f87abc3ccf3eb181616d5047e9

This commit is contained in:
Jaremy Creechley 2024-03-02 16:48:38 -07:00 committed by GitHub
commit bbcc76b0b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 8 deletions

View File

@ -1,2 +1,5 @@
--path:".."
--threads:on
--threads:on
--gc:orc
--release
# --debug

View File

@ -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"

View File

@ -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