From a37681d424a268acfc107ebfe5443732b6d7dc61 Mon Sep 17 00:00:00 2001 From: "[6~" Date: Sun, 27 Oct 2019 15:47:12 -0500 Subject: [PATCH] Add advice about keeping NannyEvents to enqueue_copy doc (Thanks, Yves Surrel) --- pyopencl/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 59be64d1..17ab8c52 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -1529,10 +1529,17 @@ def enqueue_copy(queue, dest, src, **kwargs): :arg wait_for: (optional, default empty) :arg is_blocking: Wait for completion. Defaults to *True*. (Available on any copy involving host memory) - :return: A :class:`NannyEvent` if the transfer involved a host-side buffer, otherwise an :class:`Event`. + .. note:: + + Be aware that when the deletion of the :class:`NannyEvent` that is + returned by the function if the transfer involved a host-side buffer + will block until the transfer is complete, so be sure to keep a + reference to this :class:`Event` as long as necessary for the + transfer to complete. + .. note:: Two types of 'buffer' occur in the arguments to this function, -- GitLab