From ceedf2ac1b1300a12a7b69a31b53787035fe7c13 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Fri, 22 Jan 2010 19:49:02 +0100 Subject: added blockingWait parameter to putWaitForEvent(...) CLCommandQueue methods. --- src/com/mbien/opencl/CLCommandQueue.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/com/mbien/opencl/CLCommandQueue.java') diff --git a/src/com/mbien/opencl/CLCommandQueue.java b/src/com/mbien/opencl/CLCommandQueue.java index bc50210e..9825b871 100644 --- a/src/com/mbien/opencl/CLCommandQueue.java +++ b/src/com/mbien/opencl/CLCommandQueue.java @@ -179,18 +179,20 @@ public class CLCommandQueue implements CLResource { return this; } - public CLCommandQueue putWaitForEvent(CLEventList list, int index) { + public CLCommandQueue putWaitForEvent(CLEventList list, int index, boolean blockingWait) { int marker = list.IDs.position()-1; list.IDs.position(index); - int ret = cl.clWaitForEvents(1, list.IDs); + int ret = blockingWait ? cl.clWaitForEvents(1, list.IDs) + : cl.clEnqueueWaitForEvents(ID, 1, list.IDs); list.IDs.position(marker); checkForError(ret, "error while waiting for events"); return this; } - public CLCommandQueue putWaitForEvents(CLEventList list) { + public CLCommandQueue putWaitForEvents(CLEventList list, boolean blockingWait) { list.IDs.rewind(); - int ret = cl.clWaitForEvents(list.size, list.IDs); + int ret = blockingWait ? cl.clWaitForEvents(list.size, list.IDs) + : cl.clEnqueueWaitForEvents(ID, list.size, list.IDs); checkForError(ret, "error while waiting for events"); return this; } -- cgit v1.2.3