Commit f2d5db0c7770ee9a77fb7e7c5f46c0ef48a699d7

ckolivas 2012-02-10T16:45:35

Use only working kernels by default.

diff --git a/ocl.c b/ocl.c
index 677d6ca..1cbb0fa 100644
--- a/ocl.c
+++ b/ocl.c
@@ -361,9 +361,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 	char numbuf[10];
 
 	if (chosen_kernel == KL_NONE) {
-		if (strstr(name, "Tahiti"))
-			clState->chosen_kernel = KL_DIABLO;
-		else if (!clState->hasBitAlign)
+		if (strstr(name, "Tahiti") || !clState->hasBitAlign)
 			clState->chosen_kernel = KL_POCLBM;
 		else
 			clState->chosen_kernel = KL_PHATK;
@@ -371,14 +369,6 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 		clState->chosen_kernel = chosen_kernel;
 
 	switch (clState->chosen_kernel) {
-		case KL_DIABLO:
-			strcpy(filename, DIABLO_KERNNAME".cl");
-			strcpy(binaryfilename, DIABLO_KERNNAME);
-			break;
-		case KL_DIAKGCN:
-			strcpy(filename, DIAKGCN_KERNNAME".cl");
-			strcpy(binaryfilename, DIAKGCN_KERNNAME);
-			break;
 		case KL_POCLBM:
 			strcpy(filename, POCLBM_KERNNAME".cl");
 			strcpy(binaryfilename, POCLBM_KERNNAME);
@@ -388,6 +378,14 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 			strcpy(filename, PHATK_KERNNAME".cl");
 			strcpy(binaryfilename, PHATK_KERNNAME);
 			break;
+		case KL_DIAKGCN:
+			strcpy(filename, DIAKGCN_KERNNAME".cl");
+			strcpy(binaryfilename, DIAKGCN_KERNNAME);
+			break;
+		case KL_DIABLO:
+			strcpy(filename, DIABLO_KERNNAME".cl");
+			strcpy(binaryfilename, DIABLO_KERNNAME);
+			break;
 	}
 
 	FILE *binaryfile;