[feat] Fixed TornadoVM updated dimensions for FPGA tasks
@@ -30,6 +30,8 @@ import uk.ac.manchester.tornado.api.profiler.ProfilerType;
import uk.ac.manchester.tornado.runtime.common.TornadoOptions;
import uk.ac.manchester.tornado.runtime.tasks.meta.TaskMetaData;
+import java.util.Arrays;
+
public abstract class OCLKernelScheduler {
protected final OCLDeviceContext deviceContext;
@@ -37,6 +39,8 @@ public abstract class OCLKernelScheduler {
protected double min;
protected double max;
+ public static final String WARNING_FPGA_THREAD_LOCAL = "[TornadoVM OCL] Warning: TornadoVM changed the user-defined local size to: " + Arrays.toString(OCLFPGAScheduler.LOCAL_WORK_SIZE) + ".";
+
public static final String WARNING_THREAD_LOCAL = "[TornadoVM OCL] Warning: TornadoVM changed the user-defined local size to null. Now, the OpenCL driver will select the best configuration.";
OCLKernelScheduler(final OCLDeviceContext context) {
@@ -92,12 +96,18 @@ public abstract class OCLKernelScheduler {
OCLGridInfo gridInfo = new OCLGridInfo(deviceContext.getDevice(), local);
boolean checkedDimensions = gridInfo.checkGridDimensions();
if (!checkedDimensions) {
+ if (deviceContext.isPlatformFPGA()) {
+ System.out.println(WARNING_FPGA_THREAD_LOCAL);
+ grid.setLocalWork(64, 1, 1);
+ grid.setNumberOfWorkgroupsToNull();
+ } else {
System.out.println(WARNING_THREAD_LOCAL);
grid.setLocalWorkToNull();
grid.setNumberOfWorkgroupsToNull();
}
}
}
+ }
public int submit(final OCLKernel kernel, final TaskMetaData meta, final int[] waitEvents, long batchThreads) {
if (!meta.isWorkerGridAvailable()) {
