[refactor] Added method that returns if a platform is FPGA
@@ -272,7 +272,7 @@ 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") || platformName.contains("Xilinx"))) {
+ if (device.getDevice().getDeviceType() != OCLDeviceType.CL_DEVICE_TYPE_ACCELERATOR || !isFPGA(platformName)) {
return false;
} else if (device.getDevice().getDeviceType() == OCLDeviceType.CL_DEVICE_TYPE_ACCELERATOR && (platformName.contains("FPGA") || platformName.contains("Xilinx"))) {
return true;
@@ -280,6 +280,10 @@ public class OCLBackend extends TornadoBackend<OCLProviders> implements FrameMap
return false;
}
+ private boolean isFPGA(String platformName) {
+ return ((platformName.contains("FPGA") || platformName.contains("Xilinx")));
+ }
+
/*
* Retrieve the address of the heap on the device
*/
