[fix] FPGA Execution for various taskschedules and tasks
@@ -82,7 +82,6 @@ public class OCLCodeCache {
private final String INTEL_NALLATECH_BOARD_NAME = "-board=p385a_sch_ax115";
private final String INTEL_FPGA_COMPILATION_FLAGS = getProperty("tornado.fpga.flags", null);
private final String FPGA_CLEANUP_SCRIPT = System.getenv("TORNADO_SDK") + "/bin/cleanFpga.sh";
- private final String FPGA_TASKSCHEDULE = "s0.t0.";
private boolean isLUBCompiled = false;
// ID -> KernelName (TaskName)
@@ -136,8 +135,6 @@ public class OCLCodeCache {
// passed as constant FPGA_TASKSCHEDULE (e.g s0.t0.)
if (deviceContext.getDevice().getDeviceType() == OCLDeviceType.CL_DEVICE_TYPE_ACCELERATOR && Tornado.ACCELERATOR_IS_FPGA) {
precompiledBinariesPerDevice = new HashMap<>();
- String lookupBufferDeviceKernelName = FPGA_TASKSCHEDULE + String.format("device=%d:%d", deviceContext.getDevice().getIndex(), deviceContext.getPlatformContext().getPlatformIndex());
- precompiledBinariesPerDevice.put(lookupBufferDeviceKernelName, FPGA_BIN_LOCATION);
}
}
@@ -337,6 +334,11 @@ public class OCLCodeCache {
return new String[] { id };
}
+ private void addNewEntryInBitstreamHashMap(String id) {
+ String lookupBufferDeviceKernelName = id + String.format(".device=%d:%d", deviceContext.getDevice().getIndex(), deviceContext.getPlatformContext().getPlatformIndex());
+ precompiledBinariesPerDevice.put(lookupBufferDeviceKernelName, FPGA_BIN_LOCATION);
+ }
+
OCLInstalledCode installFPGASource(String id, String entryPoint, byte[] source) { // TODO Override this method for each FPGA backend
String[] compilationCommand;
final String inputFile = FPGA_SOURCE_DIR + LOOKUP_BUFFER_KERNEL_NAME + OPENCL_SOURCE_SUFFIX;
@@ -378,6 +380,7 @@ public class OCLCodeCache {
commandRename = new String[] { FPGA_CLEANUP_SCRIPT, vendor };
Path path = Paths.get(FPGA_BIN_LOCATION);
+ addNewEntryInBitstreamHashMap(id);
if (RuntimeUtilities.ifFileExists(fpgaBitStreamFile)) {
return installEntryPointForBinaryForFPGAs(id, path, LOOKUP_BUFFER_KERNEL_NAME);
} else {
