Circular opencl-event array
@@ -249,6 +249,9 @@ public class OCLCommandQueue extends TornadoLogger {
private void findNextEventSlot() {
eventIndex = retain.nextClearBit(eventIndex + 1);
+ if (eventIndex >= events.length) {
+ eventIndex = 0;
+ }
guarantee(eventIndex != -1, "event window is full (retained=%d, capacity=%d)", retain.cardinality(), EVENT_WINDOW);
}
