diff options
author | Michael Bien <[email protected]> | 2010-07-19 19:52:57 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-07-19 19:52:57 +0200 |
commit | 45fb8d583bfbeb7b092f4ee17c2443c9f24cf2c9 (patch) | |
tree | 5f61c8fb76dc3d892e24b38057b7fa9716a99fb4 | |
parent | 8b2a88cfced2eea55cf1793a2739be8eb42b73cd (diff) |
toString() for CLEventList.
-rw-r--r-- | src/com/jogamp/opencl/CLEventList.java | 13 | ||||
-rw-r--r-- | test/com/jogamp/opencl/CLCommandQueueTest.java | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/com/jogamp/opencl/CLEventList.java b/src/com/jogamp/opencl/CLEventList.java index a1ee5035..da88aa05 100644 --- a/src/com/jogamp/opencl/CLEventList.java +++ b/src/com/jogamp/opencl/CLEventList.java @@ -78,6 +78,19 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL return new EventIterator(events, size); } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getName()).append('['); + for (int i = 0; i < size; i++) { + sb.append(events[i].toString()); + if(i+1 != size) { + sb.append(", "); + } + } + return sb.append(']').toString(); + } + private static class EventIterator implements Iterator<CLEvent> { private final CLEvent[] events; diff --git a/test/com/jogamp/opencl/CLCommandQueueTest.java b/test/com/jogamp/opencl/CLCommandQueueTest.java index 0ea1cae4..9c4cc7a8 100644 --- a/test/com/jogamp/opencl/CLCommandQueueTest.java +++ b/test/com/jogamp/opencl/CLCommandQueueTest.java @@ -77,11 +77,15 @@ public class CLCommandQueueTest { final CLEventList events = new CLEventList(2); + out.println(events); + assertEquals(0, events.size()); queue.putWriteBuffer(clBufferA, false, events) // write A .putWriteBuffer(clBufferB, false, events);// write B + out.println(events); + assertEquals(2, events.size()); queue.putWaitForEvents(events, true); |