Browse Source

opencl: Default to phatk kernel for Mesa platform

Luke Dashjr 13 years ago
parent
commit
75495f6a24
1 changed files with 7 additions and 1 deletions
  1. 7 1
      ocl.c

+ 7 - 1
ocl.c

@@ -395,7 +395,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 {
 {
 	_clState *clState = calloc(1, sizeof(_clState));
 	_clState *clState = calloc(1, sizeof(_clState));
 	bool patchbfi = false, prog_built = false;
 	bool patchbfi = false, prog_built = false;
-	bool usebinary = true;
+	bool usebinary = true, ismesa = false;
 	struct cgpu_info *cgpu = &gpus[gpu];
 	struct cgpu_info *cgpu = &gpus[gpu];
 	cl_platform_id platform = NULL;
 	cl_platform_id platform = NULL;
 	char pbuff[256], vbuff[255];
 	char pbuff[256], vbuff[255];
@@ -564,6 +564,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 		applog(LOG_DEBUG, "Mesa OpenCL platform detected, disabling OpenCL kernel binaries and bitalign");
 		applog(LOG_DEBUG, "Mesa OpenCL platform detected, disabling OpenCL kernel binaries and bitalign");
 		clState->hasBitAlign = false;
 		clState->hasBitAlign = false;
 		usebinary = false;
 		usebinary = false;
+		ismesa = true;
 	}
 	}
 
 
 	/* Create binary filename based on parameters passed to opencl
 	/* Create binary filename based on parameters passed to opencl
@@ -581,6 +582,11 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 		if (opt_scrypt) {
 		if (opt_scrypt) {
 			applog(LOG_INFO, "Selecting scrypt kernel");
 			applog(LOG_INFO, "Selecting scrypt kernel");
 			clState->chosen_kernel = KL_SCRYPT;
 			clState->chosen_kernel = KL_SCRYPT;
+		}
+		else if (ismesa)
+		{
+			applog(LOG_INFO, "Selecting phatk kernel for Mesa");
+			clState->chosen_kernel = KL_PHATK;
 		} else if (!strstr(name, "Tahiti") &&
 		} else if (!strstr(name, "Tahiti") &&
 			/* Detect all 2.6 SDKs not with Tahiti and use diablo kernel */
 			/* Detect all 2.6 SDKs not with Tahiti and use diablo kernel */
 			(strstr(vbuff, "844.4") ||  // Linux 64 bit ATI 2.6 SDK
 			(strstr(vbuff, "844.4") ||  // Linux 64 bit ATI 2.6 SDK