NVlabs / CGBN

CGBN: CUDA Accelerated Multiple Precision Arithmetic (Big Num) using Cooperative Groups
Other
206 stars 55 forks source link

Add cgbn_swap #17

Closed sethtroisi closed 3 years ago

sethtroisi commented 3 years ago

Uses mpswap<LIMBS> which was already written for GCD.

Added and ran tests

[==========] Running 880 tests from 55 test suites.
[----------] Global test environment set-up.
[----------] 23 tests from S32T4/CGBN1/0, where TypeParam = size32t4
[ RUN      ] S32T4/CGBN1/0.set_1
[       OK ] S32T4/CGBN1/0.set_1 (577 ms)
[ RUN      ] S32T4/CGBN1/0.swap_1
[       OK ] S32T4/CGBN1/0.swap_1 (29 ms)
...
[----------] 23 tests from S3072T32/CGBN1/0, where TypeParam = size3072t32
[ RUN      ] S3072T32/CGBN1/0.set_1
[       OK ] S3072T32/CGBN1/0.set_1 (1944 ms)
[ RUN      ] S3072T32/CGBN1/0.swap_1
[       OK ] S3072T32/CGBN1/0.swap_1 (434 ms)
...
[ RUN      ] S8192T32/CGBN1/0.set_1
[       OK ] S8192T32/CGBN1/0.set_1 (1793 ms)
[ RUN      ] S8192T32/CGBN1/0.swap_1
[       OK ] S8192T32/CGBN1/0.swap_1 (429 ms)
...
[----------] Global test environment tear-down
[==========] 880 tests from 55 test suites ran. (259412 ms total)
[  PASSED  ] 880 tests.
sethtroisi commented 3 years ago

@nemmart This is a trivial merge (you had already written mpswap<LIMBS>). I would love if it could go in as the alternative is 3x cgbn_set which can be replaced a single cgbn_swap

nemmart commented 3 years ago

Hi Seth, I've been quite busy at work.  I'll get to this next week. Thanks,Niall On Tuesday, September 14, 2021, 08:54:39 PM EDT, Seth Troisi @.***> wrote:

@nemmart This is a trivial merge (you had already written mpswap). I would love if it could go in as the alternative is 3x cgbn_set which can be replaced a single cgbn_swap

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

sethtroisi commented 3 years ago

@nemmart I'm working on upstreaming my cuda code and would love to be able to include cgbn_swap instead of the 3-way set

sethtroisi commented 3 years ago

Thanks!