Emanuel Rietveld <e.j.rietv...@gmail.com> writes: > If I understand correctly, the current PyCUDA multithreading examples > assume you create a separate context for each thread. > > If I want to use CUDA 4.0+'s one-context-per-process model instead, > how would I do that in PyCUDA? > > I think you'd call cudaSetDevice instead of cuCtxCreate? Does the > equivalent exist in PyCUDA? If it does not, can I add it?
Yes, in fact that would be very welcome. PyCUDA has some complicated and brittle logic in place to manage CUDA's context stacks that I've been meaning to rip out. Here's an example: https://github.com/inducer/pycuda/blob/master/src/cpp/cuda.hpp#L525 Patches that get rid of all that code and simplify it would be very welcome. Andreas _______________________________________________ PyCUDA mailing list PyCUDA@tiker.net https://lists.tiker.net/listinfo/pycuda