Add nogil to cudaStreamAddCallback function call
@@ -329,6 +329,7 @@ cpdef streamAddCallback(size_t stream, callback, size_t arg,
unsigned int flags=0):
func_arg = (callback, arg)
cpython.Py_INCREF(func_arg)
+ with nogil:
status = cudaStreamAddCallback(
<driver.Stream>stream, <StreamCallback>_streamCallbackFunc,
<void*>func_arg, flags)
