[feat][fix] Skip OpenCL compilation from source in OCLBackend for Xilinx FPGAs, unless the selected device is FPGA
@@ -274,9 +274,9 @@ public class OCLBackend extends TornadoBackend<OCLProviders> implements FrameMap
OCLTornadoDevice device = (OCLTornadoDevice) TornadoCoreRuntime.getTornadoRuntime().getDriver(driverIndex).getDevice(deviceIndex);
String platformName = device.getPlatformName();
- if (device.getDevice().getDeviceType() != OCLDeviceType.CL_DEVICE_TYPE_ACCELERATOR || !platformName.contains("FPGA")) {
+ if (device.getDevice().getDeviceType() != OCLDeviceType.CL_DEVICE_TYPE_ACCELERATOR || !(platformName.contains("FPGA") || platformName.contains("Xilinx"))) {
return false;
- } else if (device.getDevice().getDeviceType() == OCLDeviceType.CL_DEVICE_TYPE_ACCELERATOR && platformName.contains("FPGA")) {
+ } else if (device.getDevice().getDeviceType() == OCLDeviceType.CL_DEVICE_TYPE_ACCELERATOR && (platformName.contains("FPGA") || platformName.contains("Xilinx"))) {
return true;
}
return false;
@@ -314,14 +314,14 @@ public class OCLBackend extends TornadoBackend<OCLProviders> implements FrameMap
OCLProviders providers = (OCLProviders) getProviders();
OCLCompilationResult result = OCLCompiler.compileCodeForDevice(resolveMethod, null, meta, providers, this);
+ boolean isCompilationForFPGAs = isJITCompilationForFPGAs(deviceFullName);
+
if (Tornado.ACCELERATOR_IS_FPGA) {
lookupCode = deviceContext.installCode(result.getId(), result.getName(), result.getTargetCode(), Tornado.ACCELERATOR_IS_FPGA);
- } else {
+ } else if(!isCompilationForFPGAs){
lookupCode = deviceContext.installCode(result);
}
- boolean isCompilationForFPGAs = isJITCompilationForFPGAs(deviceFullName);
-
if (deviceContext.isKernelAvailable() && !isCompilationForFPGAs) {
lookupCodeAvailable = true;
}
