Fabrizio Milo aka misto wrote:
b) Imports with side effects are bad. (pycuda.autoinit is the only
module with side-effects in PyCUDA--and the side effect is its only
purpose.)
I agree side effects are bad!! I don't think this is a side effect.
This is how you would use the cuda driver.
any and I say any function you want from the cuda drivers needs as
prerequisite the cuInit().
I disagree. It's important to know if the CUDA libraries are getting
reinitialized; particularly on multi-GPU systems, there can be
significant overhead in calling cuInit. We have a bunch of quad-GPU
machines here where the CUDA initialization takes nearly 3-4 seconds.
Needless to say, that's a cost I only want to pay once, not every time I
have to import pycuda. In particular, if your program uses libraries
that depend on pycuda, they shouldn't all be reinitializing CUDA unless
you ask them to.
Cheers,
Imran
_______________________________________________
PyCUDA mailing list
[email protected]
http://host304.hostmonster.com/mailman/listinfo/pycuda_tiker.net