diff options
author | Sven Gothel <[email protected]> | 2011-06-28 14:13:22 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-06-28 14:13:22 +0200 |
commit | da0378be055d5c304b0a0b5e1b5f3ca66122ebf8 (patch) | |
tree | 26ca2e70da90e0c43c30a51d8d0cbe6c9ca2809f /test/com/jogamp | |
parent | 368f062ec9d6bbb89129739adb59cf042dd0bf78 (diff) | |
parent | 08a479b22d4ba9da9ee79fc938ac4de7fb83dc5a (diff) |
Fix last merge of mbien/master
Diffstat (limited to 'test/com/jogamp')
-rw-r--r-- | test/com/jogamp/opencl/CLCommandQueueTest.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/test/com/jogamp/opencl/CLCommandQueueTest.java b/test/com/jogamp/opencl/CLCommandQueueTest.java index c8c028af..5636a40d 100644 --- a/test/com/jogamp/opencl/CLCommandQueueTest.java +++ b/test/com/jogamp/opencl/CLCommandQueueTest.java @@ -191,25 +191,24 @@ public class CLCommandQueueTest { }else{ queue = device.createCommandQueue(); } - - CLEventList writeEvent = new CLEventList(1); - CLEventList kernelEvents = new CLEventList(2); + + // simulate in-order queue by accumulating events of prior commands + CLEventList events = new CLEventList(3); // (1+1)*2 = 4; conditions enforce propper order CLKernel addKernel = program.createCLKernel("add").putArg(buffer).putArg(1).putArg(elements); CLKernel mulKernel = program.createCLKernel("mul").putArg(buffer).putArg(2).putArg(elements); - queue.putWriteBuffer(buffer, false, writeEvent); + queue.putWriteBuffer(buffer, false, events); - queue.put1DRangeKernel(addKernel, 0, elements, 1, writeEvent, kernelEvents); - queue.put1DRangeKernel(mulKernel, 0, elements, 1, writeEvent, kernelEvents); + queue.put1DRangeKernel(addKernel, 0, elements, 1, events, events); + queue.put1DRangeKernel(mulKernel, 0, elements, 1, events, events); - queue.putReadBuffer(buffer, false, kernelEvents, null); + queue.putReadBuffer(buffer, false, events, null); queue.finish(); - writeEvent.release(); - kernelEvents.release(); + events.release(); for (int i = 0; i < elements; i++) { assertEquals(4, buffer.getBuffer().get(i)); @@ -372,7 +371,7 @@ public class CLCommandQueueTest { final CountDownLatch countdown = new CountDownLatch(1); customEvent.registerCallback(new CLEventListener() { - + @Override public void eventStateChanged(CLEvent event, int status) { out.println("event received: "+event); assertEquals(event, customEvent); |