summaryrefslogtreecommitdiffstats
path: root/src/com/mbien
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/mbien')
-rw-r--r--src/com/mbien/opencl/CLCommandQueue.java5
-rw-r--r--src/com/mbien/opencl/CLEvent.java4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/com/mbien/opencl/CLCommandQueue.java b/src/com/mbien/opencl/CLCommandQueue.java
index dd2ab075..38ec7274 100644
--- a/src/com/mbien/opencl/CLCommandQueue.java
+++ b/src/com/mbien/opencl/CLCommandQueue.java
@@ -177,7 +177,7 @@ public class CLCommandQueue implements CLResource {
}
public CLCommandQueue putWaitForEvent(CLEventList list, int index) {
- int marker = list.IDs.position();
+ int marker = list.IDs.position()-1;
list.IDs.position(index);
int ret = cl.clWaitForEvents(1, list.IDs);
list.IDs.position(marker);
@@ -186,6 +186,7 @@ public class CLCommandQueue implements CLResource {
}
public CLCommandQueue putWaitForEvents(CLEventList list) {
+ list.IDs.rewind();
int ret = cl.clWaitForEvents(list.size, list.IDs);
checkForError(ret, "error while waiting for events");
return this;
@@ -217,7 +218,7 @@ public class CLCommandQueue implements CLResource {
locWS = bufferC.put(1, localWorkSize).position(1);
}
- this.putNDRangeKernel(kernel, 1, globWO, globWS, locWS);
+ this.putNDRangeKernel(kernel, events, 1, globWO, globWS, locWS);
return this;
}
diff --git a/src/com/mbien/opencl/CLEvent.java b/src/com/mbien/opencl/CLEvent.java
index 45117bc6..0855ec7e 100644
--- a/src/com/mbien/opencl/CLEvent.java
+++ b/src/com/mbien/opencl/CLEvent.java
@@ -3,6 +3,7 @@ package com.mbien.opencl;
import java.nio.Buffer;
import static com.mbien.opencl.CL.*;
+import static com.mbien.opencl.CLException.*;
/**
*
@@ -25,7 +26,8 @@ public class CLEvent implements CLResource {
}
public void release() {
- throw new UnsupportedOperationException("Not supported yet.");
+ int ret = cl.clReleaseEvent(ID);
+ checkForError(ret, "can not release event");
}
public ExecutionStatus getStatus() {