CUDA and gmp

My Masq my.masq at
Tue Sep 6 13:26:01 CEST 2011

I've found a post on this before:

But it was not much to go on.  I would like to use GMP in a program
parallelized via Cuda and am trying to gauge how difficult this will
be.  Is it possible to simply compile my cuda-enabled code against the
generic GMP C files directly and if so could anyone point me to some
resources on doing so? 

To be more specific I don't really need the GMP code itself parallelized
(i.e. each GMP call can run on one GPU thread) but I wanna make calls to
GMP functions from many parallel cuda threads.  I know GMP is re-entrant
safe but the problem is that Cuda needs to compile the code to its own
machine code (so can't link against a standard CPU-assembler library). 
So I would guess if I extracted the stuff I needed from the mpn/generic
directory and just included it in my own code that would be enough but
I'm wondering how involved that is and if someone could direct me to
some relevant documentation and tell me if this is likely to work or
not.  I'm mostly using the mpz functions -- add, subtract, multiply, etc...

thanks in advance

More information about the gmp-discuss mailing list