On Fri, 22 Apr 2011 22:52:04 +0800, oyster <[email protected]> wrote:
> Hi, everyone
> 
> by the title, I mean, when I launch my python program for the first
> time, pycuda uses the C/nvcc compiler to generate the binary code,
> then I can save those generated code.

PyCUDA caches the code for you, so it won't use nvcc the second time
around.

> and later when I run this python program again, I do not need to use
> C/nvcc compiler again
> further more, I can release my python program to my friend who don't
> have any C/nvcc compiler on his PC
> 
> is this possible? If it is, how?

Certainly. Just note that your friend will need to have PyCUDA
installed. (And if he wants to build PyCUDA from source, he needs a C
compiler and a CUDA toolkit install anyway.)

To get the compiled binary from PyCUDA, use
pycuda.compiler.compile(). See here:

http://documen.tician.de/pycuda/driver.html#module-pycuda.compiler

Just note that shipping binaries is a pain--you'll likely need to
compile code for all different GPUs that are available, and then ship
all versions of the binary to make this work reliably. Doesn't sound
like my idea of fun, but it certainly works. (If you do build a tool
that makes that easy, please share your experiences with the list.)

Good luck,
Andreas

Attachment: pgpBtjQGBk0io.pgp
Description: PGP signature

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to