[refactor] Replace strings with contants
@@ -84,7 +84,6 @@ import uk.ac.manchester.tornado.drivers.opencl.OCLContext;
import uk.ac.manchester.tornado.drivers.opencl.OCLDevice;
import uk.ac.manchester.tornado.drivers.opencl.OCLDeviceContext;
import uk.ac.manchester.tornado.drivers.opencl.OCLTargetDescription;
-import uk.ac.manchester.tornado.drivers.opencl.OpenCL;
import uk.ac.manchester.tornado.drivers.opencl.enums.OCLDeviceType;
import uk.ac.manchester.tornado.drivers.opencl.graal.OCLArchitecture;
import uk.ac.manchester.tornado.drivers.opencl.graal.OCLCodeProvider;
@@ -121,6 +120,7 @@ public class OCLBackend extends TornadoBackend<OCLProviders> implements FrameMap
public final static boolean SHOW_OPENCL = Boolean.parseBoolean(System.getProperty("tornado.opencl.print", "False"));
public final static String OPENCL_PATH = System.getProperty("tornado.opencl.path", "./opencl");
+ private final static String FPGA_ATTRIBUTE = "__attribute__((reqd_work_group_size(16,1,1))) ";
@Override
public OCLTargetDescription getTarget() {
@@ -311,10 +311,6 @@ public class OCLBackend extends TornadoBackend<OCLProviders> implements FrameMap
// Avoid JIT compilation for FPGAs due to unsupported feature
// There is a bug in this check
// TO DO:
- if (isJITCompilationForFPGAs(deviceFullName)) {
-
- }
-
ResolvedJavaMethod resolveMethod = getTornadoRuntime().resolveMethod(getLookupMethod());
OCLProviders providers = (OCLProviders) getProviders();
OCLCompilationResult result = OCLCompiler.compileCodeForDevice(resolveMethod, null, meta, providers, this);
@@ -456,8 +452,9 @@ public class OCLBackend extends TornadoBackend<OCLProviders> implements FrameMap
* starting at address 0x0. (I assume that this is a interesting case that leads
* to a few issues.) Iris Pro is the only culprit at the moment.
*/
- if (Tornado.ACCELERATOR_IS_FPGA && !methodName.equals("lookupBufferAddress")) {
- asm.emitLine("__attribute__((reqd_work_group_size(16,1,1))) ");
+ if (Tornado.ACCELERATOR_IS_FPGA && !methodName.equals(OCLCodeCache.LOOKUP_BUFFER_KERNEL_NAME)) {
+ // TODO: FIX with info at the runtime, currently is a static decision
+ asm.emitLine(FPGA_ATTRIBUTE);
}
final String bumpBuffer = (deviceContext.needsBump()) ? String.format("%s void *dummy, ", OCLAssemblerConstants.GLOBAL_MEM_MODIFIER) : "";
