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
Recursion is not supported in TornadoVM. It is expected that TornadoVM should throw some exceptions. However, the problem seems that the execution hangs and it gets stuck. The bug reason may be the same as #240
How To Reproduce
I created the following example: tornado-examples/src/main/java/uk/ac/manchester/tornado/examples/Broken/Recursion.java
package uk.ac.manchester.tornado.examples.Broken;
import uk.ac.manchester.tornado.api.ImmutableTaskGraph;
import uk.ac.manchester.tornado.api.TaskGraph;
import uk.ac.manchester.tornado.api.TornadoExecutionPlan;
import uk.ac.manchester.tornado.api.annotations.Parallel;
import uk.ac.manchester.tornado.api.enums.DataTransferMode;
import java.util.Arrays;
public class Recursion {
public static void recursion(int a, int b){
if(a == 0) b += 1;
for (@Parallel int i = 0; i<a; i++){
recursion(a-1, b);
}
}
public static void main(String[] args) {
int a = 3;
int b = 0;
TaskGraph taskGraph = new TaskGraph("s0") //
.transferToDevice(DataTransferMode.FIRST_EXECUTION, a) //
.task("t0", Recursion::recursion, a, b) //
.transferToHost(DataTransferMode.EVERY_EXECUTION, b);
ImmutableTaskGraph immutableTaskGraph = taskGraph.snapshot();
TornadoExecutionPlan executor = new TornadoExecutionPlan(immutableTaskGraph);
executor.execute();
}
}
Output
Run the example by the following command: tornado --fullDebug -m tornado.examples/uk.ac.manchester.tornado.examples.Broken.Recursion
Describe the bug
Recursion is not supported in TornadoVM. It is expected that TornadoVM should throw some exceptions. However, the problem seems that the execution hangs and it gets stuck. The bug reason may be the same as #240
How To Reproduce
I created the following example:
tornado-examples/src/main/java/uk/ac/manchester/tornado/examples/Broken/Recursion.java
Output
Run the example by the following command:
tornado --fullDebug -m tornado.examples/uk.ac.manchester.tornado.examples.Broken.Recursion
Console output:
Computing system setup (please complete the following information):
The text was updated successfully, but these errors were encountered: