2 newArrivalsKernel.setArguments(worldMem, patchesPopulationsMem, patchesOwnersMem, plotsPopulationsMem, plotsSurfacesMem);
3 reproduceKernel.setArguments(worldMem, patchesPopulationsMem, patchesOwnersMem, plotsPopulationsMem);
4 diffuseKernel.setArguments(worldMem, patchesPopulationsMem, patchesOverflowsMem, newPopulationsMem);
5 deathKernel.setArguments(worldMem, patchesPopulationsMem, patchesTypesMem);
7 OCLEvent newArrivalFinished, reproduceFinished, diffuseFinished, copyFinished, deathFinished;
11 OCLChrono totalTime = new OCLChrono("totalTime");
15 newArrivalFinished = enqueueKernel(newArrivalsKernel);
16 reproduceFinished = enqueueKernel(reproduceKernel, newArrivalFinished);
17 diffuseFinished = enqueueKernel(diffuseKernel, reproduceFinished);
18 copyFinished = queue.enqueueCopyBuffer(newPopulationsMem, patchesPopulationsMem, 0L, 0L, patchesPopulationsMem.getSize(), diffuseFinished);
19 OCLEvent.waitFor(copyFinished);
20 deathFinished = enqueueKernel(deathKernel, copyFinished);
22 queue.blockingReadBuffer(plotsPopulationsMem, Pointer.to(plotsPopulations), 0, plotsPopulationsMem.getSize(), deathFinished);
23 queue.blockingReadBuffer(patchesPopulationsMem, Pointer.to(patchesPopulations), 0, patchesPopulationsMem.getSize(), deathFinished);
24 queue.blockingReadBuffer(patchesOverflowsMem, Pointer.to(patchesOverflows), 0, patchesOverflowsMem.getSize(), deathFinished);