mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Hardware > GPU Computing

Reply
 
Thread Tools
Old 2013-03-17, 09:28   #166
prime7989
 
Jun 2012

17 Posts
Smile Extend GeneferCUDA pseudo-primality checks

Quote:
Originally Posted by axn View Post
There are many versions of G/CUDA out there. If you can post the one you want to look at (as a forum attachment), I can tell you. FWIW, the change is easy and localised to "check" function.

Thank you axn,
I would also like to make the change to GeneferCUDA,cu such that the input instead of:
n=b^N+1
is as follows: n=b^N+c where c is an non-zero integer such that |c|<Log(n).
Thank you,
Prime7989
Attached Files
File Type: pdf GeneferCUDA.pdf (146.6 KB, 208 views)
prime7989 is offline   Reply With Quote
Old 2013-03-17, 15:57   #167
axn
 
axn's Avatar
 
Jun 2003

32·5·113 Posts
Default

Quote:
Originally Posted by prime7989 View Post
Thank you axn,
I would also like to make the change to GeneferCUDA,cu such that the input instead of:
n=b^N+1
is as follows: n=b^N+c where c is an non-zero integer such that |c|<Log(n).
Thank you,
Prime7989
For changing the base used for test, you need to modify the two lines in check() function from:
Code:
const double t1 = 1.0,t2 = 2.0,t3 = 2.0 / m;
<snip>
z = FFTinitGFN(m, 2.0, &n1,&SHIFT);
to:
Code:
const double t1 = 1.0,t2 = prp_base,t3 = 2.0 / m;
<snip>
z = FFTinitGFN(m, prp_base, &n1,&SHIFT);
As far as testing b^N+c, that is "above my paygrade", so to speak.
axn is offline   Reply With Quote
Old 2013-03-31, 04:36   #168
prime7989
 
Jun 2012

1710 Posts
Smile c=-1?

Dear axn,
How about c=-1 that is change the code in geneferCuda from so that c=-1 i.e
Input from: b^m+1 to b^m-1
prime7989
prime7989 is offline   Reply With Quote
Old 2013-03-31, 18:09   #169
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

9,497 Posts
Default

This is easy to do.
The whole code will become:
Code:
//...some headers
// skip to page 10
j = m;
while (j > 0)
{
        if (j > 1 && j & 1)
        {
                fprintf(stderr, "Cannot test. m is not a power of 2.\n");
                return;
        }
        j >>= 1;
}
printf("Testing %d^%u-1...\r", b, m);

printf("\r%d^%u-1 is composite.", b, m);
//... some footer
Batalov is offline   Reply With Quote
Old 2013-04-01, 03:43   #170
prime7989
 
Jun 2012

1710 Posts
Wink 2^p-1

Dear Batalov,axn,
Ofcourse looking at the code i know my just previous post was incomplete.
What i meant was the following mods to geneferCUDA:
1) Specify the base p-PRP as a #define macro or as a run time input by the user(easy to do)
Give the user a chance to run a version option:
2a) Option A):Make it such that it is base 2,3,5-PRP for b^m+1 where m is a power of 2.
2b)Option B:)Make it such that it is base 3-PRP for b^q-1 where b=2 and q = a prime so as to accomodate Mersenne numbers. As well as GFNs.
Does anyone have recent code of geneferCUDA.cu > ver 1.061 or is willing to modify the code with these improvements? And wiilling to post it?
prime7989
prime7989 is offline   Reply With Quote
Old 2013-04-02, 17:33   #171
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

9,497 Posts
Default

GeNeFer (and geneferCUDA which is its CUDA port) are written specifically to test Generalized Fermat Numbers. That is, m must be a power of two. Your question about changing the PRP test's base was already addressed, even though it was somewhat moot, because test prp_base=2 is fine for any b>2, while for b=2 the (true Fermat) candidates are already searched to death by many people before you.

For other applications, there are other programs, e.g. CUDALucas (prime m and c=-1). Why would someone bother to modify a program so that it would become another, already written, specialized program?

If you want a universal program that does everything that other programs can do, then that's easy - make a script that would call the appropriate binary. That would be much more robust than keeping up with all disparate sources, putting them together and then recompiling when any component had changed.
Batalov is offline   Reply With Quote
Old 2013-06-07, 07:00   #172
prime7989
 
Jun 2012

100012 Posts
Post

Quote:
Originally Posted by Batalov View Post
GeNeFer (and geneferCUDA which is its CUDA port) are written specifically to test Generalized Fermat Numbers. That is, m must be a power of two. Your question about changing the PRP test's base was already addressed, even though it was somewhat moot, because test prp_base=2 is fine for any b>2, while for b=2 the (true Fermat) candidates are already searched to death by many people before you.

For other applications, there are other programs, e.g. CUDALucas (prime m and c=-1). Why would someone bother to modify a program so that it would become another, already written, specialized program?

If you want a universal program that does everything that other programs can do, then that's easy - make a script that would call the appropriate binary. That would be much more robust than keeping up with all disparate sources, putting them together and then recompiling when any component had changed.


GeneferCUDA is a base-2 Pepin's test as far as I can ascertain(please correct if I am wrong, please). To allow for Fermat number testing with the GTX-TITAN we can make it base 3 or 5 deterministic Pepin's Test. To allow test's for Mersenne numbers with a Pepin's test GenfeferCuda should be run in Base 3 with the modification for Fermat to Mersenne numbers in the c=+/-1 for Fermat and Mersenne numbers.
Furthermore CudaLucas is a Lucas-Lehmer test for Mersenne numbers only and not a Pepin's test.
Al
prime7989 is offline   Reply With Quote
Old 2013-07-24, 17:32   #173
msft
 
msft's Avatar
 
Jul 2009
Tokyo

61010 Posts
Default

Hi,
I ported genefer to RADEON.
Code:
+ time ./GeneferCUDA -t
GeneferCUDA 2.2.1 (CUDA) based on Genefer v2.2.1
Copyright (C) 2001-2003, Yves Gallot (v1.3)
Copyright (C) 2009, 2011 Mark Rodenkirch, David Underbakke (v2.2.1)
Copyright (C) 2010, 2011, Shoichiro Yamada (CUDA)
A program for finding large probable generalized Fermat primes.

Platform :Advanced Micro Devices, Inc.
Device 0 : Capeverde

Build Options are : -D KHR_DP_EXTENSION
2030234^8192+1 is a probable prime.               
  (51672 digits) (err = 0.1719) (time = 0:03:01) 00:52:08
Attached Files
File Type: bz2 0.01.tar.bz2 (19.0 KB, 83 views)
msft is offline   Reply With Quote
Old 2013-07-25, 18:51   #174
msft
 
msft's Avatar
 
Jul 2009
Tokyo

61010 Posts
Default

Hi, New Version.
HW:Celeron+RADEON7750(Low end)
1) install ubuntu Desktop 64bit 12.04 LTS
2) install amd-driver-installer-catalyst-13-4-linux-x86.x86_64.zip
3) install AMD-APP-SDK-v2.8-lnx64.tgz
4) install clAmdFft-1.10.321.tar.gz
5) install g++
6) install libglu1-mesa-dev
Code:
$ pwd
/opt/AMDAPP/samples/opencl/genefer/0.05
$ tar -xvf 0.04.tar.bz2
0.04/
0.04/clFFTPlans.cpp
0.04/Makefile
0.04/MatrixMulDouble_Kernels.cl
0.04/run.sh
0.04/clFFTPlans.h
0.04/GeneferCUDA.c
0.04/MatrixMulDouble.hpp
$ cd 0.04
0.04$ sh -x ./run.sh
g++  -Wpointer-arith   -Wfloat-equal -g  -O3  -I /opt/AMDAPP/include/ -I /opt/clAmdFft-1.10.321/include/  -g3 -ffor-scope   -I  ../../../../../samples/opencl/SDKUtil/include  -I  ../../../../../samples/bolt/BoltUtil/include  -I  ../../../../../samples/C++Amp/AmpUtil/include -I  "/opt/AMDAPP/include" -I  ../../../../../include  -o build/debug/x86_64//GeneferCUDA.o -c  GeneferCUDA.c
g++  -Wpointer-arith   -Wfloat-equal -g  -O3  -I /opt/AMDAPP/include/ -I /opt/clAmdFft-1.10.321/include/  -g3 -ffor-scope   -I  ../../../../../samples/opencl/SDKUtil/include  -I  ../../../../../samples/bolt/BoltUtil/include  -I  ../../../../../samples/C++Amp/AmpUtil/include -I  "/opt/AMDAPP/include" -I  ../../../../../include  -o build/debug/x86_64//clFFTPlans.o -c  clFFTPlans.cpp
g++ -o build/debug/x86_64/GeneferCUDA build/debug/x86_64//GeneferCUDA.o build/debug/x86_64//clFFTPlans.o -lpthread -ldl -L/usr/X11R6/lib  -g  /opt/clAmdFft-1.10.321/lib64/libclAmdFft.Runtime.so -lOpenCL  -lgmp  -lSDKUtil  -lOpenCL   -L../../../../../lib/x86_64  -L../../../../../TempSDKUtil/lib/x86_64 -L"/opt/AMDAPP/lib/x86_64"
+ export LD_LIBRARY_PATH=:/opt/clAmdFft-1.10.321/lib64/
+ time ./GeneferCUDA -t
GeneferCUDA 2.2.1 (GPU) based on Genefer v2.2.1
Copyright (C) 2001-2003, Yves Gallot (v1.3)
Copyright (C) 2009, 2011 Mark Rodenkirch, David Underbakke (v2.2.1)
Copyright (C) 2010, 2011, Shoichiro Yamada (CUDA)
A program for finding large probable generalized Fermat primes.
Platform :Advanced Micro Devices, Inc.
Device 0 : Capeverde
Build Options are : -D KHR_DP_EXTENSION
2030234^8192+1 is a probable prime.
  (51672 digits) (err = 0.1738) (time = 0:01:47) 02:41:09
Platform :Advanced Micro Devices, Inc.
Device 0 : Capeverde

Build Options are : -D KHR_DP_EXTENSION
572186^131072+1 is a probable prime.
  (754652 digits) (err = 0.0801) (time = 1:02:35) 03:43:44
Attached Files
File Type: bz2 0.04.tar.bz2 (18.8 KB, 61 views)
msft is offline   Reply With Quote
Old 2013-07-26, 04:51   #175
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

226778 Posts
Default

[bitchy]Who wants to find Fermat primes which are "large probable" or "probable generalized"? (or both)
Wouldn't "large, generalized Fermat (probable) primes" (native speakers can help here!) sound better?
[/bitchy]

All in all, well done msft! kutgw! (you spoiled us already)
LaurV is offline   Reply With Quote
Old 2013-07-26, 09:40   #176
msft
 
msft's Avatar
 
Jul 2009
Tokyo

2·5·61 Posts
Default

Hi, New Version.
HD7750:
Code:
0.10$ ./GeneferCUDA -b
874718^131072+1 Time: 1.66 ms/mul.      Err: 3.47e-01   778813 digits
710492^262144+1 Time: 2.99 ms/mul.      Err: 5.00e-01   1533952 digits
577098^524288+1 Time: 4.88 ms/mul.      Err: 5.00e-01   3020555 digits
468750^1048576+1        Time: 9.83 ms/mul.      Err: 5.00e-01   5946413 digits
380742^2097152+1        Time: 18.9 ms/mul.      Err: 5.00e-01   11703432 digits
309258^4194304+1        Time: 40 ms/mul.        Err: 5.00e-01   23028076 digits
251196^8388608+1        Time: 80.4 ms/mul.      Err: 5.00e-01   45298590 digits
0.10$ ./GeneferCUDA -t
572186^131072+1 is a probable prime.
  (754652 digits) (err = 0.0762) (time = 1:10:03) 18:36:25
PS. clAmdFft have this issue.
http://devgurus.amd.com/message/1298209#1298209
Attached Files
File Type: bz2 0.10.tar.bz2 (18.9 KB, 63 views)
msft is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Genefer's FFT applied to Mersenne squaring preda Software 0 2017-09-06 02:54
CUDA 5.5 ET_ GPU Computing 2 2013-06-13 15:50
AVX CPU LL vs CUDA LL nucleon GPU Computing 11 2012-01-04 17:52
Best CUDA GPU for the $$ Christenson GPU Computing 24 2011-05-01 00:06
CUDA? Xentar Conjectures 'R Us 6 2010-03-31 07:43

All times are UTC. The time now is 05:55.


Fri Aug 6 05:55:33 UTC 2021 up 14 days, 24 mins, 1 user, load averages: 3.26, 3.45, 3.20

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.