Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move staticFor to the inner repo #216

Merged
merged 1 commit into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion benchmarks/bench_ec_g1.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian],
# Helpers
../helpers/static_for,
./bench_elliptic_template

# ############################################################
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench_ec_g1_batch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import
ec_shortweierstrass_batch_ops_parallel],
../constantine/platforms/threadpool/threadpool,
# Helpers
../helpers/[static_for, prng_unsafe],
../helpers/prng_unsafe,
./bench_elliptic_template,
./bench_blueprint

Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_ec_g2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import
ec_shortweierstrass_projective,
ec_shortweierstrass_jacobian],
# Helpers
../helpers/static_for,
./bench_elliptic_template,
# Standard library
std/strutils
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench_fields_template.nim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import
../helpers/prng_unsafe,
./bench_blueprint

export notes
export notes, abstractions
proc separator*() = separator(165)
proc smallSeparator*() = separator(8)

Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_fp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import
../constantine/math/io/io_bigints,
../constantine/math/constants/zoo_square_roots,
# Helpers
../helpers/static_for,
./bench_fields_template

# ############################################################
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_fp12.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import
../constantine/math/config/curves,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_fields_template

# ############################################################
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_fp2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import
../constantine/math/config/curves,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_fields_template

# ############################################################
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_fp4.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import
../constantine/math/config/curves,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_fields_template

# ############################################################
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_fp6.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import
../constantine/math/config/curves,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_fields_template

# ############################################################
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/bench_fp_double_precision.nim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import
../constantine/math/arithmetic,
../constantine/math/extension_fields,
# Helpers
../helpers/[prng_unsafe, static_for],
../helpers/prng_unsafe,
./platforms,
# Standard library
std/[monotimes, times, strformat, strutils]
Expand Down Expand Up @@ -218,7 +218,7 @@ proc reduce2x*(T: typedesc, iters: int) =
r.redc2x(t)

proc reduce2xViaDivision*(T: typedesc, iters: int) =

const bits2x = 2 * T.C.getCurveBitWidth()
var r: matchingBigInt(T.C)
let t = rng.random_unsafe(BigInt[bits2x])
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_pairing_bls12_377.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import
../constantine/math/arithmetic,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_pairing_template

# ############################################################
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_pairing_bls12_381.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import
../constantine/math/arithmetic,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_pairing_template

# ############################################################
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_pairing_bn254_nogami.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import
../constantine/math/arithmetic,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_pairing_template

# ############################################################
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_pairing_bn254_snarks.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import
../constantine/math/arithmetic,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_pairing_template

# ############################################################
Expand Down
1 change: 1 addition & 0 deletions benchmarks/bench_pairing_template.nim
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import
../helpers/prng_unsafe,
./bench_blueprint

export abstractions
export zoo_pairings # generic sandwich https://github.com/nim-lang/Nim/issues/11225
export notes
proc separator*() = separator(132)
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_summary_bls12_377.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import
../constantine/math/arithmetic,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_summary_template

# ############################################################
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_summary_bls12_381.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import
../constantine/math/arithmetic,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_summary_template

# ############################################################
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_summary_bn254_nogami.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import
../constantine/math/arithmetic,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_summary_template

# ############################################################
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_summary_bn254_snarks.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import
../constantine/math/arithmetic,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_summary_template

# ############################################################
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_summary_pasta.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import
../constantine/math/arithmetic,
../constantine/math/extension_fields,
# Helpers
../helpers/static_for,
./bench_summary_template

# ############################################################
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench_summary_template.nim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import
../constantine/hashes,
../constantine/hash_to_curve/hash_to_curve,
# Helpers
../helpers/[prng_unsafe, static_for],
../helpers/prng_unsafe,
./bench_blueprint

export
Expand Down
2 changes: 1 addition & 1 deletion constantine/platforms/primitives.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import
extended_precision
],
./bithacks,
../../helpers/static_for
./static_for

export
ct_types,
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions tests/gpu/t_nvidia_fp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms.


import
import
# Standard library
std/[unittest, times],
# Internal
Expand All @@ -17,7 +17,7 @@ import
../../constantine/math/arithmetic,
../../constantine/math_gpu/fields_nvidia,
# Test utilities
../../helpers/[prng_unsafe, static_for]
../../helpers/prng_unsafe

var rng: RngState
let seed = uint32(getTime().toUnix() and (1'i64 shl 32 - 1)) # unixTime mod 2^32
Expand Down Expand Up @@ -87,7 +87,7 @@ proc t_field_add(curve: static Curve) =
let b = rng.random_long01Seq(Fp[curve])

var rCPU, rGPU_32, rGPU_64: Fp[curve]

rCPU.sum(a, b)
fpAdd32.exec(rGPU_32, a, b)
fpAdd64.exec(rGPU_64, a, b)
Expand All @@ -101,7 +101,7 @@ proc t_field_add(curve: static Curve) =
let b = rng.random_long01Seq(Fr[curve])

var rCPU, rGPU_32, rGPU_64: Fr[curve]

rCPU.sum(a, b)
frAdd32.exec(rGPU_32, a, b)
frAdd64.exec(rGPU_64, a, b)
Expand Down
2 changes: 1 addition & 1 deletion tests/math/t_fp12_exponentiation.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import
../../constantine/math/config/curves,
../../constantine/math/io/io_extfields,
# Test utilities
../../helpers/[prng_unsafe, static_for]
../../helpers/prng_unsafe

const
Iters = 2
Expand Down
2 changes: 1 addition & 1 deletion tests/math/t_fp2_sqrt.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import
../../constantine/math/config/curves,
../../constantine/math/io/io_extfields,
# Test utilities
../../helpers/[prng_unsafe, static_for]
../../helpers/prng_unsafe

const
Iters = 8
Expand Down
2 changes: 1 addition & 1 deletion tests/math/t_fp_tower_frobenius_template.nim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import
../../constantine/math/arithmetic,
../../constantine/math/isogenies/frobenius,
# Test utilities
../../helpers/[prng_unsafe, static_for]
../../helpers/prng_unsafe

export unittest # Generic sandwich

Expand Down
2 changes: 1 addition & 1 deletion tests/math/t_fp_tower_template.nim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import
../../constantine/math/arithmetic,
../../constantine/math/io/io_extfields,
# Test utilities
../../helpers/[prng_unsafe, static_for]
../../helpers/prng_unsafe

export unittest # Generic sandwich

Expand Down
2 changes: 1 addition & 1 deletion tests/math/t_pairing_bls12_377_line_functions.nim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import
ec_scalar_mul],
../../constantine/math/pairings/lines_eval,
# Test utilities
../../helpers/[prng_unsafe, static_for]
../../helpers/prng_unsafe

const
Iters = 4
Expand Down
2 changes: 1 addition & 1 deletion tests/math/t_pairing_bls12_381_line_functions.nim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import
ec_shortweierstrass_projective],
../../constantine/math/pairings/lines_eval,
# Test utilities
../../helpers/[prng_unsafe, static_for]
../../helpers/prng_unsafe

const
Iters = 4
Expand Down
2 changes: 1 addition & 1 deletion tests/math/t_pairing_cyclotomic_subgroup.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import
../../constantine/math/pairings/cyclotomic_subgroups,
../../constantine/math/isogenies/frobenius,
# Test utilities
../../helpers/[prng_unsafe, static_for]
../../helpers/prng_unsafe

const
Iters = 4
Expand Down
2 changes: 1 addition & 1 deletion tests/math/t_pairing_mul_fp12_by_lines.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import
../../constantine/math/io/io_extfields,
../../constantine/math/pairings/lines_eval,
# Test utilities
../../helpers/[prng_unsafe, static_for]
../../helpers/prng_unsafe

const
Iters = 8
Expand Down