Andreas Klöckner wrote:
I've spent another rather puzzling debugging session, only to find out
that shared_ptrs held by Boost.Python apparently don't work well with
weak_ptrs. I arrived at the conclusion that the entire notion of keeping
PyCUDA's context stack as weak_ptrs is ill-conceived, and I've changed
the code to hold shared_ptrs instead. As a result, the "destroying
context in context stack" warning is also gone--contexts will leak
unless they're explicitly popped off the context stack, which seems
legitimate.
Yeah, that (some strange interaction between shared_ptr and weak_ptr)
was the conclusion I had come to after some poking around as well, but I
don't understand Boost pointer classes well enough to want to touch it
:). Thanks for the quick reply!
The current git version runs the test case fine when the constructor is
modified to pop the context off the stack. However, without that
modification, it gives me an infinite loop printing the following:
-----------------------------------------------------------
PyCUDA ERROR: I'm being asked to destroy a
context that's part of the current context stack.
-----------------------------------------------------------
Something went horribly wrong, I'll abort now. Sorry.
Please report this issue to the PyCUDA mailing list.
-----------------------------------------------------------
I know leaving a context on the stack is bad practice, but an infinite
loop probably isn't the most graceful handling! Please let me know if
you need a trace of some kind to help debug.
Thanks,
Imran
_______________________________________________
PyCUDA mailing list
[email protected]
http://tiker.net/mailman/listinfo/pycuda_tiker.net