From b74c53842d592d446efbad56c42798b9a81c3101 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sun, 1 Dec 2013 20:37:18 -0600
Subject: [PATCH] Add some even treatment to array.multi_put

---
 pyopencl/array.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pyopencl/array.py b/pyopencl/array.py
index 4ef896c5..d7525c84 100644
--- a/pyopencl/array.py
+++ b/pyopencl/array.py
@@ -1802,7 +1802,7 @@ def multi_put(arrays, dest_indices, dest_shape=None, out=None, queue=None):
                     queue.device))
 
         from pytools import flatten
-        knl(queue, gs, ls,
+        evt = knl(queue, gs, ls,
                 *(
                     list(flatten(
                         (o.base_data, o.offset)
@@ -1813,6 +1813,11 @@ def multi_put(arrays, dest_indices, dest_shape=None, out=None, queue=None):
                         for i in arrays[chunk_slice]))
                     + [dest_indices.size]))
 
+        # FIXME should wait on incoming events
+
+        for o in out[chunk_slice]:
+            o.events.append(evt)
+
     return out
 
 
-- 
GitLab