diff options
-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); |