[Bounty $20] Can not send null references to kernel
freemo opened this issue · 0 comments
freemo commented
If a variable can not be set to null and sent to the kernel in GPU mode, this results in a error clearly describing the limitation.
This bug is tested for here:
https://github.com/Syncleus/aparapi/blob/master/src/test/java/com/aparapi/runtime/NullRefTest.java
It produces the following exception:
java.lang.IllegalStateException: Cannot send null refs to kernel, reverting to java
at com.aparapi.internal.kernel.KernelRunner.updateKernelArrayRefs(KernelRunner.java:1104)
at com.aparapi.internal.kernel.KernelRunner.executeOpenCL(KernelRunner.java:1192)
at com.aparapi.internal.kernel.KernelRunner.executeInternalInner(KernelRunner.java:1652)
at com.aparapi.internal.kernel.KernelRunner.executeInternalOuter(KernelRunner.java:1323)
at com.aparapi.internal.kernel.KernelRunner.execute(KernelRunner.java:1313)
at com.aparapi.Kernel.execute(Kernel.java:2669)
at com.aparapi.Kernel.execute(Kernel.java:2626)
at com.aparapi.Kernel.execute(Kernel.java:2601)
at com.aparapi.runtime.NullRefTest.doTest(NullRefTest.java:29)
at com.aparapi.runtime.NullRefTest.test(NullRefTest.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)