diff options
Diffstat (limited to 'src/com/jogamp/opencl/CLEventList.java')
-rw-r--r-- | src/com/jogamp/opencl/CLEventList.java | 12 |
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); } |