refactor for precompilation FPGA JIT mode
@@ -328,15 +328,7 @@ public class TornadoTaskSchedule implements AbstractTaskGraph {
vm.compile();
}
- @Override
- public void scheduleInner() {
- long t0 = System.nanoTime();
- compileToTornadoVMBytecodes();
- long t1 = System.nanoTime();
- if (PRINT_COMPILE_TIMES) {
- System.out.printf("compile: compileTasks: " + (t1 - t0) + "ns" + "\n");
- }
-
+ private void precompilationForFPGA() {
// If current FPGA execution and JIT mode => run warmup
if (Tornado.FPGA_EMULATION && Tornado.ACCELERATOR_IS_FPGA) {
System.out.println("Compilation for Emulation");
@@ -348,6 +340,21 @@ public class TornadoTaskSchedule implements AbstractTaskGraph {
compileTaskToOpenCL();
}
}
+ }
+
+ @Override
+ public void scheduleInner() {
+ long t0 = System.nanoTime();
+ compileToTornadoVMBytecodes();
+ long t1 = System.nanoTime();
+ if (PRINT_COMPILE_TIMES) {
+ System.out.printf("compile: compileTasks: " + (t1 - t0) + "ns" + "\n");
+ }
+
+ CompileInfo compileInfo = extractCompileInfo();
+ if (compileInfo.compile) {
+ precompilationForFPGA();
+ }
event = vm.execute();
}
