mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2014-04-04, 18:27   #1
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

5·349 Posts
Default CUDA Tutorials/Learning with an eye to large numbers

I have a good amount of free time on my hands right now, and I would like to start poking around in CUDA programming, but I'm having some trouble finding good beginner's tutorials. I understand the general process of "Prepare some data, move it to the GPU, do a lot of repetitive tasks, move the results back to the host" but I'd like some more in-depth teaching about what kinds of tasks are good for parallel processes.

I'd also like to learn how to handle large numbers like those used with the GPU implementation of GMP-ECM and things like LLR-CUDA and the like.

Can anyone provide suggestions (either books or online) where I might get a good start? Thanks!
wombatman is offline   Reply With Quote
Old 2014-04-04, 18:45   #2
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

24DC16 Posts
Default

You might want to decouple the two parts of this: CUDA and large numbers.

Both are challenging and in many ways independent (it might be surprising if there exists a book on both at the same time). You can start CUDA separately, and then maybe do simple steps, like check how tf_72bit.cu works (in the mfaktc package, the smallest tier); it might be tough at first, but if you like the "learn to swim by stepping off the boat" paradigm, you might enjoy that. ;-)
Batalov is offline   Reply With Quote
Old 2014-04-04, 19:04   #3
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

110110100012 Posts
Default

For better or worse, I definitely tend toward the boat-jumping ;) Thanks for the mfaktc suggestion. I'll go cross my eyes at that for a while.

I also found a nice free online course from udacity. I'm only a little bit in, but it seems like they're going to start with a nice breakdown of how the GPU hardware is set up for parallelization and then (I hope) get into actual code as well.

Udacity course is here: https://www.udacity.com/course/cs344 (Title is Intro to Parallel Programming with CUDA).
wombatman is offline   Reply With Quote
Old 2014-04-04, 19:06   #4
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

33·5·71 Posts
Default

Quote:
Originally Posted by Batalov View Post
... it might be tough at first, but if you like the "learn to swim by stepping off the boat" paradigm, you might enjoy that. ;-)
The best way to learn, IMHO.
chalsall is online now   Reply With Quote
Old 2014-04-05, 08:36   #5
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

481410 Posts
Default

Quote:
Originally Posted by wombatman View Post
For better or worse, I definitely tend toward the boat-jumping ;) Thanks for the mfaktc suggestion. I'll go cross my eyes at that for a while.

I also found a nice free online course from udacity. I'm only a little bit in, but it seems like they're going to start with a nice breakdown of how the GPU hardware is set up for parallelization and then (I hope) get into actual code as well.

Udacity course is here: https://www.udacity.com/course/cs344 (Title is Intro to Parallel Programming with CUDA).
I'm doing that course as well

I'm stuck at the reduction lessons after the tone-mapping, trying to understand how to perform a radix-sort on multi-block data (the exercise is on red-eye removal).

Let me know if you have hints...

Luigi
ET_ is offline   Reply With Quote
Old 2014-04-05, 16:22   #6
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

5·349 Posts
Default

I don't think I've gotten to the red-eye removal yet, but I'll let you know if I can get it worked out.
wombatman is offline   Reply With Quote
Old 2014-04-07, 12:35   #7
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

11101001001002 Posts
Default

Quote:
Originally Posted by wombatman View Post
I'd also like to learn how to handle large numbers like those used with the GPU implementation of GMP-ECM and things like LLR-CUDA and the like.
Knuth, TAOCP, Vol II.
R.D. Silverman is offline   Reply With Quote
Old 2014-04-07, 14:53   #8
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

33218 Posts
Default

Excellent! Thank you!

Quote:
Originally Posted by R.D. Silverman View Post
Knuth, TAOCP, Vol II.
wombatman is offline   Reply With Quote
Old 2014-04-10, 16:59   #9
tServo
 
tServo's Avatar
 
"Marv"
May 2009
near the Tannhäuser Gate

27×5 Posts
Default

Dr Dobbs ( www.drdobbs.com ) had a series a year or 2 ago by Rob Farber about learning Cuda. I don't know how it compares to the other udacity course. It was titled something like " Supercomputing for the Masses".
tServo is offline   Reply With Quote
Old 2014-04-10, 21:25   #10
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

5·349 Posts
Default

Another great find, thanks!

Speaking of Knuth and TAOCP, here's a section from an NVIDIA-provided CUDA header defining a double double precision type:

Code:
/* Compute error-free sum of two unordered doubles. See Knuth, TAOCP vol. 2 */
__device__ __forceinline__ dbldbl add_double_to_dbldbl (double a, double b)
{
    double t1, t2;
    dbldbl z;
    z.y = __dadd_rn (a, b);
    t1 = __dadd_rn (z.y, -a);
    t2 = __dadd_rn (z.y, -t1);
    t1 = __dadd_rn (b, -t1);
    t2 = __dadd_rn (a, -t2);
    z.x = __dadd_rn (t1, t2);
    return z;
}
Just thought that was neat.
wombatman is offline   Reply With Quote
Old 2014-04-10, 23:29   #11
Ken_g6
 
Ken_g6's Avatar
 
Jan 2005
Caught in a sieve

39510 Posts
Default

A lot depends on "How large is 'large'?". And by that I mean the numbers actually being worked with. You can sieve or trial-factor extremely large numbers without using numbers larger than the factors you're trying.

If "large" is 64 bits or less, check out my multi-K-and-N siever.

If "large" is about 65-96 bits, look at mfaktc.

If "large" is really a lot larger than 96 bits...maybe look at CUDALucas?
Ken_g6 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Discussion of Large Numbers Merfighters Miscellaneous Math 2 2010-10-29 16:51
Calculating large numbers Historian Information & Answers 4 2010-03-26 19:39
Squaring large Numbers SQUARE Information & Answers 7 2009-05-10 09:13
Maths Tutorials -I devarajkandadai Miscellaneous Math 0 2004-12-16 02:53
How do I get LARGE numbers Bundu Software 5 2004-08-26 01:56

All times are UTC. The time now is 21:32.

Tue May 18 21:32:28 UTC 2021 up 40 days, 16:13, 0 users, load averages: 1.89, 2.02, 2.18

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.