Syncleus / aparapi

The New Official Aparapi: a framework for executing native Java and Scala code on the GPU.
http://aparapi.com
Apache License 2.0
465 stars 59 forks source link

Update: Fix and Improve Java execution mode, avoiding deadlocks with … #127

Closed CoreRasurae closed 6 years ago

CoreRasurae commented 6 years ago

…barriers, fail-fast and provide detail information about the failed Kernel thread

This PR proposes the follwing fixes and updates:

CoreRasurae commented 6 years ago

@freemo This is my proposal to fix and improve Java execution mode. Unit tests are still missing.

CoreRasurae commented 6 years ago

@freemo Sample exception of failing Kernel executing on a Java device: com.aparapi.exception.AparapiKernelFailedException: Pass Id: 0 - Group IDs: [0, 0, 0] - Global IDs: [128, 0, 0], Local IDs: [128, 0, 0] Caused by: java.lang.ArrayIndexOutOfBoundsException: 510 at pt.ist.ceris.vipivist.tests.Issue84BarrierSupportTest$Barrrier2Kernel.doInitialCopy(Issue84BarrierSupportTest.java:278) at pt.ist.ceris.vipivist.tests.Issue84BarrierSupportTest$Barrrier2Kernel.run(Issue84BarrierSupportTest.java:291) at com.aparapi.internal.kernel.KernelRunner$5.run(KernelRunner.java:721) at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

freemo commented 6 years ago

@CoreRasurae hey, going to look at this today

CoreRasurae commented 6 years ago

@freemo Okay! Please note that the units tests are still missing.

freemo commented 6 years ago

@CoreRasurae I approved and merged since i have someone writing unit tests who may want to cover some of this. But you should still write some unit tests yourself to cover it explicitly please.