Browse Source

opencl: Remember results of global offset testing

Luke Dashjr 11 years ago
parent
commit
f8345dab78
1 changed files with 9 additions and 5 deletions
  1. 9 5
      ocl.c

+ 9 - 5
ocl.c

@@ -1103,12 +1103,16 @@ bool opencl_load_kernel(struct cgpu_info * const cgpu, _clState * const clState,
 				device_goffset_support = true;
 				break;
 			case BTS_FALSE:
-				// if the kernel doesn't require goffset, allow the user to disable it
-				if (kernel_goffset_support != 2)
-					break;
-				// fallthru
+				// if the kernel requires goffset, don't allow the user to disable it
+				if (kernel_goffset_support == 2)
+				{
+					if (opencl_test_goffset(clState))
+						device_goffset_support = true;
+				}
+				break;
 			case BTS_UNKNOWN:
-				if (opencl_test_goffset(clState))
+				data->use_goffset = opencl_test_goffset(clState);
+				if (data->use_goffset)
 					device_goffset_support = true;
 				break;
 		}