diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/scheduler/OCLScheduler.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/scheduler/OCLScheduler.java index 7f88208b14..8bb467abf5 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/scheduler/OCLScheduler.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/scheduler/OCLScheduler.java @@ -59,7 +59,11 @@ private static boolean isDriverVersionCompatible(OCLTargetDevice device) { int majorVersion = Integer.parseInt(device.getDriverVersion().split("\\.")[0]); int minorVersion = Integer.parseInt(device.getDriverVersion().split("\\.")[1]); - return majorVersion >= NVIDIA_MAJOR_VERSION_GENERIC_SCHEDULER && minorVersion >= NVIDIA_MINOR_VERSION_GENERIC_SCHEDULER; + if (majorVersion == NVIDIA_MAJOR_VERSION_GENERIC_SCHEDULER && minorVersion >= NVIDIA_MINOR_VERSION_GENERIC_SCHEDULER) { + return true; + } else { + return majorVersion > NVIDIA_MAJOR_VERSION_GENERIC_SCHEDULER; + } } private static OCLKernelScheduler getInstanceGPUScheduler(final OCLDeviceContext context) { @@ -67,11 +71,7 @@ private static OCLKernelScheduler getInstanceGPUScheduler(final OCLDeviceContext if (device.getDeviceVendor().contains(SUPPORTED_VENDORS.AMD.getName())) { return new OCLAMDScheduler(context); } else if (device.getDeviceVendor().contains(SUPPORTED_VENDORS.NVIDIA.getName())) { - if (isDriverVersionCompatible(device)) { - return new OCLNVIDIAGPUScheduler(context); - } else { - return new OCLGenericGPUScheduler(context); - } + return isDriverVersionCompatible(device) ? new OCLNVIDIAGPUScheduler(context) : new OCLGenericGPUScheduler(context); } else { return new OCLGenericGPUScheduler(context); } @@ -106,4 +106,4 @@ public static OCLKernelScheduler create(final OCLDeviceContext context) { } return null; } -} +} \ No newline at end of file