You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like any code resulting in branching (if, for, while, etc...) will fail to generate.
If I avoid any branches, everything works completely fine and runs on my Mac's Radeon GPU.
Consider this simple example:
@Test
def failingCodeGen2(): Unit = {
val size: Int = 500000
val a: Array[Int] = (2 until size + 2).toArray
val kernel = new Kernel() {
override def run() {
val gid = getGlobalId()
val num = a(gid)
var test = 1
if (num % 2 == 0) {
test = 2
}
}
}
kernel.execute(size)
assert(kernel.getExecutionMode == EXECUTION_MODE.GPU)
}
This code fails with:
com.aparapi.internal.exception.CodeGenException: goto -> 0026
at com.aparapi.internal.writer.BlockWriter.writeInstruction(BlockWriter.java:751)
at com.aparapi.internal.writer.KernelWriter.writeInstruction(KernelWriter.java:780)
at com.aparapi.internal.writer.BlockWriter.writeSequence(BlockWriter.java:299)
at com.aparapi.internal.writer.BlockWriter.writeBlock(BlockWriter.java:323)
at com.aparapi.internal.writer.BlockWriter.writeMethodBody(BlockWriter.java:873)
at com.aparapi.internal.writer.KernelWriter.write(KernelWriter.java:738)
at com.aparapi.internal.writer.KernelWriter.writeToString(KernelWriter.java:792)
at com.aparapi.internal.kernel.KernelRunner.executeInternalInner(KernelRunner.java:1535)
at com.aparapi.internal.kernel.KernelRunner.executeInternalOuter(KernelRunner.java:1383)
at com.aparapi.internal.kernel.KernelRunner.execute(KernelRunner.java:1374)
at com.aparapi.Kernel.execute(Kernel.java:2897)
at com.aparapi.Kernel.execute(Kernel.java:2854)
at com.aparapi.Kernel.execute(Kernel.java:2829)
...
The text was updated successfully, but these errors were encountered:
It seems like any code resulting in branching (if, for, while, etc...) will fail to generate.
If I avoid any branches, everything works completely fine and runs on my Mac's Radeon GPU.
Consider this simple example:
This code fails with:
The text was updated successfully, but these errors were encountered: