aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/CLEventList.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2011-04-04 19:04:29 +0200
committerMichael Bien <[email protected]>2011-04-04 19:04:29 +0200
commit6612391c7ad8309ebd315cdf2a91a71f11793a61 (patch)
tree02374fe2a54bdde53c46de193123d0626d3807a4 /src/com/jogamp/opencl/CLEventList.java
parent38a1408b585fd3fe7b274708b531e98d73f1ac0c (diff)
fixed a bug which used a wrong eventlist offset under certain conditions and added a regression test.
Diffstat (limited to 'src/com/jogamp/opencl/CLEventList.java')
-rw-r--r--src/com/jogamp/opencl/CLEventList.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/jogamp/opencl/CLEventList.java b/src/com/jogamp/opencl/CLEventList.java
index 03a6f838..f2b98adf 100644
--- a/src/com/jogamp/opencl/CLEventList.java
+++ b/src/com/jogamp/opencl/CLEventList.java
@@ -40,17 +40,29 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
private final CLEvent[] events;
+ /**
+ * stores event ids for fast access.
+ */
final PointerBuffer IDs;
+
+ /**
+ * Points always to the first element of the id buffer.
+ */
+ final PointerBuffer IDsView;
+
int size;
public CLEventList(int capacity) {
this.events = new CLEvent[capacity];
this.IDs = PointerBuffer.allocateDirect(capacity);
+ this.IDsView = PointerBuffer.wrap(IDs.getBuffer());
}
public CLEventList(CLEvent... events) {
this.events = events;
this.IDs = PointerBuffer.allocateDirect(events.length);
+ this.IDsView = PointerBuffer.wrap(IDs.getBuffer());
+
for (CLEvent event : events) {
IDs.put(event.ID);
}