20130220, 20:39  #12 
"Vincent"
Apr 2010
Over the rainbow
2^{2}×7×103 Posts 
Since we were taking about mersenne test,my first ideas would include arrays,
multiple MillersRabin primality test, and modulo operation. But I realise that would only work for the first phase of a P1. naive implementation : split B1 range in as many core1 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 20130220 at 20:47 
20130220, 23:39  #13 
"Carl Darby"
Oct 2012
Spring Mountains, Nevada
473_{8} Posts 

20130220, 23:56  #14 
If I May
"Chris Halsall"
Sep 2002
Barbados
2×5,531 Posts 

20130223, 09:06  #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/P1?) Finding the round peg for a round hole analogy comes to mind.  Craig 
20130226, 20:17  #16  
∂^{2}ω=0
Sep 2002
República de California
5×2,351 Posts 
Quote:
All the core ops for p1 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 "poweringup" 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 forwardFFTed form. Those get pointwisemultiplied by a "live" forwardFFTed dataset (i.e. the dyadicmul takes data from 2 vectors and combines them, as opposed to the singlevectordata 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. 

20130226, 21:31  #17  
"Carl Darby"
Oct 2012
Spring Mountains, Nevada
3^{2}·5·7 Posts 
Quote:
Last fiddled with by owftheevil on 20130226 at 21:32 

20130226, 22:04  #18 
∂^{2}ω=0
Sep 2002
República de California
2DEB_{16} 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 thirdparty code (GMP or George's optimized version of the Crandall/Buhler "giants library" GCD.

20130227, 01:37  #19 
"Carl Darby"
Oct 2012
Spring Mountains, Nevada
3^{2}·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.

20130227, 02:39  #20 
"Carl Darby"
Oct 2012
Spring Mountains, Nevada
3^{2}·5·7 Posts 
Protocudapm1 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? 
20130227, 11:21  #21  
Just call me Henry
"David"
Sep 2007
Liverpool (GMT/BST)
178F_{16} 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^expo1 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 

20130227, 13:20  #22  
Banned
"Luigi"
Aug 2002
Team Italia
1001011111001_{2} Posts 
Quote:
Luigi 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
mfaktc: a CUDA program for Mersenne prefactoring  TheJudger  GPU Computing  3622  20230125 16:41 
World's seconddumbest CUDA program  fivemack  Programming  112  20150212 22:51 
World's dumbest CUDA program?  xilman  Programming  1  20091116 10:26 
Factoring program need help  Citrix  Lone Mersenne Hunters  8  20050916 02:31 
Factoring program  ET_  Programming  3  20031125 02:57 