![]() |
![]() |
#12 |
"Vincent"
Apr 2010
Over the rainbow
22×7×103 Posts |
![]()
Since we were taking about mersenne test,my first ideas would include arrays,
multiple Millers-Rabin primality test, and modulo operation. But I realise that would only work for the first phase of a P-1. naive implementation : split B1 range in as many core-1 as there is, determine k, calculate 2*k*p+1, if prime (determined by MR test)=> k in array last core would take care of the value in the array and determine if it divide Mp Last fiddled with by firejuggler on 2013-02-20 at 20:47 |
![]() |
![]() |
![]() |
#13 |
"Carl Darby"
Oct 2012
Spring Mountains, Nevada
4738 Posts |
![]() |
![]() |
![]() |
![]() |
#14 |
If I May
"Chris Halsall"
Sep 2002
Barbados
2×5,531 Posts |
![]() |
![]() |
![]() |
![]() |
#15 |
Mar 2003
Melbourne
5·103 Posts |
![]()
Thinking outside the box for a minute.
Is there any other primality/factoring tests that would easily suit GPUs and deliver pretty good search percentages over time? (similar to percentage chance of finding a factor close to the time of TF/P-1?) Finding the round peg for a round hole analogy comes to mind. -- Craig |
![]() |
![]() |
![]() |
#16 | |
∂2ω=0
Sep 2002
República de California
5×2,351 Posts |
![]() Quote:
All the core ops for p-1 are quite similar to what you know from the lens of LL testing, just a couple twists: 1. For stage 1 you need to decide whether you want to use a fixed bound B1 or allow for later "powering-up" of a previous stage 1 residue to a larger B1. Most efficient is a fixed B1, that way you can precompute the product of all the needed stage 1 prime powers and use the resulting bitstring for fast LR binary modpow; 2. For stage 2 you need to precompute a set of small powers of the stage 1 residue, and store those in RAM in forward-FFTed form. Those get pointwise-multiplied by a "live" forward-FFTed dataset (i.e. the dyadic-mul takes data from 2 vectors and combines them, as opposed to the single-vector-data squaring used in LL) and then iFFT/carry steps are as before. Multiple stage 2 intervals can run in parallel starting with a common stage 1 residue. But what you really need to do first of all is some kind of "simple" implementation of the algorithm in HLL code ... useless to try to port an algorithm to specialized hardware unless you understand it in some detail. |
|
![]() |
![]() |
![]() |
#17 | |
"Carl Darby"
Oct 2012
Spring Mountains, Nevada
32·5·7 Posts |
![]() Quote:
Last fiddled with by owftheevil on 2013-02-26 at 21:32 |
|
![]() |
![]() |
![]() |
#18 |
∂2ω=0
Sep 2002
República de California
2DEB16 Posts |
![]()
GCD need be done infrequently enough - once at the end of stage 1 and perhaps every few hours during stage 2 - that one should just use some decent third-party code (GMP or George's optimized version of the Crandall/Buhler "giants library" GCD.
|
![]() |
![]() |
![]() |
#19 |
"Carl Darby"
Oct 2012
Spring Mountains, Nevada
32·5·7 Posts |
![]()
Pretty much what I had in mind. I was thinking at first to do the product of the prime powers with gmp too. Also, maybe its possible to save the result of stage 1 in mprime or prime95 readable format and let those programs finish up the stage 2. On many cards without much memory this would be useful.
|
![]() |
![]() |
![]() |
#20 |
"Carl Darby"
Oct 2012
Spring Mountains, Nevada
32·5·7 Posts |
![]()
Proto-cuda-pm1 now computes powers of 3. Now to teach it which powers of 3 to compute.
Anybody know where i can get some residues of relatively small powers of 3 mod 2^q - 1 for various value of q? |
![]() |
![]() |
![]() |
#21 | |
Just call me Henry
"David"
Sep 2007
Liverpool (GMT/BST)
178F16 Posts |
![]() Quote:
Code:
SCRIPT DIM expo, 31 DIM base, 3 DIM max_n, 100 DIM min_n, 1 OPENFILEAPP r_file,results.txt DIM n, min_n DIM result, 0 DIM mers, 2^expo-1 DIMS rstr LABEL next_n POWMOD result,base,n,mers WRITE r_file,result SET n, n+1 IF (n<=max_n) THEN GOTO next_n LABEL end |
|
![]() |
![]() |
![]() |
#22 | |
Banned
"Luigi"
Aug 2002
Team Italia
10010111110012 Posts |
![]() Quote:
![]() Luigi |
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
mfaktc: a CUDA program for Mersenne prefactoring | TheJudger | GPU Computing | 3622 | 2023-01-25 16:41 |
World's second-dumbest CUDA program | fivemack | Programming | 112 | 2015-02-12 22:51 |
World's dumbest CUDA program? | xilman | Programming | 1 | 2009-11-16 10:26 |
Factoring program need help | Citrix | Lone Mersenne Hunters | 8 | 2005-09-16 02:31 |
Factoring program | ET_ | Programming | 3 | 2003-11-25 02:57 |