summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-07-19 19:52:57 +0200
committerMichael Bien <[email protected]>2010-07-19 19:52:57 +0200
commit45fb8d583bfbeb7b092f4ee17c2443c9f24cf2c9 (patch)
tree5f61c8fb76dc3d892e24b38057b7fa9716a99fb4
parent8b2a88cfced2eea55cf1793a2739be8eb42b73cd (diff)
toString() for CLEventList.
-rw-r--r--src/com/jogamp/opencl/CLEventList.java13
-rw-r--r--test/com/jogamp/opencl/CLCommandQueueTest.java4
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);